Home » Archimedes archive » Micro User » MU 1991-10.adf » Listings » Routines/Hexadec
Routines/Hexadec
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Micro User » MU 1991-10.adf » Listings |
Filename: | Routines/Hexadec |
Read OK: | ✔ |
File size: | 0166 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM 8-bit hexadecimal output 20REM by Neville Itchens 30REM (c) The Micro User 40wrch=&FFEE:FOR pass=0 TO 3 STEP 3 50P%=&900:[OPT pass 60.hex:PHA:LSR A:LSR A:LSR A:LSR A:JSR hex2:PLA:.hex2:AND #15:ORA #48:CMP #58:BCC less:ADC #6:.less:JMP wrch 70]:NEXT:REPEAT 80INPUT '"Enter decimal number: "A% 90IF A%>255 PRINT "Too large!" ELSE PRINT "That's ";:CALL &900:PRINT " in hexadecimal." 100UNTIL 0
� 8-bit hexadecimal output � by Neville Itchens � (c) The Micro User (wrch=&FFEE:� pass=0 � 3 � 3 2P%=&900:[OPT pass <k.hex:PHA:LSR A:LSR A:LSR A:LSR A:JSR hex2:PLA:.hex2:� #15:�A #48:CMP #58:BCC less:ADC #6:.less:JMP wrch F ]:�:� P!� '"Enter decimal number: "A% ZF� A%>255 � "Too large!" � � "That's ";:� &900:� " in hexadecimal." d� 0 �
00000000 0d 00 0a 1e f4 20 38 2d 62 69 74 20 68 65 78 61 |..... 8-bit hexa| 00000010 64 65 63 69 6d 61 6c 20 6f 75 74 70 75 74 0d 00 |decimal output..| 00000020 14 18 f4 20 62 79 20 4e 65 76 69 6c 6c 65 20 49 |... by Neville I| 00000030 74 63 68 65 6e 73 0d 00 1e 18 f4 20 28 63 29 20 |tchens..... (c) | 00000040 54 68 65 20 4d 69 63 72 6f 20 55 73 65 72 0d 00 |The Micro User..| 00000050 28 1f 77 72 63 68 3d 26 46 46 45 45 3a e3 20 70 |(.wrch=&FFEE:. p| 00000060 61 73 73 3d 30 20 b8 20 33 20 88 20 33 0d 00 32 |ass=0 . 3 . 3..2| 00000070 15 50 25 3d 26 39 30 30 3a 5b 4f 50 54 20 70 61 |.P%=&900:[OPT pa| 00000080 73 73 0d 00 3c 6b 2e 68 65 78 3a 50 48 41 3a 4c |ss..<k.hex:PHA:L| 00000090 53 52 20 41 3a 4c 53 52 20 41 3a 4c 53 52 20 41 |SR A:LSR A:LSR A| 000000a0 3a 4c 53 52 20 41 3a 4a 53 52 20 68 65 78 32 3a |:LSR A:JSR hex2:| 000000b0 50 4c 41 3a 2e 68 65 78 32 3a 80 20 23 31 35 3a |PLA:.hex2:. #15:| 000000c0 84 41 20 23 34 38 3a 43 4d 50 20 23 35 38 3a 42 |.A #48:CMP #58:B| 000000d0 43 43 20 6c 65 73 73 3a 41 44 43 20 23 36 3a 2e |CC less:ADC #6:.| 000000e0 6c 65 73 73 3a 4a 4d 50 20 77 72 63 68 0d 00 46 |less:JMP wrch..F| 000000f0 09 5d 3a ed 3a f5 0d 00 50 21 e8 20 27 22 45 6e |.]:.:...P!. '"En| 00000100 74 65 72 20 64 65 63 69 6d 61 6c 20 6e 75 6d 62 |ter decimal numb| 00000110 65 72 3a 20 22 41 25 0d 00 5a 46 e7 20 41 25 3e |er: "A%..ZF. A%>| 00000120 32 35 35 20 f1 20 22 54 6f 6f 20 6c 61 72 67 65 |255 . "Too large| 00000130 21 22 20 8b 20 f1 20 22 54 68 61 74 27 73 20 22 |!" . . "That's "| 00000140 3b 3a d6 20 26 39 30 30 3a f1 20 22 20 69 6e 20 |;:. &900:. " in | 00000150 68 65 78 61 64 65 63 69 6d 61 6c 2e 22 0d 00 64 |hexadecimal."..d| 00000160 07 fd 20 30 0d ff |.. 0..| 00000166