mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
111 lines
1.8 KiB
Plaintext
111 lines
1.8 KiB
Plaintext
NEW
|
||
PREFIX
|
||
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.AddChar tax
|
||
|
||
phy
|
||
|
||
>LDA.G MAC.BufPtr
|
||
tay
|
||
|
||
txa
|
||
sta (ZPMacroBuf),y
|
||
>INC.G MAC.BufPtr
|
||
ply
|
||
|
||
txa
|
||
bne .8
|
||
|
||
>LDA.G MAC.BufPtr
|
||
tay
|
||
lda #0
|
||
|
||
>PUSHYA
|
||
>PUSHW ZPMacroBuf
|
||
>PUSHW.G MAC.MacroID
|
||
>LDA.G MAC.hMacroList
|
||
>SYSCALL SListAddData
|
||
rts
|
||
|
||
.8 clc
|
||
rts
|
||
*---------------------------------------
|
||
MAC.Lookup >PUSHW ZPMacroBuf
|
||
>PUSHW ZPLinePtr
|
||
>LDA.G MAC.hMacroList
|
||
>SYSCALL SListLookup
|
||
bcs .9
|
||
txa
|
||
adc ZPLinePtr
|
||
sta ZPLinePtr
|
||
bcc .8
|
||
|
||
inc ZPLinePtr+1
|
||
clc
|
||
.8
|
||
.9 rts
|
||
*---------------------------------------
|
||
MAC.NewOrGetCtx sec
|
||
rts
|
||
*---------------------------------------
|
||
*---------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/BIN/ASM.S.MAC
|
||
LOAD USR/SRC/BIN/ASM.S
|
||
ASM
|