DP offset instructions, new demo programs.

Added DPUP and DPDN, which take a one byte operand specifying how far up or down to offset the Data Pointer.
Three Fibonacci generators using the print.asm library.
 - 8 bit values printing in decimal representation.
- 16 bit values printing in hexadecimal representation.
- 32 bit values printing in hexadecimal representation.
This commit is contained in:
Anachronaut
2024-11-01 12:13:13 -04:00
committed by GitHub
parent e5241beb51
commit f4c78e68ba
7 changed files with 332 additions and 90 deletions
+33
View File
@@ -0,0 +1,33 @@
; A Fibonacci number generating program that uses only one byte to store the value.
#Include Libraries/print.asm
#Program
start:
; Load our initial values into A and B.
INIA 0x00
CALL printByteDecimal
CALL blankSpace
; Move the value into B.
PSHA
POPB
; Load the next starting value into A.
INIA 0x01
CALL printByteDecimal
CALL blankSpace
loop:
ADD ; Add the values together.
BRC end ; If the value overflows, we're done.
; Copy A into B
PSHA
POPB
; Copy Q into A
PSHQ
POPA
; Print A.
CALL printByteDecimal
CALL blankSpace
BRI loop ; Loop again.
end:
CALL lineFeed
HALT