Fixes and improvements to KIM-1 i/o routines.

Tested on real KIM-1 hardware.

read.s:
- Remove commented out line.
- Remove unused check for bell character.
- Remove echo of newline (hardware always echoes entered characters).
- This fixes gets() and fgets() so they return when CR is entered.

write.s:
- Fix check for adding return after linefeed (failed to work because OUTCHR changes A)
- Remove unused check for bell character.

kim1.inc:
- Add symbol for monitor entry

crt0.s:
- Jump to KIM-1 monitor by address rather than using BRK (which relies on vector being set in RAM)
This commit is contained in:
Jeff Tranter
2023-03-27 17:56:25 -04:00
parent fcbcbea4ad
commit 806ffe5675
4 changed files with 7 additions and 15 deletions

View File

@@ -28,11 +28,10 @@ begin: dec ptr2
outch: ldy #0
lda (ptr1),y
pha ; Save A (changed by OUTCHR)
jsr OUTCHR ; Send character using Monitor call
cmp #$07 ; Check for '\a'
bne chklf ; ...if BEL character
;jsr BEEP ; Make beep sound
chklf: cmp #$0A ; Check for 'n'
pla ; Restore A
cmp #$0A ; Check for '\n'
bne next ; ...if LF character
lda #$0D ; Add a carriage return
jsr OUTCHR