5 CLS
10 GO TO 1000
100 DIM H$(4)
105 LET p=4
110 LET h$="0000"
115 PRINT AT 20,0;" ";AT 20,0; FLASH 1;">"; FLASH 0;" Enter the decimal number."
120 INPUT d
122 LET e=d
125 PRINT AT 20,0;" "
130 LET n=INT (d/16)
131 LET rr=(d-16*n+48)
132 IF rr>57 THEN LET rr=rr+7
135 LET h$(p)=CHR$ (rr)
140 LET d=n
145 LET p=p-1
150 IF d>0 THEN GO TO 130
160 PRINT AT 20,0;e;" Hex Value is ";h$
170 GO TO 1000
200 PRINT AT 20,0;" ";AT 20,0; FLASH 1;">"; FLASH 0;" Enter the four digit hex."
202 POKE 23658,8
205 INPUT h$
210 LET d=0
215 FOR p=1 TO 4
217 LET rr=(CODE (h$(p))-48)
218 IF rr>9 THEN LET rr=rr-7
220 LET d=d*16+(rr)
225 NEXT p
230 PRINT AT 20,0;" ";AT 20,0;h$;" Decimal value is ";d
235 POKE 23658,0
240 GO TO 1000
300 DIM a$(8)
305 LET o=0
307 PRINT AT 21,9;"▒"
310 PRINT AT 20,0;" ";AT 20,0; FLASH 1;">"; FLASH 0;" Enter BIN code."
314 INPUT b$
315 LET a$=b$
316 LET i=LEN b$
317 IF i<>8 THEN GO TO 400
320 LET b=128
330 FOR f=1 TO 8
340 LET q=VAL a$(f)
350 LET o=o+(q*b)
360 LET b=b/2
370 NEXT f
375 PRINT AT 21,9;" "
380 PRINT AT 20,0;" ";AT 20,0;a$;" BIN is ";o;" decimal."
390 GO TO 1000
400 IF i<8 THEN PRINT FLASH 1;AT 20,0;" NOT ENOUGH DIGITS WERE ENTERED "
410 IF I>8 THEN PRINT FLASH 1;AT 20,0;" TOO MANY DIGITS WERE ENTERED "
420 PAUSE 100
430 PRINT AT 20,0;" "
440 GO TO 300
500 CLS
510 PRINT AT 10,0;"▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒";AT 12,4;"EXIT COMMAND EXECUTED"," PRESS ENTER TO CLEAR MEMORY";AT 15,0;"▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒"
515 PAUSE 4E4
520 NEW
1000 PRINT AT 5,0;"▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒";AT 7,3; INVERSE 1;"DECIMAL/HEX/BIN CONVERTOR";
1010 PRINT AT 9,6;"1) DECIMAL TO HEX";AT 10,6;"2) HEX TO DECIMAL";AT 11,6;"3) BIN TO DECIMAL";AT 12,6;"4) EXIT PROGRAM"
1015 PRINT AT 13,0;"▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒"
1017 PRINT ,," Enter your choice 1 to 4"
1018 PRINT AT 15,0; FLASH 1;">"
1019 BEEP .15,10
1020 INPUT S
1025 PRINT AT 15,0;" "
1030 IF S<1 OR S>4 THEN GO TO 1000
1035 IF S=4 THEN LET S=5
1040 GO TO S*100
1050 STOP
1060 SAVE "conv" LINE 1
Transcription note: the listing is corrected so it runs. As printed, line 1018 reads AT ,15,0, which stops the program; corrected to AT 15,0.
If you program in machine code (or would like to) or like to design user graphics, here’s a simple little program that makes it easy to convert hex to decimal, decimal to hex and BIN numbers to decimal. While the program is rather clear and simple, there is one important thing to remember in entering hex you wish to convert to decimal. That is 05C3 is very radically different from 5C30.
The program is written for the 2068, but a TS1000 version can be written by just changing the CHR$ codes. If you can’t figure that out, just give me a call.
Feel free to modify the program so that it prints out data statements for your user graphics, or MC routines, there is certainly enough memory available.(The program loads in about 20 seconds). It may even be merged with some assembler programs.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.