From 071edf621a6722f94027f37720a5a5f73d9696c0 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 17 Mar 2020 15:07:20 -0400 Subject: Revamped the opcode table, made the emulator more efficient, and ported SuBEditor to C. I revamped the opcode table to add another prefix bit for the addressing mode, finally giving access to all addresses, without wasting any bytes. I made the stack based operations more efficient, by sort of applying Duff's device to it. And I ported SuBEditor to C, to make it easier for me to figure out how to implement SuBAsm. --- programs/c-ports/annotated-dabbed.s | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 programs/c-ports/annotated-dabbed.s (limited to 'programs/c-ports/annotated-dabbed.s') diff --git a/programs/c-ports/annotated-dabbed.s b/programs/c-ports/annotated-dabbed.s new file mode 100644 index 0000000..fca6e81 --- /dev/null +++ b/programs/c-ports/annotated-dabbed.s @@ -0,0 +1,38 @@ +dabbed: ; 472: uint8_t dabbed() { + ldb #0 ; + lda.w #tok ; + sta.q ptr2 ; + tba ; +dab_st: ; + phy #2 ; + txy ; 475: while (!done) { + lda (ptr6), y ; 476: if (!cmd_buf[i]) { + beq dab_pend ; 477: done = 1; + cmp (ptr2), y ; 478: } else if (cmd_buf[i] == tok[i]) { + beq chk_str ; 479: + jmp dab_pend ; 484: } else { + ; 485: done = 1; + ; 486: } +chk_str: ; + ply #2 ; + inx ; 479: i++; + cpx #3 ; + bne dab_st ; + ldx #0 ; 480: if (i == 3) { +pnt_msg: ; + lda.w #msg ; + ldx #0 ; + stx.q ptr ; + jsl print_str ; 481: print_str(msg); + jmp dab_peqnd ; 482: break; + ; 483: } +dab_pend: ; + ply #2 ; + lda #1 ; 477/485: done = 1; + jmp dab_end ; +dab_peqnd: ; + lda #0 ; done = 0; + jmp dab_end ; +dab_end: ; 487: } + rtl ; 488: return done; + ; 489: } -- cgit v1.2.3-13-gbd6f