mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
211 lines
3.2 KiB
Plaintext
211 lines
3.2 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
CC.FIO.LoadLIB.o
|
||
>LDA.G LibCount
|
||
cmp #LIBS.MAX
|
||
bne .1
|
||
|
||
lda #E.OOH
|
||
sec
|
||
.9 rts
|
||
|
||
.1 clc
|
||
adc #hLibNs
|
||
tay
|
||
|
||
lda ArgIndex
|
||
sta (pData),y
|
||
|
||
>PUSHW L.ENV.LIB
|
||
>PUSHW pData >PUSHEA.G PathBuf
|
||
>SYSCALL GetEnv
|
||
bcs .9
|
||
|
||
>PUSHW pData
|
||
|
||
lda ArgIndex
|
||
>SYSCALL ArgV
|
||
>PUSHYA
|
||
>SYSCALL strcat
|
||
|
||
>PUSHW pData
|
||
>PUSHW L.LIB.O
|
||
>SYSCALL strcat
|
||
|
||
>PUSHW L.MSG.READING
|
||
>PUSHW pData
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
|
||
>PUSHW pData
|
||
>PUSHBI O.RDONLY
|
||
>PUSHBI S.FI.T.BIN
|
||
>PUSHWZ Aux type
|
||
>SYSCALL loadfile
|
||
bcs .99
|
||
|
||
>LDA.G LibCount
|
||
clc
|
||
adc #hLibOs
|
||
tay
|
||
txa
|
||
sta (pData),y
|
||
|
||
>INC.G LibCount
|
||
clc
|
||
|
||
.99 rts
|
||
*--------------------------------------
|
||
CC.FIO.FOpen1st >LDA.G CC.InFileArg
|
||
>SYSCALL ArgV
|
||
|
||
CC.FIO.FOpen phy
|
||
pha
|
||
|
||
>PUSHW L.MSG.READING
|
||
pla
|
||
pha
|
||
>PUSHYA
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
|
||
pla
|
||
ply
|
||
>PUSHYA
|
||
>PUSHBI O.RDONLY
|
||
>PUSHBI S.FI.T.TXT
|
||
>PUSHWZ Aux type
|
||
>SYSCALL FOpen
|
||
bcs .9
|
||
|
||
tax
|
||
|
||
>LDA.G hFilePtr
|
||
inc
|
||
sta (pData),y
|
||
tay
|
||
txa
|
||
sta (pData),y
|
||
|
||
>LDA.G LineCntPtr
|
||
inc
|
||
inc
|
||
sta (pData),y
|
||
tay
|
||
lda #0
|
||
sta (pData),y
|
||
iny
|
||
sta (pData),y
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
CC.FIO.FGetS >LDYA.G LineBufPtr
|
||
>STYA ZPLineBufPtr
|
||
|
||
>LDA.G LineCntPtr
|
||
tay
|
||
lda (pData),y
|
||
inc
|
||
sta (pData),y
|
||
bne .1
|
||
|
||
iny
|
||
lda (pData),y
|
||
inc
|
||
sta (pData),y
|
||
|
||
.1 >LDA.G hFilePtr
|
||
tay
|
||
lda (pData),y
|
||
>PUSHA
|
||
|
||
>PUSHW ZPLineBufPtr
|
||
>PUSHWI 255
|
||
>SYSCALL FGetS
|
||
bcs .9
|
||
|
||
>LDA.G bTrace
|
||
bpl .8
|
||
|
||
jsr PrintTraceMsg
|
||
|
||
.8
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
CC.FIO.FClose >LDA.G hFilePtr
|
||
cmp #hFilePtr
|
||
beq .8
|
||
|
||
tay
|
||
lda (pData),y
|
||
|
||
>SYSCALL FClose
|
||
|
||
>LDA.G hFilePtr
|
||
dec
|
||
sta (pData),y
|
||
cmp #hFilePtr
|
||
beq .8
|
||
|
||
>LDA.G LineCntPtr
|
||
dec
|
||
dec
|
||
sta (pData),y NZ
|
||
|
||
.8 rts
|
||
*--------------------------------------
|
||
CC.FIO.FCreate lda ZPCCCode+1
|
||
sta PCC.FH+PCC.FH.CONST+1
|
||
sec
|
||
sbc #$20
|
||
sta PCC.FH+PCC.FH.CSSIZE+1
|
||
|
||
lda ZPCCCode
|
||
sta PCC.FH+PCC.FH.CSSIZE
|
||
sta PCC.FH+PCC.FH.CONST
|
||
clc
|
||
adc ZPCCConst
|
||
sta PCC.FH+PCC.FH.LIBS
|
||
|
||
lda ZPCCCode+1
|
||
adc ZPCCConst+1
|
||
sta PCC.FH+PCC.FH.LIBS+1
|
||
|
||
lda ZPCCData
|
||
sta PCC.FH+PCC.FH.DSSIZE
|
||
|
||
lda ZPCCData+1
|
||
sta PCC.FH+PCC.FH.DSSIZE+1
|
||
|
||
>LDA.G CC.OutFileArg
|
||
>SYSCALL ArgV
|
||
>STYA ZPPtr1
|
||
|
||
>PUSHW L.MSG.GENERATING
|
||
>PUSHW ZPPtr1
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
|
||
>PUSHW ZPPtr1
|
||
>PUSHBI O.WRONLY+O.CREATE
|
||
>PUSHBI S.FI.T.BIN
|
||
>PUSHWI $2000 Aux type
|
||
>SYSCALL FOpen
|
||
bcs .9
|
||
|
||
>STA.G CC.hOutFile
|
||
|
||
>PUSHA A = CC.hOutFile
|
||
>PUSHW L.PCC.FH
|
||
>PUSHWI PCC.FH.L
|
||
>SYSCALL FWrite
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/bin/cc.s.fio
|
||
LOAD usr/src/bin/cc.s
|
||
ASM
|