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. --- test/subroutine.s | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/subroutine.s (limited to 'test/subroutine.s') diff --git a/test/subroutine.s b/test/subroutine.s new file mode 100644 index 0000000..03447fd --- /dev/null +++ b/test/subroutine.s @@ -0,0 +1,45 @@ +.org $2000 +buf: + +.org $0 +ptr: +.qword buf + +.org $8000 +reset: + cps + ldx.w #$FFFF + txs +start: + ldy #0 + ldb #0 + inb + stb $C010 + deb + jsl clr_buf + jmp start + +clr_buf: + lda #0 + cpy.w #$1FFF + bcs clr_buf_end + sta.q (ptr), y + tya + adc #8 + tay + tba + sta.q (ptr), y + tya + adc #8 + tay + tba + jmp clr_buf +clr_buf_end: + ldy.w #0 + rtl + + +.org $FFC0 +.qword reset +done + -- cgit v1.2.3-13-gbd6f