Mercurial > repos > simple16
diff src/asm.c @ 46:51672bd41cdd
Rework data segment setup to allow a stack segment and to add space for push and pop instructions
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 30 Aug 2016 20:50:54 -0700 |
parents | 718aaedc4582 |
children | f9846719aa26 |
line wrap: on
line diff
--- a/src/asm.c Mon Aug 29 21:17:41 2016 -0700 +++ b/src/asm.c Tue Aug 30 20:50:54 2016 -0700 @@ -120,8 +120,8 @@ } return ret; } - index = find_string_arr(mnemonics_single_reg, mnemonic, SETDATABANKS+1); - if (index > SETDATABANKS) { + index = find_string_arr(mnemonics_single_reg, mnemonic, SETVBR+1); + if (index > SETVBR) { ret.base = 0xFFFF; return ret; } @@ -308,6 +308,14 @@ return 1; } } + if (!strcmp(arg, "db")) { + *inst |= REG_DB << arg_shift; + return 1; + } + if (!strcmp(arg, "sp")) { + *inst |= REG_SP << arg_shift; + return 1; + } if (!strcmp(arg, "pc")) { *inst |= REG_PC << arg_shift; return 1;