I know this is probably frivolous but I hate when the screen is filled with clutter and I did not know how to clear the screen on the PIDP-8I so I had AI create this code to clear the screen and return to the . prompt. I named the binary file
CLR.BN. I'm sure it is not elegant code, but it seems to work.....
/ CLEAR SCREEN AND RETURN TO OS/8
/ FOR PDP-8 / PIDP-8I
*200 / STARTING ADDRESS
START, TLS / INITIALIZE TTY OUTPUT FLAG
CLA / CLEAR ACCUMULATOR
TAD (LIST) / LOAD ADDRESS OF THE STRING
DCA POINTER / STORE IN POINTER
NEXT, TAD I POINTER / GET NEXT CHARACTER
SNA / IS IT ZERO? (END OF STRING)
JMP DONE / IF YES, WE ARE FINISHED
JMS PRINT / IF NO, PRINT IT
ISZ POINTER / INCREMENT POINTER
JMP NEXT / LOOP
DONE, JMP I (7600) / JUMP TO OS/8 SYSTEM ENTRY POINT
/ SUBROUTINE TO PRINT A CHARACTER
PRINT, 0
TSF / WAIT FOR TTY FLAG
JMP .-1
TLS / SEND CHARACTER
CLA / CLEAR AC
JMP I PRINT / RETURN
/ DATA
POINTER, 0
LIST, 033 / ESC
133 / [
062 / 2
112 / J
033 / ESC
133 / [
110 / H
000 / NULL TERMINATOR
$START / END OF SOURCE / SET STARTING ADDRESS