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

View File

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

View File

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

View File

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