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:
@@ -27,15 +27,10 @@ begin: dec ptr2
|
||||
beq done ; If buffer full, return
|
||||
|
||||
getch: jsr INTCHR ; Get character using Monitor ROM call
|
||||
;jsr OUTCHR ; Echo it
|
||||
and #$7F ; Clear top bit
|
||||
cmp #$07 ; Check for '\a'
|
||||
bne chkcr ; ...if BEL character
|
||||
;jsr BEEP ; Make beep sound TODO
|
||||
chkcr: cmp #$0D ; Check for '\r'
|
||||
cmp #$0D ; Check for '\r'
|
||||
bne putch ; ...if CR character
|
||||
lda #$0A ; Replace with '\n'
|
||||
jsr OUTCHR ; and echo it
|
||||
|
||||
putch: ldy #$00 ; Put char into return buffer
|
||||
sta (ptr1),y
|
||||
|
||||
Reference in New Issue
Block a user