A2osX/BIN/CSH.S.DIR.txt

136 lines
1.8 KiB
Plaintext
Raw Normal View History

2021-01-12 21:14:13 +00:00
NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
CSH.DIR jsr CSH.GetNextCharNB
bcs .99
cmp #'!' #!/bin/csh
bne .1
jmp CSH.SkipLine
.1 >LDYA L.CSH.DIRS
jsr CSH.LookupID
bcs .91
jmp (J.CSH.DIRS,x)
2021-05-04 17:31:21 +00:00
.91 lda #E.CSYN
2021-01-12 21:14:13 +00:00
sec
.99 rts
*--------------------------------------
CSH.DIR.DEFINE jsr CSH.CheckSpace
bcs .99
jsr CSH.IsLetter
bcs .90
>LDA.G CSH.hDefines
jsr CSH.NewKey
bcs .99
>STYA ZPVarID
jsr CSH.CheckSpace
bcs .99
ldy #$ff
.1 iny
lda (ZPInputBufPtr),y
beq .2
cmp #C.CR
bne .1
dey
.2 iny
phy
>PUSHB.G CSH.hDefines
>PUSHW ZPVarID
>PUSHW ZPInputBufPtr
ply
lda #0
>PUSHYA DataLen
>SYSCALL SListAddData
bcs .99
jmp CSH.SkipLine
2021-05-04 17:31:21 +00:00
.90 lda #E.CSYN
2021-01-12 21:14:13 +00:00
sec
.99 rts
*--------------------------------------
CSH.DIR.INCLUDE >STZ.G PathBuf
jsr CSH.CheckSpace
bcs .99
cmp #'"'
beq .1
cmp #'<'
bne .90
>PUSHW L.ENV.INCLUDE
>PUSHEA.G PathBuf
>SYSCALL GetEnv
lda #'>'
.1 sta ArgIndex
ldy #PathBuf
.2 lda (pData),y
beq .3
iny
bra .2
.3 jsr CSH.GetNextChar
beq .90
cmp ArgIndex
beq .8
sta (pData),y
iny
cpy #64
bne .3
2021-05-04 17:31:21 +00:00
.90 lda #E.CSYN
2021-01-12 21:14:13 +00:00
sec
.99 rts
.8 jsr CSH.GetNextChar skip " or >
lda hInclude
bne .90
lda hDefine
bne .90
>LDYA ZPInputBufPtr
>STYA.G CSH.SaveInclude
>LDYA pData
jsr CS.RUN.LoadFile
bcs .99
stx hInclude
>STYA ZPInputBufPtr
rts
*--------------------------------------
MAN
SAVE usr/src/bin/csh.s.dir
LOAD usr/src/bin/csh.s
ASM