mirror of
https://github.com/ksherlock/minix.fst.git
synced 2025-01-14 04:33:00 +00:00
new line read fixes
This commit is contained in:
parent
5947705e17
commit
75411459f2
61
read.aii
61
read.aii
@ -347,24 +347,21 @@ tc
|
|||||||
@ok
|
@ok
|
||||||
|
|
||||||
|
|
||||||
|
jsr init_block
|
||||||
|
bcs exit
|
||||||
|
|
||||||
; we are ok to read!
|
; we are ok to read!
|
||||||
; check for new line mode...
|
; check for new line mode...
|
||||||
ldy #fcr.newline_length
|
jsr build_nl_table
|
||||||
lda [my_fcr],y
|
bcs normal_read
|
||||||
beq normal_read
|
|
||||||
|
|
||||||
jsr slow_read
|
jsr slow_read
|
||||||
bcs exit
|
|
||||||
bcc done
|
bcc done
|
||||||
|
rtl
|
||||||
|
|
||||||
normal_read
|
normal_read
|
||||||
|
|
||||||
|
|
||||||
jsr init_block
|
|
||||||
_rts.cs
|
|
||||||
|
|
||||||
; currently limited to 7 zones, anyhow!
|
; currently limited to 7 zones, anyhow!
|
||||||
|
|
||||||
; first block may have extra work since it may be offset into a block.
|
; first block may have extra work since it may be offset into a block.
|
||||||
@ -623,11 +620,24 @@ done
|
|||||||
@fini
|
@fini
|
||||||
endm
|
endm
|
||||||
|
|
||||||
|
;
|
||||||
|
; builds a new-line table, if necessary.
|
||||||
|
; returns:
|
||||||
|
; c = 1 if new_line mode enabled.
|
||||||
|
; c = 0 if new_line mode disabled.
|
||||||
|
|
||||||
build_nl_table procname
|
build_nl_table procname
|
||||||
|
|
||||||
with dp, my_dp
|
with dp, my_dp
|
||||||
with data
|
with data
|
||||||
|
|
||||||
|
ldy #fcr.mask
|
||||||
|
lda [my_fcr],y
|
||||||
|
sta nl_mask
|
||||||
|
bne @yes
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
@yes
|
||||||
lda #0
|
lda #0
|
||||||
ldx #256-2
|
ldx #256-2
|
||||||
zloop
|
zloop
|
||||||
@ -637,35 +647,35 @@ zloop
|
|||||||
bpl zloop
|
bpl zloop
|
||||||
|
|
||||||
|
|
||||||
ldy #fcr.mask
|
; newline list is a virtual pointer.
|
||||||
|
ldy #fcr.newline
|
||||||
lda [my_fcr],y
|
lda [my_fcr],y
|
||||||
sta nl_mask
|
tax
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [my_fcr],y
|
||||||
|
tay
|
||||||
|
jsl deref
|
||||||
|
stx ptr
|
||||||
|
sty ptr+2
|
||||||
|
|
||||||
ldy #fcr.newline_length
|
ldy #fcr.newline_length
|
||||||
lda [my_fcr],y
|
lda [my_fcr],y
|
||||||
tax
|
tay
|
||||||
|
|
||||||
ldy #fcr.newline
|
|
||||||
lda [my_fcr],y
|
|
||||||
sta ptr
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
lda [my_fcr],y
|
|
||||||
sta ptr+2
|
|
||||||
|
|
||||||
txy
|
|
||||||
dey
|
dey
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
short m
|
short m
|
||||||
nloop
|
nloop
|
||||||
lda [ptr],y
|
lda [ptr],y
|
||||||
and nl_mask
|
;and nl_mask
|
||||||
tax
|
tax
|
||||||
lda #$ff
|
lda #$ff
|
||||||
sta nl_table,x
|
sta nl_table,x
|
||||||
dey
|
dey
|
||||||
bpl nloop
|
bpl nloop
|
||||||
long m
|
long m
|
||||||
|
clc
|
||||||
rts
|
rts
|
||||||
endp
|
endp
|
||||||
|
|
||||||
@ -678,7 +688,7 @@ slow_read procname
|
|||||||
|
|
||||||
; first block may not be aligned.
|
; first block may not be aligned.
|
||||||
|
|
||||||
jsr build_nl_table
|
;jsr build_nl_table
|
||||||
|
|
||||||
lda mark
|
lda mark
|
||||||
and #1024-1
|
and #1024-1
|
||||||
@ -769,6 +779,11 @@ bloop
|
|||||||
iny
|
iny
|
||||||
|
|
||||||
and nl_mask
|
and nl_mask
|
||||||
|
; bit nl_mask+1 ; high bit set if 1-char nl
|
||||||
|
; bpl @table
|
||||||
|
; cmp nl_char
|
||||||
|
; beq @eol
|
||||||
|
;@table
|
||||||
tax
|
tax
|
||||||
lda nl_table,x
|
lda nl_table,x
|
||||||
bne @eol
|
bne @eol
|
||||||
|
Loading…
x
Reference in New Issue
Block a user