A2osX/BIN/CC.S.DIR.txt

143 lines
1.9 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
*--------------------------------------
CC.DIR jsr CC.GetNextCharNB
bcs .99
cmp #'!' #!/bin/cc
bne .1
jmp CC.SkipLine
.1 >LDYA L.CC.DIRS
jsr CC.LookupID
bcs .91
jmp (J.CC.DIRS,x)
.91 lda #E.CSYN
sec
.99 rts
*--------------------------------------
2022-06-12 20:42:22 +00:00
CC.DIR.DEFINE clc
bit bPass2
bmi .8
jsr CC.CheckSpace
bcs .99
jsr CC.IsLetter
bcs .90
2022-06-12 20:42:22 +00:00
ldx #SYM.SC.DEFINE
>LDA.G CC.hDefines
2022-01-30 21:47:08 +00:00
jsr CC.SYM.NewKey
bcs .99
2022-06-12 20:42:22 +00:00
>STYA ZPPtr1 SymID
2022-02-04 14:57:17 +00:00
jsr CC.SkipX
jsr CC.CheckSpace
bcs .99
ldy #$ff
.1 iny
lda (ZPLineBufPtr),y
beq .2
cmp #C.CR
bne .1
dey
.2 iny
phy
>PUSHB.G CC.hDefines
2022-06-12 20:42:22 +00:00
>PUSHW ZPPtr1 SymID
>PUSHW ZPLineBufPtr
ply
lda #0
>PUSHYA DataLen
>SYSCALL SListAddData
bcs .99
2022-06-12 20:42:22 +00:00
.8 jmp CC.SkipLine
.90 lda #E.CSYN
sec
.99 rts
*--------------------------------------
CC.DIR.INCLUDE lda #0 >STZ.G PathBuf
sta (pData)
jsr CC.CheckSpace
bcs .99
cmp #'"'
beq .1
cmp #'<'
bne .90
>PUSHW L.ENV.INCLUDE
>PUSHW pData >PUSHEA.G PathBuf
>SYSCALL GetEnv
bcs .90
lda #'>'
.1 sta ArgIndex
ldy #$ff
.2 iny
lda (pData),y
bne .2
.3 jsr CC.GetNextChar
beq .90
cmp ArgIndex
2022-06-12 20:42:22 +00:00
beq .4
sta (pData),y
iny
2022-06-12 20:42:22 +00:00
cpy #MLI.MAXPATH
bne .3
.90 lda #E.CSYN
sec
.99 rts
2022-06-12 20:42:22 +00:00
.4 phy
jsr CC.GetNextChar skip " or >
2022-06-12 20:42:22 +00:00
ply
2022-06-12 20:42:22 +00:00
lda #0
sta (pData),y terminate string
dey
lda (pData),y
cmp #'h'
bne .5
2022-06-12 20:42:22 +00:00
bit bPass2
bpl .5
clc
rts
2022-06-12 20:42:22 +00:00
.5 >LDYA pData
2022-08-20 14:37:37 +00:00
jmp CC.FIO.FOpen
*--------------------------------------
MAN
SAVE usr/src/bin/cc.s.dir
LOAD usr/src/bin/cc.s
ASM