More code cleanup

This commit is contained in:
Bobbi Webber-Manners 2021-07-31 18:58:59 -04:00
parent 3781e74425
commit 9552ae0d29
4 changed files with 16 additions and 39 deletions

Binary file not shown.

View File

@ -110,10 +110,10 @@ XFADDRAUX MAC
PLA PLA
EOM EOM
* Macro to recover STRTL/STRTH * Macro called on re-entry to aux memory
* STRTL and STRTH after XFER returns ENTAUX MAC
* Called by code running in aux mem LDX $0101 ; Recover alt SP
XFRECVR MAC TXS
PHA PHA
LDA STRTBCKL LDA STRTBCKL
STA STRTL STA STRTL
@ -122,7 +122,7 @@ XFRECVR MAC
PLA PLA
EOM EOM
* Macro called on entry to main memory * Macro called on re-entry to main memory
ENTMAIN MAC ENTMAIN MAC
LDX $0100 ; Recover SP LDX $0100 ; Recover SP
TXS TXS

View File

@ -322,11 +322,7 @@ FINDHND PHX
BRA :S1 BRA :S1
OSFINDRET OSFINDRET
LDX $0101 ; Recover alt SP from $0101 >>> ENTAUX
TXS
PHA ; Return value
>>> XFRECVR
PLA ; Return value
PLY ; Value of A on entry PLY ; Value of A on entry
CPY #$00 ; Was it close? CPY #$00 ; Was it close?
BNE :S1 BNE :S1
@ -364,9 +360,7 @@ BPUTHND PHX
PHA PHA
>>> XFMAIN >>> XFMAIN
OSBPUTRET OSBPUTRET
LDX $0101 ; Recover alt SP from $0101 >>> ENTAUX
TXS
>>> XFRECVR
CLC ; Means no error CLC ; Means no error
PLA PLA
PLY PLY
@ -384,11 +378,7 @@ BGETHND PHX
>>> XFADDRAUX,FILEGET >>> XFADDRAUX,FILEGET
>>> XFMAIN >>> XFMAIN
OSBGETRET OSBGETRET
LDX $0101 ; Recover alt SP from $0101 >>> ENTAUX
TXS
PHA ; Return code
>>> XFRECVR
PLA ; Return code (ie: char read)
CLC ; Means no error CLC ; Means no error
CPY #$00 ; Check error status CPY #$00 ; Check error status
BEQ :S1 BEQ :S1
@ -447,9 +437,7 @@ ARGSHND PHA
RTS RTS
OSARGSRET OSARGSRET
LDX $0101 ; Recover alt ZP from $0101 >>> ENTAUX
TXS
>>> XFRECVR
PLY PLY
PLX PLX
PLA PLA
@ -534,11 +522,7 @@ FILEHND PHX
:S3 >>> XFMAIN :S3 >>> XFMAIN
OSFILERET OSFILERET
LDX $0101 ; Recover alt SP from $0101 >>> ENTAUX
TXS
PHA ; Return value
>>> XFRECVR
PLA ; Return value
PLY ; Value of A on entry PLY ; Value of A on entry
CPY #$FF ; LOAD CPY #$FF ; LOAD
BNE :S4 ; Deal with return from SAVE BNE :S4 ; Deal with return from SAVE
@ -1252,9 +1236,7 @@ STARCAT TSX
>>> XFADDRAUX,CATALOG >>> XFADDRAUX,CATALOG
>>> XFMAIN >>> XFMAIN
STARCATRET STARCATRET
LDX $0101 ; Recover alt SP >>> ENTAUX
TXS
>>> XFRECVR
RTS RTS
* Print one block of a catalog. Called by CATALOG * Print one block of a catalog. Called by CATALOG
@ -1357,9 +1339,7 @@ STARDIR LDA ZP1 ; Move ZP1->ZP3 (OSWRCH uses ZP1)
>>> XFADDRAUX,SETPFX >>> XFADDRAUX,SETPFX
>>> XFMAIN >>> XFMAIN
STARDIRRET STARDIRRET
LDX $0101 ; Recover Alt SP >>> ENTAUX
TXS
>>> XFRECVR
RTS RTS
* Performs OSBYTE $80 function * Performs OSBYTE $80 function
@ -1392,11 +1372,8 @@ CHKEOF STA $C004 ; Write main mem
STX $0101 STX $0101
>>> XFMAIN >>> XFMAIN
CHKEOFRET CHKEOFRET
LDX $0101 ; Recover alt SP from $0101 >>> ENTAUX
TXS TAX ; Return code -> X
PHA ; Return code in A
>>> XFRECVR
PLX ; Recover return code -> X
RTS RTS
* Performs OSBYTE $81 INKEY$ function * Performs OSBYTE $81 INKEY$ function

View File

@ -1,8 +1,8 @@
*
* LOADER.S * LOADER.S
* Applecorn loader code
* (c) Bobbi 2021 GPLv3 * (c) Bobbi 2021 GPLv3
* *
* Applecorn loader code
START STZ :BLOCKS START STZ :BLOCKS
LDX #$00 LDX #$00
:L1 LDA HELLO,X ; Signon message :L1 LDA HELLO,X ; Signon message