Updated test programs.
Test programs now work correctly with the latest CPU core changes.
This commit is contained in:
@@ -1,21 +1,25 @@
|
|||||||
; A test for the new math subroutines.
|
; A test for the new math subroutines.
|
||||||
|
|
||||||
#Include ../Libraries/print.asm
|
#Include ../Libraries/print.asm
|
||||||
#Include ../Libraries/math.asm
|
#Include ../Libraries/int8.asm
|
||||||
|
#Include ../Libraries/int16.asm
|
||||||
|
|
||||||
#Program
|
#Program
|
||||||
start:
|
start:
|
||||||
SETD SomeInt16Operands
|
SETD SomeInt16Operands
|
||||||
CALL int16sub
|
CALL int16div
|
||||||
BRC end
|
LDA
|
||||||
|
CALL printByteHex
|
||||||
|
INCD
|
||||||
|
LDA
|
||||||
|
CALL printByteHex
|
||||||
|
CALL blankSpace
|
||||||
|
INCD
|
||||||
LDA
|
LDA
|
||||||
CALL printByteHex
|
CALL printByteHex
|
||||||
INCD
|
INCD
|
||||||
LDA
|
LDA
|
||||||
CALL printByteHex
|
CALL printByteHex
|
||||||
INIA 0x3A
|
|
||||||
OUTA 0x00
|
|
||||||
BRI start
|
|
||||||
end:
|
end:
|
||||||
CALL lineFeed
|
CALL lineFeed
|
||||||
HALT
|
HALT
|
||||||
@@ -23,5 +27,5 @@
|
|||||||
#Data
|
#Data
|
||||||
|
|
||||||
SomeInt16Operands:
|
SomeInt16Operands:
|
||||||
0xFF 0xFF
|
0x01 0xF4
|
||||||
0x00 0x01
|
0x00 0x0A
|
||||||
|
|||||||
@@ -3,17 +3,15 @@
|
|||||||
#Program
|
#Program
|
||||||
|
|
||||||
printByteDecimalTest:
|
printByteDecimalTest:
|
||||||
INIB 0xFF ; Load 255 into B.
|
INIB 0xFF ; Load 255 into B.
|
||||||
printDecimalTestloop:
|
printDecimalTestloop:
|
||||||
SUB
|
; Print A and a blank space.
|
||||||
CCF ; Clear the Carry Flag.
|
CALL printByteDecimal
|
||||||
CALL printByteDecimal ; Print the value.
|
|
||||||
INCA ; Increment it.
|
|
||||||
PSHA
|
|
||||||
INIA 0x00
|
|
||||||
CALL blankSpace
|
CALL blankSpace
|
||||||
POPA
|
INCA ; Increment A.
|
||||||
BRQ printDecimalTestend ; If Q is zero, we're done.
|
DECB ; Decrement B.
|
||||||
|
; If B underflows, we're done.
|
||||||
|
BRC printDecimalTestend
|
||||||
BRI printDecimalTestloop ; Branch back to the start of the loop.
|
BRI printDecimalTestloop ; Branch back to the start of the loop.
|
||||||
printDecimalTestend:
|
printDecimalTestend:
|
||||||
CALL lineFeed
|
CALL lineFeed
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ printDigitTest:
|
|||||||
SUB
|
SUB
|
||||||
CCF
|
CCF
|
||||||
BRQ printDigitTestend
|
BRQ printDigitTestend
|
||||||
CALL lineFeed
|
CALL blankSpace
|
||||||
BRI printDigitTestLoop
|
BRI printDigitTestLoop
|
||||||
printDigitTestend:
|
printDigitTestend:
|
||||||
CALL lineFeed
|
CALL lineFeed
|
||||||
|
|||||||
@@ -2,18 +2,14 @@
|
|||||||
|
|
||||||
#Program
|
#Program
|
||||||
printByteHexTest:
|
printByteHexTest:
|
||||||
|
RSTA
|
||||||
INIB 0xFF
|
INIB 0xFF
|
||||||
CALL printByteHex
|
|
||||||
printHexTestLoop:
|
printHexTestLoop:
|
||||||
PSHA
|
|
||||||
INIA 0x00
|
|
||||||
CALL blankSpace
|
|
||||||
POPA
|
|
||||||
INCA
|
|
||||||
SUB
|
|
||||||
CCF
|
|
||||||
CALL printByteHex
|
CALL printByteHex
|
||||||
BRQ printHexTestend
|
CALL blankSpace
|
||||||
|
INCA
|
||||||
|
DECB
|
||||||
|
BRC printHexTestend
|
||||||
BRI printHexTestLoop
|
BRI printHexTestLoop
|
||||||
printHexTestend:
|
printHexTestend:
|
||||||
CALL lineFeed
|
CALL lineFeed
|
||||||
|
|||||||
Reference in New Issue
Block a user