Extend your language: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 40: | 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. |
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 |
<lang 6502asm>CMP_Double .macro ;NESASM3 syntax |