AppleIIAsm-Collection/disks/disk6_fileio/T.FILEIO.MIN
nathanriggs 03636aa196 FileIO 0.2.0 updates
- various bugfixes
- integrated required library
- created minified sources
- made macros slightly more flexible
2018-12-24 02:14:04 -06:00

227 lines
3.7 KiB
Plaintext

*
BINSAVE
*
PLA
STA RETADR
PLA
STA RETADR+1
PLA
STA ADDR2
PLA
STA ADDR2+1
LDA #$8D
JSR FCOUT
LDA #$84
JSR FCOUT
LDA #$C2
JSR FCOUT
LDA #$D3
JSR FCOUT
LDA #$C1
JSR FCOUT
LDA #$D6
JSR FCOUT
LDA #$C5
JSR FCOUT
LDA #$A0
JSR FCOUT
LDY #0
LDA (ADDR2),Y
STA :SLEN
LDY #1
:LP
LDA (ADDR2),Y
JSR FCOUT
INY
CPY :SLEN
BCC :LP
BEQ :LP
LDA #$8D
JSR FCOUT
LDA RETADR+1
PHA
LDA RETADR
PHA
RTS
:SLEN DS 1
*
BINLOAD
*
PLA
STA RETADR
PLA
STA RETADR+1
PLA
STA ADDR2
PLA
STA ADDR2+1
LDA #$8D
JSR FCOUT
LDA #$84
JSR FCOUT
LDA #$C2
JSR FCOUT
LDA #$CC
JSR FCOUT
LDA #$CF
JSR FCOUT
LDA #$C1
JSR FCOUT
LDA #$C4
JSR FCOUT
LDA #$A0
JSR FCOUT
LDY #0
LDA (ADDR2),Y
STA :SLEN
LDY #1
:LP
LDA (ADDR2),Y
JSR FCOUT
INY
CPY :SLEN
BCC :LP
BEQ :LP
LDA #$8D
JSR FCOUT
LDA RETADR+1
PHA
LDA RETADR
PHA
RTS
:SLEN DS 1
*
TXTMODE
*
LDA #$40
STA LANG
STA CURLIN+1
LDA #$06
STA PROMPT
RTS
DOSCMD
PLA
STA RETADR
PLA
STA RETADR+1
LDA #$8D
JSR FCOUT
LDA #$84
JSR FCOUT
LDY #$01
:LP
LDA (RETADR),Y
BEQ :DONE
JSR FCOUT
INY
BNE :LP
:DONE
CLC
TYA
ADC RETADR
STA RETADR
LDA RETADR+1
ADC #$00
PHA
LDA RETADR
PHA
RTS
*
FPRINT
PLA
STA RETADR
PLA
STA RETADR+1
LDY #$01
:LP
LDA (RETADR),Y
BEQ :DONE
JSR FCOUT
INY
BNE :LP
:DONE
CLC
TYA
ADC RETADR
STA RETADR
LDA RETADR+1
ADC #$00
PHA
LDA RETADR
PHA
RTS
*
FINPUT
*
PLA
STA RETADR
PLA
STA RETADR+1
PLA
STA ADDR1
PLA
STA ADDR1+1
LDX #0
JSR FGETLN
STX :SLEN
CPX #0
BEQ :EXIT
:INP_CLR
LDY #0
LDA :SLEN
STA (ADDR1),Y
:LP
LDA $0200,Y
INY
STA (ADDR1),Y
CPY :SLEN
BNE :LP
:EXIT
LDA RETADR+1
PHA
LDA RETADR
PHA
RTS
:SLEN DS 1
*
FPSTR
*
PLA
STA RETADR
PLA
STA RETADR+1
PLA
STA ADDR1
PLA
STA ADDR1+1
LDY #0
LDA (ADDR1),Y
STA :SLEN
:LP
INY
LDA (ADDR1),Y
JSR FCOUT
CPY :SLEN
BNE :LP
:EXIT
LDA RETADR+1
PHA
LDA RETADR
PHA
RTS
:SLEN DS 1
*
DISKOP
*
:CLEAR
LDA #00
STA IOB_EVOL
LDA #>IOB
LDY #<IOB
JSR RWTS
BCC :EXIT
:ERR LDA IOB_ERR
LDX #00
STX $48
:EXIT RTS