Converts a four-digit hexadecimal number to decimal on the TS1000 or ZX81.
RUN it, enter the first two digits, then the next two, then a single space (each followed by ENTER) to get the answer. It needs 2K or more, as on a TS1000: it uses addresses around 30000 as scratch memory, and that fails on a 1K ZX81.
Published in LISTing February 1985 (HEX>DEC), and printed again, with the author’s name, in June-August 1989.
Source Code
5 REM HEX>DEC
10 POKE 30000,1
20 POKE 30003,201
30 LET X=30001
40 LET A$=""
50 IF A$="" THEN INPUT A$
60 PRINT A$;
70 IF A$=" " THEN GO TO 120
80 POKE X,16*CODE A$+CODE A$(2)-476
90 LET X=X+1
100 LET A$=A$(3 TO )
110 GO TO 50
120 PRINT " ";PEEK (X-2)*256+PEEK (X-1)Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

