This commit is contained in:
Michael Steil 2008-10-18 08:22:00 +00:00
parent 5bf0b4466b
commit 276a23886c
5 changed files with 144 additions and 151 deletions

133
inline.s Normal file
View File

@ -0,0 +1,133 @@
.segment "CODE"
.ifndef CONFIG_NO_INPUTBUFFER_ZP
L2420:
.ifdef OSI
jsr OUTDO
.endif
dex
bpl INLIN2
L2423:
.ifdef OSI
jsr OUTDO
.endif
jsr CRDO
.endif
; ----------------------------------------------------------------------------
; READ A LINE, AND STRIP OFF SIGN BITS
; ----------------------------------------------------------------------------
.ifndef KBD
INLIN:
.ifdef APPLE
ldx #$DD
INLIN1:
stx $33
jsr L2900
cpx #$EF
bcs L0C32
ldx #$EF
L0C32:
lda #$00
sta INPUTBUFFER,x
ldx #<INPUTBUFFER-1
ldy #>INPUTBUFFER-1
rts
.endif
.ifndef APPLE
ldx #$00
INLIN2:
jsr GETLN
.ifndef CONFIG_NO_LINE_EDITING
cmp #$07
beq L2443
.endif
cmp #$0D
beq L2453
.ifndef CONFIG_NO_LINE_EDITING
cmp #$20
bcc INLIN2
.ifdef MICROTAN
cmp #$80
.else
cmp #$7D
.endif
bcs INLIN2
cmp #$40 ; @
beq L2423
.ifdef MICROTAN
cmp #$7F ; DEL
.else
cmp #$5F ; _
.endif
beq L2420
L2443:
.ifdef MICROTAN
cpx #$4F
.else
cpx #$47
.endif
bcs L244C
.endif
sta INPUTBUFFER,x
inx
.ifdef OSI
.byte $2C
.else
bne INLIN2
.endif
L244C:
.ifndef CONFIG_NO_LINE_EDITING
lda #$07 ; BEL
jsr OUTDO
bne INLIN2
.endif
L2453:
jmp L29B9
.endif
.endif
.ifndef KBD
.ifndef APPLE
GETLN:
.ifdef CONFIG_FILE
jsr CHRIN
ldy Z03
bne L2465
.else
jsr MONRDKEY
.endif
.ifdef OSI
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
and #$7F
.endif
.endif /* APPLE */
.ifdef APPLE
RDKEY:
jsr LFD0C
and #$7F
.endif
cmp #$0F
bne L2465
pha
lda Z14
eor #$FF
sta Z14
pla
L2465:
rts
.endif /* KBD */

10
print.s
View File

@ -22,7 +22,7 @@ PRINT2:
cmp #','
; Pre-KIM had no CLC. KIM added the CLC
; here. Post-KIM moved the CLC up...
.ifdef KIM
.if .def(CONFIG_11A) && (!.def(CONFIG_2))
clc
.endif
beq L29DE
@ -142,9 +142,9 @@ L29D9:
pla
tax
.else
.ifdef APPLE
.ifndef CONFIG_2
lda #$00
sta $50
sta POSX
.endif
eor #$FF
.endif
@ -196,7 +196,7 @@ L29F5:
plp
bcc L2A09
.else
.ifdef APPLE
.ifdef CONFIG_11
beq L1185
jmp SYNERR
L1185:
@ -205,7 +205,7 @@ L1185:
.endif
pla
cmp #TOKEN_TAB
.ifdef APPLE
.ifdef CONFIG_11
bne L2A09
.else
bne L2A0A

148
program.s
View File

@ -315,137 +315,7 @@ RET3:
rts
.endif
.ifndef CONFIG_NO_INPUTBUFFER_ZP
L2420:
.ifdef OSI
jsr OUTDO
.endif
dex
bpl INLIN2
L2423:
.ifdef OSI
jsr OUTDO
.endif
jsr CRDO
.endif
; ----------------------------------------------------------------------------
; READ A LINE, AND STRIP OFF SIGN BITS
; ----------------------------------------------------------------------------
.ifndef KBD
INLIN:
.ifdef APPLE
ldx #$DD
INLIN1:
stx $33
jsr L2900
cpx #$EF
bcs L0C32
ldx #$EF
L0C32:
lda #$00
sta INPUTBUFFER,x
ldx #<INPUTBUFFER-1
ldy #>INPUTBUFFER-1
rts
.endif
.ifndef APPLE
ldx #$00
INLIN2:
jsr GETLN
.ifndef CONFIG_NO_LINE_EDITING
cmp #$07
beq L2443
.endif
cmp #$0D
beq L2453
.ifndef CONFIG_NO_LINE_EDITING
cmp #$20
bcc INLIN2
.ifdef MICROTAN
cmp #$80
.else
cmp #$7D
.endif
bcs INLIN2
cmp #$40 ; @
beq L2423
.ifdef MICROTAN
cmp #$7F ; DEL
.else
cmp #$5F ; _
.endif
beq L2420
L2443:
.ifdef MICROTAN
cpx #$4F
.else
cpx #$47
.endif
bcs L244C
.endif
sta INPUTBUFFER,x
inx
.ifdef OSI
.byte $2C; XXX
.else
bne INLIN2
.endif
L244C:
.ifndef CONFIG_NO_LINE_EDITING
lda #$07 ; BEL
jsr OUTDO
bne INLIN2
.endif
L2453:
jmp L29B9
.endif
.endif
.ifndef KBD
.ifndef APPLE
GETLN:
.ifdef CONFIG_FILE
jsr CHRIN
ldy Z03
bne L2465
.else
jsr MONRDKEY
.endif
.ifdef OSI
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
and #$7F
.endif
.endif /* APPLE */
.ifdef APPLE
RDKEY:
jsr LFD0C
and #$7F
.endif
cmp #$0F
bne L2465
pha
lda Z14
eor #$FF
sta Z14
pla
L2465:
rts
.endif /* KBD */
.include "inline.s"
; ----------------------------------------------------------------------------
; TOKENIZE THE INPUT LINE
@ -666,8 +536,7 @@ SCRTCH:
; ----------------------------------------------------------------------------
SETPTRS:
jsr STXTPT
.ifndef APPLE
.ifdef CONFIG_11
.ifdef CONFIG_11A
lda #$00
; ----------------------------------------------------------------------------
@ -676,7 +545,6 @@ SETPTRS:
CLEAR:
bne L256A
.endif
.endif
CLEARC:
.ifdef KBD
lda #<CONST_MEMSIZ
@ -705,19 +573,11 @@ STKINI:
.ifdef CONFIG_2
tay
.else
.ifdef APPLE
sta STACK+249
.else
sta STACK+253
.endif
sta STACK+STACK_TOP+1
.endif
pla
.ifndef CONFIG_2
.ifdef APPLE
sta STACK+250
.else
sta STACK+254
.endif
sta STACK+STACK_TOP+2
.endif
ldx #STACK_TOP
txs

View File

@ -112,7 +112,7 @@ UNFNC:
.ifdef CONFIG_NO_POKE
keyword_addr "VER", VER
.else
.ifdef KIM
.ifdef CONFIG_RAM
keyword_addr "USR", IQERR
.else
keyword_addr "USR", USR

2
trig.s
View File

@ -196,6 +196,6 @@ POLY_ATN:
.byte $81,$00,$00,$00,$00
.endif
.ifdef KIM
.if .def(CONFIG_11A) && (!.def(CONFIG_2))
.byte $00 ; XXX
.endif