Added stuff. Fixed bug.

Data Pointer value now properly displayed in debug mode.
Added conditional calls to match conditional branches.
This commit is contained in:
Anachronaut
2024-10-31 13:30:15 -04:00
committed by GitHub
parent f8848adf8c
commit 228cf0593a
12 changed files with 414 additions and 44 deletions
@@ -0,0 +1,25 @@
; Tests for the printDecimal subroutine.
#Program
printByteDecimalTest:
INIB 0xFF ; Load 255 into B.
printDecimalTestloop:
SUB
CCF ; Clear the Carry Flag.
CALL printByteDecimal ; Print the value.
INCA ; Increment it.
PSHA
INIA 0x00
CALL blankSpace
POPA
BRQ printDecimalTestend ; If Q is zero, we're done.
BRI printDecimalTestloop ; Branch back to the start of the loop.
printDecimalTestend:
CALL lineFeed
RET
#Data
Space:
" "
+17
View File
@@ -0,0 +1,17 @@
#Program
printDigitTest:
INIB 0d10
printDigitTestLoop:
CALL printDecimalDigit
INCA
SUB
CCF
BRQ printDigitTestend
CALL lineFeed
BRI printDigitTestLoop
printDigitTestend:
CALL lineFeed
RET
#Data
+22
View File
@@ -0,0 +1,22 @@
; Test for the hexadecimal printing routines.
#Program
printByteHexTest:
INIB 0xFF
CALL printByteHex
printHexTestLoop:
PSHA
INIA 0x00
CALL blankSpace
POPA
INCA
SUB
CCF
CALL printByteHex
BRQ printHexTestend
BRI printHexTestLoop
printHexTestend:
CALL lineFeed
RET
#Data
+58
View File
@@ -0,0 +1,58 @@
; Tests for the printing subroutines provided by print.asm
#Include ../Libraries/print.asm
#Include printDigitTest.asm
#Include printDecimalTest.asm
#Include printHexTest.asm
#Program
clearRegisters:
INIA 0x00;
INIB 0x00;
ADD
RET
start:
SETD String0
CALL printString
CALL lineFeed
SETD String1
CALL printString
CALL lineFeed
CALL clearRegisters
CALL printDigitTest
CALL lineFeed
SETD String2
CALL printString
CALL lineFeed
CALL clearRegisters
CALL printByteDecimalTest
CALL lineFeed
SETD String3
CALL printString
CALL lineFeed
CALL clearRegisters
CALL printByteHexTest
CALL lineFeed
SETD String4
CALL printString
CALL lineFeed
HALT
#Data
String0:
"Test suite for SplitBit's print.asm library."
String1:
"Testing printDigit..."
String2:
"Testing printByteDecimal..."
String3:
"Testing printByteHex..."
String4:
"Testing complete!"
+84
View File
@@ -0,0 +1,84 @@
; A simple test for the new SHL and SHR instructions.
#Include print.asm
#Program
start:
SETD String0
CALL printString
loop0:
SETD TestValue0
CALL printDecimal
LDA
SHL
STA
SETD Space
CALL printString
BRA doB
BRI loop0
doB:
CALL lineFeed
SETD String1
CALL printString
SETD TestValue0
STB
loop1:
SETD TestValue0
CALL printDecimal
LDB
SHL
STB
SETD Space
CALL printString
BRB doRight
BRA loop1
doRight:
CALL lineFeed
SETD String0
CALL printString
loop2:
SETD TestValue1
CALL printDecimal
LDA
SHR
STA
SETD Space
CALL printString
BRA doRightB
BRI loop2
doRightB:
CALL lineFeed
SETD String1
CALL printString
SETD TestValue1
STB
loop3:
SETD TestValue1
CALL printDecimal
LDB
SHR
STB
SETD Space
CALL printString
BRB end
BRA loop3
end:
CALL lineFeed
HALT
#Data
TestValue0:
0d01
TestValue1:
0d128
String0:
"A values: "
String1:
"B values: "
Space:
" "