A2osX/BIN/ASM.S.MAC.txt
2019-03-18 16:48:16 +00:00

111 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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