Some more code cleanup

This commit is contained in:
Bobbi Webber-Manners 2021-07-31 16:10:12 -04:00
parent 3f94c48bcc
commit e8dda24e6c
3 changed files with 26 additions and 16 deletions

Binary file not shown.

View File

@ -83,31 +83,41 @@ XFMAIN MAC
EOM EOM
* Macro to load addr into STRTL/STRTH * Macro to load addr into STRTL/STRTH
* Called by code running in main mem
XFADDR MAC XFADDR MAC
PHA
LDA #<]1 LDA #<]1
STA STRTL STA STRTL
LDA #>]1 LDA #>]1
STA STRTH STA STRTH
PLA
EOM EOM
* Macro to backup STRTL/STRTH then load XFADDR * Macro to backup STRTL/STRTH then load XFADDR
* Callers running with AltZP should call this one * Called by code running in aux mem
ALXFADDR MAC XFADDRAUX MAC
PHA
LDA STRTL LDA STRTL
STA STRTBCKL STA STRTBCKL
LDA STRTH LDA STRTH
STA STRTBCKH STA STRTBCKH
>>> XFADDR,]1 LDA #<]1
STA STRTL
LDA #>]1
STA STRTH
PLA
EOM EOM
* Macro to recover STRTL/STRTH * Macro to recover STRTL/STRTH
* Used by callers running with AltZP to recover
* STRTL and STRTH after XFER returns * STRTL and STRTH after XFER returns
* Called by code running in aux mem
XFRECVR MAC XFRECVR MAC
PHA
LDA STRTBCKL LDA STRTBCKL
STA STRTL STA STRTL
LDA STRTBCKH LDA STRTBCKH
STA STRTH STA STRTH
PLA
EOM EOM
* Code is all included from PUT files below ... * Code is all included from PUT files below ...

View File

@ -311,14 +311,14 @@ FINDHND PHX
STA $C004 ; Write main STA $C004 ; Write main
STY MOSFILE ; Length (Pascal string) STY MOSFILE ; Length (Pascal string)
STA $C005 ; Write aux STA $C005 ; Write aux
>>> ALXFADDR,OFILE >>> XFADDRAUX,OFILE
PLA ; Recover options PLA ; Recover options
:S1 >>> XFMAIN :S1 >>> XFMAIN
:CLOSE STA $C004 ; Write main :CLOSE STA $C004 ; Write main
STY MOSFILE ; Write file number STY MOSFILE ; Write file number
STA $C005 ; Write aux STA $C005 ; Write aux
>>> ALXFADDR,CFILE >>> XFADDRAUX,CFILE
BRA :S1 BRA :S1
OSFINDRET OSFINDRET
@ -359,7 +359,7 @@ BPUTHND PHX
STA $C005 ; Write to aux memory STA $C005 ; Write to aux memory
TSX ; Stash alt SP in $0101 TSX ; Stash alt SP in $0101
STX $0101 STX $0101
>>> ALXFADDR,FILEPUT >>> XFADDRAUX,FILEPUT
PLA ; Char to write PLA ; Char to write
PHA PHA
>>> XFMAIN >>> XFMAIN
@ -381,7 +381,7 @@ BGETHND PHX
STA $C005 ; Write to aux memory STA $C005 ; Write to aux memory
TSX ; Stash alt SP in $0101 TSX ; Stash alt SP in $0101
STX $0101 STX $0101
>>> ALXFADDR,FILEGET >>> XFADDRAUX,FILEGET
>>> XFMAIN >>> XFMAIN
OSBGETRET OSBGETRET
LDX $0101 ; Recover alt SP from $0101 LDX $0101 ; Recover alt SP from $0101
@ -439,7 +439,7 @@ ARGSHND PHA
STA $C004 ; Write main memory STA $C004 ; Write main memory
STY MOSFILE ; File ref num STY MOSFILE ; File ref num
STA $C005 ; Write aux memory STA $C005 ; Write aux memory
:FLUSH >>> ALXFADDR,FLUSH :FLUSH >>> XFADDRAUX,FLUSH
>>> XFMAIN >>> XFMAIN
:EXIT PLY :EXIT PLY
PLX PLX
@ -528,9 +528,9 @@ FILEHND PHX
PLX PLX
RTS RTS
:S1 >>> ALXFADDR,SAVEFILE :S1 >>> XFADDRAUX,SAVEFILE
BRA :S3 BRA :S3
:S2 >>> ALXFADDR,LOADFILE :S2 >>> XFADDRAUX,LOADFILE
:S3 >>> XFMAIN :S3 >>> XFMAIN
OSFILERET OSFILERET
@ -1244,12 +1244,12 @@ STARHELP LDA #<:MSG
DB $0D,$0D,$00 DB $0D,$0D,$00
:MSG2 DB $0D,$00 :MSG2 DB $0D,$00
STARQUIT >>> ALXFADDR,QUIT STARQUIT >>> XFADDRAUX,QUIT
>>> XFMAIN >>> XFMAIN
STARCAT TSX STARCAT TSX
STX $0101 ; Stash alt SP STX $0101 ; Stash alt SP
>>> ALXFADDR,CATALOG >>> XFADDRAUX,CATALOG
>>> XFMAIN >>> XFMAIN
STARCATRET STARCATRET
LDX $0101 ; Recover alt SP LDX $0101 ; Recover alt SP
@ -1278,7 +1278,7 @@ PRONEBLK LDX $0101 ; Recover alt SP
BNE :L1 BNE :L1
BRA :END BRA :END
:END >>> ALXFADDR,CATALOGRET :END >>> XFADDRAUX,CATALOGRET
>>> XFMAIN >>> XFMAIN
:DIRM ASC 'Directory: ' :DIRM ASC 'Directory: '
DB $00 DB $00
@ -1354,7 +1354,7 @@ STARDIR LDA ZP1 ; Move ZP1->ZP3 (OSWRCH uses ZP1)
STA $C005 ; Write aux STA $C005 ; Write aux
TSX TSX
STX $0101 ; Stash alt SP STX $0101 ; Stash alt SP
>>> ALXFADDR,SETPFX >>> XFADDRAUX,SETPFX
>>> XFMAIN >>> XFMAIN
STARDIRRET STARDIRRET
LDX $0101 ; Recover Alt SP LDX $0101 ; Recover Alt SP
@ -1387,7 +1387,7 @@ OSBYTE80 CPX #$00 ; X=0 Last ADC channel
CHKEOF STA $C004 ; Write main mem CHKEOF STA $C004 ; Write main mem
STX MOSFILE ; File reference number STX MOSFILE ; File reference number
STA $C005 ; Write aux mem STA $C005 ; Write aux mem
>>> ALXFADDR,FILEEOF >>> XFADDRAUX,FILEEOF
TSX ; Stash alt SP in $0101 TSX ; Stash alt SP in $0101
STX $0101 STX $0101
>>> XFMAIN >>> XFMAIN