3 ms·
I love how you could mix 6502 assembly and also create macros. For example, you could declare something like this to move two bytes from F% to T%: 870 DEF F
by forinti 6y ago
I love how you could mix 6502 assembly and also create macros.
For example, you could declare something like this to move two bytes from F% to T%:
870 DEF FNMOVW(F%,T%)
880 [
890 OPT pass%
900 LDA F%
910 STA T%
920 LDA F%+&1
930 STA T%+&1
940 ]
950 =pass%
And then reference it from somewhere else like so:
220 OPT FNMOVW(&52,&4B)
And the resulting code would be inlined into your assembly. It made for shorter and more readable assembly.
- mrspeaker 6y agoThat's amazing! I had a C64 as a kid, and never learned any real 6502 because getting beyond "flash the border a different color" was tough: I only had a machine code monitor in a cartridge, and never figured out how to load/save programs. Being able to inline assembly would have made it so much easier to experiment and learn!
- elvis70 6y agoI have an Amstrad NC100 with BBC Basic for Z80 and it supports inline assembly as well. It is highly recommended to save your programs on the (optional) SRAM card before testing them though as it is so easy to reset the machine or corrupt the main memory.