gateware

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

commit 34c05bff2d4c3bc0e1c60eece88b0ef116a05a9d
parent fb3f1aa2b2634770bea648375eb3a0f4328c5d2a
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 24 Nov 2018 22:43:38 -0800

a16: add halt pseudo-op

Diffstat:
Msrc/a16v4.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/a16v4.c b/src/a16v4.c @@ -237,7 +237,7 @@ enum tokens { tCOMMA, tCOLON, tOBRACK, tCBRACK, tDOT, tHASH, tSTRING, tNUMBER, tADD, tSUB, tAND, tORR, tXOR, tSLT, tSGE, tMUL, tLW, tSW, tNOP, tNOT, tB, tBL, tBZ, tBNZ, - tMOV, tEXT, tDEBUG, + tMOV, tEXT, tDEBUG, tHALT, tR0, tR1, tR2, tR3, tR4, tR5, tR6, tR7, tSP, tLR, tEQU, tWORD, tASCII, tASCIIZ, @@ -249,7 +249,7 @@ char *tnames[] = { ",", ":", "[", "]", ".", "#", "<STRING>", "<NUMBER>", "ADD", "SUB", "AND", "ORR", "XOR", "SLT", "SGE", "MUL", "LW", "SW", "NOP", "NOT", "B", "BL", "BZ", "BNZ", - "MOV", "EXT", "DEBUG", + "MOV", "EXT", "DEBUG", "HALT", "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "SP", "LR", "EQU", "WORD", "STRING", "ASCIIZ" @@ -575,6 +575,9 @@ void assemble_line(int n, unsigned *tok, unsigned *num, char **str) { expect(tNUMBER, T3); emit(OP_NOP); //TODO return; + case tHALT: + emit(0xFFFF); + return; case tWORD: tmp = 1; for (;;) {