From 0a7a2a7a8f95730811117bd2aa904f1843f65071 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 17 Apr 2020 22:07:14 -0400 Subject: Made both the assembly language monitor, and the emulator smaller, and faster. I am also starting to make SuBEditor's source code more readable. --- test/asr.s | 4 ++-- test/fib-new.s | 1 + test/fib.s | 1 + test/fib2.s | 37 ++++++++++++++++++++++--------------- test/nop.s | 12 ++++++++++++ test/reg-transfer.s | 1 + test/subroutine.s | 1 + test/test-stack.s | 15 ++++++++------- 8 files changed, 48 insertions(+), 24 deletions(-) create mode 100644 test/nop.s (limited to 'test') diff --git a/test/asr.s b/test/asr.s index c01269e..a3b72c0 100644 --- a/test/asr.s +++ b/test/asr.s @@ -4,7 +4,6 @@ reset: cps - start: lda #0 sbc #$FFFF @@ -18,6 +17,7 @@ signshft: .org $FFC0 .qword reset -.org $0 + +a done diff --git a/test/fib-new.s b/test/fib-new.s index ed0aa50..5a8ae83 100644 --- a/test/fib-new.s +++ b/test/fib-new.s @@ -67,5 +67,6 @@ fib2: .org $FF50 .qword init2 ; Execute the program. +a done diff --git a/test/fib.s b/test/fib.s index 40489ec..dd8c618 100644 --- a/test/fib.s +++ b/test/fib.s @@ -68,5 +68,6 @@ fib2: .org $FF50 .qword init2 ; Execute the program. +a done diff --git a/test/fib2.s b/test/fib2.s index d8c0d42..59830a2 100644 --- a/test/fib2.s +++ b/test/fib2.s @@ -1,26 +1,33 @@ ; Variables for thread 0. .org $1000 x: - .qword $0 + .qword 0 y: - .qword $1 + .qword 1 z: - .qword $0 + .qword 0 +zero: + .qword 0 -.org $0 +.org 0 init: cps ; Clear the Processor Status register. - start: - lda #0 ; Clear the accumulator. - ldb.q y ; b=1. + lsr #63 ; Reset the accumulator. + tab ; + tax ; + tay ; + inb ; + clc ; fib: - aab ; Add x with y. - ldb.q y - stb.q x ; x=y. - sta.q y ; y=z. - tab - lda.q x - bcs start ; Start all over again, if the carry flag was set. - jmp fib ; Otherwise, keep looping. + tya ; + aab ; Add x with y. But did we also carry over? + bcs start ; Yes, so restart. + tax ; + tya ; + tab ; + txa ; + tay ; + jmp fib ; No, so keep looping. +a done diff --git a/test/nop.s b/test/nop.s new file mode 100644 index 0000000..8fbb14f --- /dev/null +++ b/test/nop.s @@ -0,0 +1,12 @@ +reset: + cps +nop_loop: + nop + nop + nop + nop + nop + nop + jmp nop_loop +a +done diff --git a/test/reg-transfer.s b/test/reg-transfer.s index abedc5b..37e0d51 100644 --- a/test/reg-transfer.s +++ b/test/reg-transfer.s @@ -16,5 +16,6 @@ bench: .qword reset ; Execute the program. +a done diff --git a/test/subroutine.s b/test/subroutine.s index 65e46ca..7db1b87 100644 --- a/test/subroutine.s +++ b/test/subroutine.s @@ -45,5 +45,6 @@ clr_buf_end: ;.byte $1 .org $FFC0 .qword reset +a done diff --git a/test/test-stack.s b/test/test-stack.s index 193cca7..b9218a0 100644 --- a/test/test-stack.s +++ b/test/test-stack.s @@ -1,13 +1,13 @@ init: -cps -ldx.w #$FFFF -txs + cps + ldx.w #$FFFF + txs loop: -iab -pha #$08 -ply #$08 -jmp loop + inc + pha #1 + ply #1 + jmp loop .org $FFC0 .qword init @@ -20,5 +20,6 @@ jmp loop .qword init .qword init +a done -- cgit v1.2.3-13-gbd6f