APPENDIX NINE -MAX*BYTE:MAX=MAX/16:NEXT L 340 ?:?"BINARY","HEXADECIMAL","DECIMA L" 350 ? " ";BIN$,W$,Q 390 GOTO 40 This program will translate any hexadecimal, decimal, and binary number to and from the others. There are some constraints in its use: it will not translate a binary number for any hex number larger than $FF or decimal number larger than 255. It will not translate any hex number larger than $FFFF or any decimal number larger than 65535. Since about 99% of your numeric manipulations will be within these ranges, you should have no problems. You can easily remove the translation routines from the program for use in your own utility. For a quick way to translate any number in the range of zero to 65535 ($FFFF), use the table below. It's quite simple to use: to translate hex to decimal you take the number that appears in the column that corresponds to the value in the proper row and add the values together. The total is your decimal number. For example: $7AC1 = 28672 fourth column, 7 2560 third column, A 192 second column, C 1 first column, 1 ----- 31425 decimal value To translate decimal into hex, you find the largest number less than the number you wish to translate and subtract it from your original number. The value in the row is the first hexadecimal value. You then do the same with the remainder until your result is zero. The values in the row are then concatenated together for a hexadecimal number. For example: 31425 = 31425 - 28672 largest number, column four. first hex number = 7 ----- 2753 remainder, minus third column 2560 second hex number = A ----- 193 remainder, minus second column 192 third hex number = C ----- 1 remainder and fourth hex number Hexadecimal value = $7AC1 Hex Column Hex number fourth third second first number 1 4096 256 16 1 1 2 8192 512 32 2 2 3 12288 768 48 3 3