From 5dd788d5a1acc7f23835882420d50e9f020728ac Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Mon, 18 May 2020 13:14:08 -0400 Subject: Did alot of stuff while I was up at the family trailer. - Moved the large enums, and large tables into separate header files. - Added enums for implementing the base extension - Fixed a bug in the assembler. - Worked more on SuBAsm. --- test/add-sub.s | 27 +++++++++++++++++++++++++++ test/ind-addr.s | 24 +++++++++++++----------- 2 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 test/add-sub.s (limited to 'test') diff --git a/test/add-sub.s b/test/add-sub.s new file mode 100644 index 0000000..694931d --- /dev/null +++ b/test/add-sub.s @@ -0,0 +1,27 @@ +; Test adding, and subtracting. +; +; Written by mr b0nk 500 + +; Main Program. +.org 0 +reset: + cps ; Clear the processor status register. + ldx.w #$FFFF ; Reset the stack pointer. + txs ; + lsr #16 ; Reset A. + tab ; Reset B. + tax ; Reset X. +up: + inc ; Increment the counter. + cmp #$FF ; Did the accumulator overflow? + bcs down ; Yes, so start decrementing. + jmp up ; No, so keep incrementing. +down: + dec ; Did the accumulator underflow? + beq up ; Yes, so start incrementing. + jmp down ; No, so keep decrementing. + +.org $FFC0 +.qword reset +a +d diff --git a/test/ind-addr.s b/test/ind-addr.s index 0c9365b..005c016 100644 --- a/test/ind-addr.s +++ b/test/ind-addr.s @@ -1,8 +1,14 @@ -.org $0 +.org 0 +rot: + .qword 0 + +.org $1000 reset: cps - lda #1 ldb #1 + lda.w #rotate_left + sta.q rot + tba main: jsr (rot) jmp main @@ -15,13 +21,9 @@ rotate_right: rrb rts -.org $1000 -rot: - .qword rotate_left -r -.org $0 -v -.org $1000 -v -done +.org $FFC0 +.qword reset + +a +d -- cgit v1.2.3-13-gbd6f