Apple 2 Print Unsigned Int16
Go to file
2017-07-06 15:28:28 -07:00
.gitignore ignore _FileInformation.txt 2017-07-06 15:27:49 -07:00
Makefile Fix move stack version to 2017-07-06 13:04:23 -07:00
print_uint16 Save another 8 bytes 2017-07-06 15:28:28 -07:00
print_uint16_sp Save another 8 bytes 2017-07-06 15:28:28 -07:00
print_uint16_sp.s Save another 8 bytes 2017-07-06 15:28:28 -07:00
print_uint16_zp Save another 8 bytes 2017-07-06 15:28:28 -07:00
print_uint16_zp.s Save another 8 bytes 2017-07-06 15:28:28 -07:00
print_uint16.s Save another 8 bytes 2017-07-06 15:28:28 -07:00
README.md Save another 8 bytes 2017-07-06 15:28:28 -07:00

Print unsigned 16-bit

6502 assembly code to print an unsigned 16-bit.

Features:

  • Highly optimized for space
  • No zero-page usage version 81 ($51) bytes
  • With zero-page usage version 69 ($45) bytes
  • With stack var usage version 83 ($53) bytes
  • Only 2 ROM entry points: COUT, SCRN2
  • Includes 7 byte demo

Machine Code

Copy/Paste into your favorite emulator.

Sans-Zero-Page version:

0800:A9 12 A2 34 4C 07 08 8E
0808:57 08 48 A2 00 8E 54 08
0810:8E 55 08 8E 56 08 A2 10
0818:F8 0E 57 08 68 2A 48 A0
0820:FD B9 57 07 79 57 07 99
0828:57 07 C8 D0 F4 CA D0 E9
0830:68 D8 A0 03 B9 53 08 20
0838:41 08 88 D0 F7 8A F0 0E
0840:60 48 20 7B F8 20 4B 08
0848:68 29 0F D0 01 CA E8 F0
0850:EF 4C E5 FD 00 00 00 00

With-Zero-Page version:

0900:A9 12 A2 34 4C 07 09 86
0908:FC 48 A0 00 84 FD 84 FE
0910:84 FF A0 10 F8 06 FC 68
0918:2A 48 A2 FD B5 00 75 00
0920:95 00 E8 D0 F7 88 D0 ED
0928:68 D8 A0 03 B9 FC 00 20
0930:39 09 88 D0 F7 8A F0 0E
0938:60 48 20 7B F8 20 43 09
0940:68 29 0F D0 01 CA E8 F0
0948:EF 4C E5 FD

With-Stack-Page version:

0A00:A9 12 A2 34 4C 07 0A A0
0A08:00 48 DA 5A 5A 5A A0 10
0A10:F8 BA 8E 30 0A 1E 04 01
0A18:3E 05 01 20 3C 0A 20 3C
0A20:0A 20 3C 0A 88 D0 EA D8
0A28:BD 00 01 20 47 0A CA E0
0A30:00 D0 F5 8A 69 04 AA 9A
0A38:98 F0 19 60 BD 01 01 7D
0A40:01 01 9D 01 01 E8 60 48
0A48:20 7B F8 20 51 0A 68 29
0A50:0F D0 01 88 C8 F0 E4 4C
0A58:E5 FD

License

WTFPL

Thanks

  • qkumba for great optimization ideas as always
  • Gids for a gentle nudge to have a zero-page version
  • Everyone on comp.sys.apple2

References

Apple Monitor: Print Integer?