HEX/DEC

[file: Hex/Dec]



This program uses a trick with the RANDOMIZE statement. If the command

RANDOMIZE 32678 is entered then the two byte equivalent is stored in

the system variables called SEED at addresses 23670 and 23671.



If we then PEEK them and feed them into the original routine one after

the other then the conversion is achieved. Also included are the two

values of these addresses in decimal form and these are printed in the

machine code structure LOW byte / HIGH byte. You could of course

rearrange this if you prefer.



However, all good ideas usually have at least one drawback and the

main one with using this system is that RANDOMIZE 0 causes the number

to be placed in SEED to be completely random, although we probably all

know that 0 in decimal is 0000 in HEX. So, just for cosmetic purposes

the program also includes a line to trap input of 0 and to deal with

it separately.

