Add print routine for TTY

This commit is contained in:
2025-08-02 21:56:42 +02:00
parent 7b1bef8258
commit 3a887ef05c

View File

@@ -1,2 +1,32 @@
TITLE SUDOKU SOLVER TITLE SUDOKU SOLVER
P=17 ;Defines AC 17 as the stack pointer.
A=1 ;Define two accumulators
B=2 ;A and B
CHTTYO==1 ;Output channel number
PDLLEN==100 ;Length of push down stack
PDL: BLOCK PDLLEN ;Storage for push down stack
START: MOVE P,[-PDLLEN,,PDL-1] ;Initialize the stack
.CALL [SETZ ? SIXBIT/OPEN/ ;Open the TTY channels
[.UAI,,CHTTYO] ? [SIXBIT/TTY/] ((SETZ))]
.LOSE %LSFIL
L: HRRI A, HELLO ;Load the address of the string into A
PUSHJ P, OUTSTR ;Print the string.
JRST L ;Keep looping
;Subroutine to output the ASCIZ which starts in the word
;whose address is in A. Clobbers A.
OUTSTR: HRLI A, 440700 ;Make A into a byte pointer to fetch a string
OUTST1: ILDB B, A ;Fetch the next character of string into B
JUMPE B, CPOPJ ;If it is the terminator, return
.IOT CHTTYO,B ;Else output the character
JRST OUTST1 ;and loop around.
CPOPJ: POPJ P, ;Return
HELLO: ASCIZ /HELLO WORLD/
END START