Spare a few bytes
This commit is contained in:
committed by
Oliver Schmidt
parent
e444f4c40e
commit
f8c51ffd3d
@@ -54,18 +54,20 @@ iobuf_alloc:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
; Mark table entry as used
|
; Mark table entry as used
|
||||||
: lda #$FF
|
: dec table,x
|
||||||
sta table,x
|
|
||||||
|
|
||||||
; Convert table index to address hibyte
|
; Convert table index to address hibyte
|
||||||
txa
|
txa
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
clc
|
; Skip clearing carry, it can't be set as long as MAX_FDS*4 is
|
||||||
|
; less than 64.
|
||||||
|
.assert MAX_FDS*4 < $40, error
|
||||||
adc #>$0800
|
adc #>$0800
|
||||||
|
|
||||||
; Store address in "memptr"
|
; Store address in "memptr"
|
||||||
ldy #$01
|
; (Y still equals 0 from popptr1)
|
||||||
|
iny
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
dey
|
dey
|
||||||
tya
|
tya
|
||||||
@@ -82,8 +84,7 @@ iobuf_free:
|
|||||||
|
|
||||||
; Mark table entry as free
|
; Mark table entry as free
|
||||||
tax
|
tax
|
||||||
lda #$00
|
inc table,x
|
||||||
sta table,x
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -23,31 +23,17 @@ _cputsxy:
|
|||||||
_cputs: sta ptr1 ; Save s
|
_cputs: sta ptr1 ; Save s
|
||||||
stx ptr1+1
|
stx ptr1+1
|
||||||
|
|
||||||
|
L0:
|
||||||
.if (.cpu .bitand CPU_ISET_65SC02)
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
||||||
|
lda (ptr1) ; (5)
|
||||||
L0: lda (ptr1) ; (5)
|
|
||||||
beq L9 ; (7) Jump if done
|
|
||||||
jsr _cputc ; (13) Output char, advance cursor
|
|
||||||
inc ptr1 ; (18) Bump low byte
|
|
||||||
bne L0 ; (20) Next char
|
|
||||||
inc ptr1+1 ; (25) Bump high byte
|
|
||||||
bne L0
|
|
||||||
|
|
||||||
.else
|
.else
|
||||||
|
ldy #0 ; (2)
|
||||||
L0: ldy #0 ; (2)
|
lda (ptr1),y ; (7)
|
||||||
L1: lda (ptr1),y ; (7)
|
|
||||||
beq L9 ; (9) Jump if done
|
|
||||||
iny
|
|
||||||
sty tmp1 ; (14) Save offset
|
|
||||||
jsr _cputc ; (20) Output char, advance cursor
|
|
||||||
ldy tmp1 ; (23) Get offset
|
|
||||||
bne L1 ; (25) Next char
|
|
||||||
inc ptr1+1 ; (30) Bump high byte
|
|
||||||
bne L1
|
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
beq L9 ; (7/9) Jump if done
|
||||||
; Done
|
jsr _cputc ; (13/15) Output char, advance cursor
|
||||||
|
inc ptr1 ; (18/20) Bump low byte
|
||||||
|
bne L0 ; (20/22) Next char
|
||||||
|
inc ptr1+1 ; (25/27) Bump high byte
|
||||||
|
bne L0
|
||||||
L9: rts
|
L9: rts
|
||||||
|
|||||||
Reference in New Issue
Block a user