From 56057a4aba980d4a1bae1b226f6ba77f7f8a8152 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Tue, 16 Aug 2022 15:00:42 +0200
Subject: [PATCH] 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.
---
Apple2/CommandFirmware.asm | 10 ++++------
Apple2/DriveFirmware.asm | 10 ++++------
Apple2/FileAccessFirmware.asm | 10 ++++------
Apple2/MenuFirmware.asm | 10 ++++------
4 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/Apple2/CommandFirmware.asm b/Apple2/CommandFirmware.asm
index f231ece..87612be 100644
--- a/Apple2/CommandFirmware.asm
+++ b/Apple2/CommandFirmware.asm
@@ -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
diff --git a/Apple2/DriveFirmware.asm b/Apple2/DriveFirmware.asm
index 9db4632..e480df5 100644
--- a/Apple2/DriveFirmware.asm
+++ b/Apple2/DriveFirmware.asm
@@ -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
diff --git a/Apple2/FileAccessFirmware.asm b/Apple2/FileAccessFirmware.asm
index c93fa7c..2c9229b 100644
--- a/Apple2/FileAccessFirmware.asm
+++ b/Apple2/FileAccessFirmware.asm
@@ -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
diff --git a/Apple2/MenuFirmware.asm b/Apple2/MenuFirmware.asm
index e9c7fa6..9a36ffe 100644
--- a/Apple2/MenuFirmware.asm
+++ b/Apple2/MenuFirmware.asm
@@ -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: