1000 NM$="N U M V E R T"' Converts Decimal, Hex and Octal Numbers 1010 REV$="Rev: 830120"'By Robert Hamilton 1020 DEFINT N:ON ERROR GOTO 1200 1030 SCREEN 0,0,0:WIDTH 80:COLOR 2,0,0:KEY OFF:CLS:UP$=STRING$(1,30) 1040 LOCATE ,,1,12,13:DEF SEG=0:IF PEEK (&H410)= 109 THEN LOCATE ,,,6,7 1050 DEF SEG=64:POKE 23,32:DEF SEG:CL$=STRING$(79,0):Q$=CHR$(34) 1060 CLS:LOCATE 5,30:PRINT NM$;CHR$(10);TAB(31);REV$:LOCATE 20,1:COLOR 6,0 1070 LOCATE 15,1:PRINT"NOTE: This program converts positive and negative numbers and Letters," 1080 PRINT" to Decimal, Hexidecimal, Octal and Binary numbers":LOCATE 20,1 1090 COLOR 10,0:INPUT"ENTER: ASCII, Dec, Hex or Oct (32767 to -32768)......(99999 = Quit) ==> ",N$ 1100 IF N$="%" OR N$="-" THEN BEEP:GOSUB 1220:GOTO 1090 1110 IF N$="" THEN N=0:GOTO 1140 1120 IF VAL(N$)=0 THEN N=ASC(N$):GOTO 1140 1130 N=VAL(N$) 1140 COLOR 4,0:PRINT "ASCII"," DEC","HEX","OCT","BINARY.8.6.4.2.0":COLOR 6,0 1150 IF N<0 OR N=>255 THEN PRINT " n/a",N,HEX$(N),OCT$(N),:GOTO 1170 1160 PRINT SPC(1);CHR$(N),N,HEX$(N),OCT$(N), 1170 IF N>-1 THEN PRINT USING"!";"0";:FOR J=14 TO 0 STEP -1:PRINT USING "#";N\2^J MOD 2;:NEXT 1180 IF N<0 THEN PRINT USING"!";"1";:FOR J=14 TO 0 STEP -1:PRINT USING "#";(32768!+N)\2^J MOD 2;:NEXT 1190 PRINT CHR$(10):GOTO 1090 1200 DEF SEG=64:POKE 23,128:SOUND 500,5:KEY ON 1210 COLOR 6,0:ON ERROR GOTO 0:END 1220 PRINT CL$;UP$;:LOCATE ,1:RETURN