diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2020-08-08 10:28:36 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2020-08-08 10:28:36 -0400 |
commit | 1ec19679b3db209429b0897f6ccda6d09d018a70 (patch) | |
tree | ef17e28b388a04fadeb14982a5332eb647981d8b /asmmon.c | |
parent | 39081609ec4f1f5d96e15e346eecd09ca2cc9f41 (diff) |
Did a ton of stuff.
- Changed the file structure of the SuB Suite, so that
all variable declarations, symbols, and constants
are in a single file.
- Moved the C library functionss into a separate
file, and made them use stack frames.
- Added support for using the emulator's assembler for
realtime debugging, to enter it, get in to stepping
mode by pressing Ctrl+s, press any other key, then
press F1,
The reason for having to press some other key before
pressing F1 is because it only allows entering the
assembler when the keyboard is not ready.
- Added the ".res" directive to the emulator's
assembler, the ".res" directive tells the assembler
to reserve however many bytes specified by the
operand.
- Fixed some bugs in the emulator's assembler.
Diffstat (limited to 'asmmon.c')
-rw-r--r-- | asmmon.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -17,7 +17,9 @@ uint16_t incl[MAX_TOK]; line *lines; line *last_line; symbol *symbols = 0; +symbol *last_sym = 0; fixup *fixups = 0; +fixup *last_fix = 0; static char tstr[2048]; @@ -110,7 +112,7 @@ char *showbits(uint64_t value, uint8_t bitnum, uint8_t dbg) { } -void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, uint8_t dbg) { +void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, uint64_t address, uint8_t dbg) { line *s = (!all) ? find_line(start, dbg) : lines ; line *e = (!all) ? find_line( end, dbg) : last_line; uint8_t j = 0; @@ -125,8 +127,8 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u uint8_t tabs; char mne_lower[4]; char ch[6]; - do { + address = s->addr; token *t = s->tok; uint8_t am = 0xFF; uint8_t rs = 0xFF; @@ -174,6 +176,12 @@ void list(uint16_t start, uint16_t end, uint8_t all, uint8_t ln, uint8_t addr, u case INDY: putchar('('); break; } break; + case TOK_OF: + switch (t->type) { + case 1: printf("sp"); break; + case 2: printf("pc"); break; + } + break; case TOK_SYM: case TOK_LABEL: if (t->type == 1) { @@ -436,9 +444,9 @@ int asmmon(const char *fn) { } i++; } - list(start, end, isstart, islinenum, isaddr, isdebug); + list(start, end, isstart, islinenum, isaddr, 0, isdebug); } else { - list(0, 0, 1, 0, 0, 0); + list(0, 0, 1, 0, 0, 0, 0); } break; case 0x08: @@ -447,6 +455,7 @@ int asmmon(const char *fn) { } if (!inc_file) { puts("Now assembling."); + address = 0; bc.progsize = 0; bc.datasize = 0; assemble(lines, &bc, dbg); |