2022-08-20 14:37:37 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
FIO.LoadLIB.o >LDA.G LibCount
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #LIBS.MAX
|
|
|
|
|
bne .1
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda #E.OOH
|
|
|
|
|
sec
|
|
|
|
|
.9 rts
|
|
|
|
|
|
|
|
|
|
.1 clc
|
|
|
|
|
adc #hLibNs
|
|
|
|
|
tay
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ArgIndex
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
>PUSHW L.ENV.LIB
|
|
|
|
|
>PUSHW pData >PUSHEA.G PathBuf
|
|
|
|
|
>SYSCALL GetEnv
|
|
|
|
|
bcs .9
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>PUSHW pData
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ArgIndex
|
|
|
|
|
>SYSCALL ArgV
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>SYSCALL strcat
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>PUSHW pData
|
|
|
|
|
>PUSHW L.LIB.O
|
|
|
|
|
>SYSCALL strcat
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>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
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>LDA.G LibCount
|
|
|
|
|
clc
|
|
|
|
|
adc #hLibOs
|
|
|
|
|
tay
|
|
|
|
|
txa
|
|
|
|
|
sta (pData),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>INC.G LibCount
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
FIO.FOpen1st >LDA.G CC.InFileArg
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>SYSCALL ArgV
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
FIO.FOpen phy
|
2022-08-20 14:37:37 +00:00
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
FIO.FGetS >LDYA.G LineBufPtr
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>STYA ZPLineBufPtr
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPLineBufPtr) set to Empty line
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>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
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
>LDA.G bVerbose
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bpl .8
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr PrintVerboseMsg
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
.8
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
FIO.FClose >LDA.G hFilePtr
|
2022-08-20 14:37:37 +00:00
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2023-01-26 07:07:08 +00:00
|
|
|
|
FIO.FCreate lda ZPCCCode
|
|
|
|
|
sta PCC.FH+PCC.FH.CONST
|
|
|
|
|
sta PCC.FH+PCC.FH.CSSIZE
|
|
|
|
|
|
|
|
|
|
lda ZPCCCode+1
|
2022-09-04 20:12:49 +00:00
|
|
|
|
sta PCC.FH+PCC.FH.CONST+1
|
|
|
|
|
sec
|
|
|
|
|
sbc #$20
|
|
|
|
|
sta PCC.FH+PCC.FH.CSSIZE+1
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ZPCCData
|
|
|
|
|
sta PCC.FH+PCC.FH.DSSIZE
|
|
|
|
|
|
|
|
|
|
lda ZPCCData+1
|
|
|
|
|
sta PCC.FH+PCC.FH.DSSIZE+1
|
|
|
|
|
|
|
|
|
|
>LDA.G CC.OutFileArg
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>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
|