Removed push/pop from GetByte.

After the replacing the rol instructions with bit instructions with a recent chnage, the only reason left to save a to the stack was setting the OutputFlags. But that can be done using x.
This commit is contained in:
Oliver Schmidt 2022-08-16 15:00:42 +02:00 committed by Terence Boldt
parent b0a105606a
commit 56057a4aba
4 changed files with 16 additions and 24 deletions

View File

@ -140,8 +140,8 @@ finishWrite:
rts
GetByte:
lda #$1d ;set read flag low
sta OutputFlags
ldx #$1d ;set read flag low
stx OutputFlags
waitRead:
bit InputFlags
bpl readByte
@ -153,13 +153,11 @@ waitRead:
rts
readByte:
lda InputByte
pha
lda #$1f ;set all flags high
sta OutputFlags
ldx #$1f ;set all flags high
stx OutputFlags
finishRead:
bit InputFlags
bpl finishRead
pla
clc ;success
end:
rts

View File

@ -174,19 +174,17 @@ finishWrite:
rts
GetByte:
lda #$0d ;set read flag low
sta OutputFlags
ldx #$0d ;set read flag low
stx OutputFlags
waitRead:
bit InputFlags
bmi waitRead
lda InputByte
pha
lda #$0f ;set all flags high
sta OutputFlags
ldx #$0f ;set all flags high
stx OutputFlags
finishRead:
bit InputFlags
bpl finishRead
pla
end:
rts

View File

@ -127,19 +127,17 @@ finishWrite:
rts
GetByte:
lda #$2d ;set read flag low
sta OutputFlags
ldx #$2d ;set read flag low
stx OutputFlags
waitRead:
bit InputFlags
bmi waitRead
lda InputByte
pha
lda #$2f ;set all flags high
sta OutputFlags
ldx #$2f ;set all flags high
stx OutputFlags
finishRead:
bit InputFlags
bpl finishRead
pla
end:
rts

View File

@ -134,19 +134,17 @@ finishWrite:
rts
GetByte:
lda #$3d ;set read flag low
sta OutputFlags
ldx #$3d ;set read flag low
stx OutputFlags
waitRead:
bit InputFlags
bmi waitRead
lda InputByte
pha
lda #$3f ;set all flags high
sta OutputFlags
ldx #$3f ;set all flags high
stx OutputFlags
finishRead:
bit InputFlags
bpl finishRead
pla
rts
Text: