Jump to content

Extend your language: Difference between revisions

m
Line 40:
Although new opcodes cannot be created, they can be combined in ways to re-create opcodes on other architectures. Expanding the language is typically accomplished with macros or, if the hardware allows, self-modifying code.
 
This is an (admittedly messy) implementation of the double-conditional branch. Unfortunately due to the nature of the processor each branch type needs its own macro. For brevity's sake only <code>BEQ</code> will be displayed here. The rest can be created with simply copy-pasting and substitution.
As for the task, an N-way branch is already possible by indexing into a jump block.
 
<lang 6502asm>CMP_Double .macro ;NESASM3 syntax
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.