summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-04-17 22:07:14 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-04-17 22:07:14 -0400
commit0a7a2a7a8f95730811117bd2aa904f1843f65071 (patch)
tree24d62bbdba0df124c7fe8af781312af993236ebb /test
parentc5150ee31f07208422f1435de9b35a0d0168cbb5 (diff)
Made both the assembly language monitor, and the
emulator smaller, and faster. I am also starting to make SuBEditor's source code more readable.
Diffstat (limited to 'test')
-rw-r--r--test/asr.s4
-rw-r--r--test/fib-new.s1
-rw-r--r--test/fib.s1
-rw-r--r--test/fib2.s37
-rw-r--r--test/nop.s12
-rw-r--r--test/reg-transfer.s1
-rw-r--r--test/subroutine.s1
-rw-r--r--test/test-stack.s15
8 files changed, 48 insertions, 24 deletions
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