mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-30 08:51:06 +00:00
138 lines
2.2 KiB
Plaintext
138 lines
2.2 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
*---------------------------------------
|
||
MAC.Init >SYSCALL SListNew
|
||
bcs .9
|
||
|
||
>STA.G MAC.hMacroList
|
||
|
||
>LDYAI 256
|
||
>SYSCALL getmem
|
||
bcs .9
|
||
|
||
>STYA ZPMacroBuf
|
||
txa
|
||
>STA.G MAC.hMacroBuf
|
||
|
||
>SYSCALL SListNew
|
||
bcs .9
|
||
|
||
>STA.G MAC.hCtxList
|
||
|
||
>LDYAI 256
|
||
>SYSCALL getmem
|
||
bcs .9
|
||
|
||
>STYA ZPCtxBuf
|
||
txa
|
||
>STA.G MAC.hCtxBuf
|
||
|
||
.9 rts
|
||
*---------------------------------------
|
||
MAC.Reset >STZ.G MAC.CtxID
|
||
iny
|
||
sta (pData),y
|
||
rts
|
||
*---------------------------------------
|
||
MAC.Quit >LDA.G MAC.hCtxBuf
|
||
beq .1
|
||
|
||
>SYSCALL FreeMem
|
||
|
||
.1 >LDA.G MAC.hCtxList
|
||
beq .2
|
||
>SYSCALL SListFree
|
||
|
||
.2 >LDA.G MAC.hMacroBuf
|
||
beq .3
|
||
|
||
>SYSCALL FreeMem
|
||
|
||
.3 >LDA.G MAC.hMacroList
|
||
beq .8
|
||
>SYSCALL SListFree
|
||
|
||
.8 clc
|
||
rts
|
||
*---------------------------------------
|
||
MAC.New lda #0
|
||
tay
|
||
|
||
.1 sta (ZPMacroBuf),y
|
||
iny
|
||
bne .1
|
||
|
||
rts
|
||
*---------------------------------------
|
||
MAC.AddChar >LDA.G ASM.PASS If Pass#2, ignore
|
||
bne .8
|
||
|
||
tax
|
||
lda (ZPMacroBuf)
|
||
cmp #254
|
||
beq .9 CS if EQ
|
||
|
||
inc
|
||
sta (ZPMacroBuf)
|
||
|
||
tay
|
||
txa
|
||
|
||
sta (ZPMacroBuf),y
|
||
|
||
tax
|
||
beq .1
|
||
|
||
* >SYSCALL PutChar
|
||
.8 clc
|
||
rts
|
||
|
||
.1
|
||
* lda #13
|
||
* >SYSCALL PutChar
|
||
* lda #10
|
||
* >SYSCALL PutChar
|
||
|
||
|
||
clc
|
||
.9 rts
|
||
*---------------------------------------
|
||
MAC.Store >LDA.G ASM.PASS If Pass#2, ignore
|
||
bne .8
|
||
|
||
lda (ZPMacroBuf)
|
||
beq .8
|
||
|
||
>PUSHB.G MAC.hMacroList
|
||
>PUSHW ZPNameBuf
|
||
>PUSHW ZPMacroBuf
|
||
>SYSCALL SListAdd
|
||
rts
|
||
|
||
.8 clc
|
||
rts
|
||
*---------------------------------------
|
||
MAC.Lookup >PUSHB.G MAC.hMacroList
|
||
>PUSHW ZPLinePtr
|
||
>PUSHW ZPMacroBuf
|
||
>SYSCALL SListLookup
|
||
bcs .9
|
||
|
||
adc ZPLinePtr
|
||
sta ZPLinePtr
|
||
bcc .8
|
||
|
||
inc ZPLinePtr+1
|
||
clc
|
||
.8
|
||
.9 rts
|
||
*---------------------------------------
|
||
MAC.NewOrGetCtx
|
||
*---------------------------------------
|
||
*---------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.BUILD/BIN/DEV/ASM.S.MAC
|
||
LOAD /A2OSX.BUILD/BIN/DEV/ASM.S
|
||
ASM
|