dcpu16

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit dcea14591faa3f6201dd3a5035629aa8316f8f05
parent bca5c6e27ecc2b3f792d40c07e444c3ba2da48a5
Author: Travis Geiselbrecht <geist@foobox.com>
Date:   Sun,  8 Apr 2012 15:38:31 -0700

assembler: add r0-r7 aliases for the regular registers

Diffstat:
Massembler.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/assembler.c b/assembler.c @@ -146,6 +146,7 @@ void resolve_fixups(void) { enum tokens { tA, tB, tC, tX, tY, tZ, tI, tJ, + tR0, tR1, tR2, tR3, tR4, tR5, tR6, tR7, tSET, tADD, tSUB, tMUL, tDIV, tMOD, tSHL, tSHR, tAND, tBOR, tXOR, tIFE, tIFN, tIFG, tIFB, tJSR, @@ -157,6 +158,7 @@ enum tokens { }; static const char *tnames[] = { "A", "B", "C", "X", "Y", "Z", "I", "J", + "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "SET", "ADD", "SUB", "MUL", "DIV", "MOD", "SHL", "SHR", "AND", "BOR", "XOR", "IFE", "IFN", "IFG", "IFB", "JSR", @@ -279,6 +281,9 @@ int assemble_operand(void) { case tA: case tB: case tC: case tX: case tY: case tZ: case tI: case tJ: return token & 7; + case tR0: case tR1: case tR2: case tR3: + case tR4: case tR5: case tR6: case tR7: + return (token - 8) & 7; case tPOP: return 0x18; case tPEEK: return 0x19; case tPUSH: return 0x1a;