There is a simple Print string routine PRTSTR (and CRLF)
In fact, it is one long string with text ‘KIM’ and ‘ERR’ and a CR and LF. and six trailing Null ($) characters and X-OFF characters.
The Null characters are to let the slow mechanic Teletype machine handle the incoming characters.
And there is the X-OFF($13) character, which stops printing papertape on a teletype.
The code parts where PRTSTR and CRLF are called are:
0636 1C4F 20 8C 1E START JSR INIT1 .. 0640 1C59 20 2F 1E JSR CRLF ; PRT CR LF 0641 1C5C A2 0A LDX #$0A ; TYPE OUT KIM 0642 1C5E 20 31 1E JSR PRTST 0643 1C61 4C AF 1D JMP SHOW1 0764 1D2E A2 0C LDX #$0C ; X-OFF KIM .. 0767 1D35 20 31 1E JSR PRTST 0778 1D42 A9 00 DUMP LDA #$00 0779 1D44 85 F8 STA INL 0780 1D46 85 F9 STA INH ; CLEAR RECORD COUNT 0781 1D48 A9 00 DUMP0 LDA #$00 0782 1D4A 85 F6 STA CHKHI ; CLEAR CHKSUM 0783 1D4C 85 F7 STA CHKSUM 0784 1D4E ; 0785 1D4E 20 2F 1E JSR CRLF ; PRINT CR LF 0786 1D51 A9 3B LDA #$3B ; PRINT SEMICOLON 0828 1DA9 20 CC 1F SPACE JSR OPEN ; OPEN NEW CELL 1 0829 1DAC 20 2F 1E SHOW JSR CRLF ; PRINT CR LF 0830 1DAF 20 1E 1E SHOW1 JSR PRTPNT 0831 1DB2 20 9E 1E JSR OUTSP ; PRT SPACE 0832 1DB5 A0 00 LDY #$00 ; PRINT DATA SPECIFIED 0833 1DB7 B1 FA LDA (POINTL),Y ; BY POINT AD = LDA EXT 0834 1DB9 20 3B 1E JSR PRTBYT 0835 1DBC 20 9E 1E JSR OUTSP ; PRT SPACE 0836 1DBF 4C 64 1C JMP CLEAR
The PRTSTR routine prints first six Null characters and depending on the X register value:
CRLF = $OD $0A $00 $00 $00 $00 $00 $00
KIM = $13 KIM $0D $0A $00 $00 $00 $00 $00 $00
ERR KIM = $13 ERR $13 KIM $00 $0D $0A $00 $00 $00 $00 $00 $00
0905 1E2F ; PRINT STRING OF ASCII CHAR FROM 0906 1E2F ; TOP+X TO TOP 0907 1E2F ; 0908 1E2F A2 07 CRLF LDX #$07 0909 1E31 BD D5 1F PRTST LDA TOP,X 0910 1E34 20 A0 1E JSR OUTCH 0911 1E37 CA DEX 0912 1E38 10 F7 BPL PRTST ; STOP ON INDEX ZERO 0913 1E3A 60 RTS 1195 1FD5 ; TABLES 1196 1FD5 ; 1197 1FD5 00 00 00 00 TOP .BYTE $00, $00, $00, $00, $00, $00, $0A, $0D, "MIK" 1197 1FD9 00 00 0A 0D 1197 1FDD 4D 49 4B 1198 1FE0 20 13 52 52 .BYTE ' ',$13, "RRE", ' ', $13 1198 1FE4 45 20 13
What is happening here?
The KIM-1 monitor types out three strings.
X=07 types CRLF
X=0C type KIM CRLF (at startup)
X=11 type ERR KIM CRLF (when papertape loading ends in in error)
all with trailing 6x 00
KIM and ERR are both preceeded by a X-OFF($13) character, which stops printing papertape on a teletype.
The subroutine PRTSTR
– fetches a character from the table at offset in X
– prints the character via OUTCH
– decrements X, back one character in the table
– and loops until X = 0 and the string printed