2018-01-10 16:34:57 +00:00
|
|
|
|
NEW
|
2019-03-18 16:48:16 +00:00
|
|
|
|
PREFIX
|
2018-01-10 16:34:57 +00:00
|
|
|
|
AUTO 4,1
|
2015-10-04 20:55:51 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-23 15:57:35 +00:00
|
|
|
|
* Global Symbol Record: (6+ bytes)
|
|
|
|
|
* 0 : Len
|
2018-01-19 16:21:31 +00:00
|
|
|
|
* 1 : Flags:
|
|
|
|
|
* b7=0=pending,1=resolved
|
|
|
|
|
* b6=R/W (.SE)
|
2018-03-22 16:45:23 +00:00
|
|
|
|
* b2,b1,b0 : Size (in bytes)
|
2018-01-19 16:21:31 +00:00
|
|
|
|
* 2-5 : 32 bits Value
|
2018-03-23 15:57:35 +00:00
|
|
|
|
* 6+ : Local Symbols.....
|
2015-11-13 16:25:31 +00:00
|
|
|
|
*---------------------------------------
|
2018-04-06 15:10:02 +00:00
|
|
|
|
* Local Symbol Record: (5 bytes)
|
|
|
|
|
* 0 : Local ID (1->255)
|
|
|
|
|
* 1-4 : 32 bits Value (PC)
|
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SYM.Init >SYSCALL SListNew
|
|
|
|
|
bcs .9
|
2018-01-22 16:52:04 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>STA.G SYM.hGlobalList
|
|
|
|
|
|
|
|
|
|
>LDYAI 256
|
2018-07-20 11:51:08 +00:00
|
|
|
|
>SYSCALL getmem
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPNameBuf
|
|
|
|
|
txa
|
|
|
|
|
>STA.G SYM.hNameBuf
|
|
|
|
|
|
|
|
|
|
>LDYAI 256
|
2018-07-20 11:51:08 +00:00
|
|
|
|
>SYSCALL getmem
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPGlobalBuf
|
|
|
|
|
txa
|
|
|
|
|
>STA.G SYM.hGlobalBuf
|
|
|
|
|
|
|
|
|
|
.9 rts
|
2018-01-19 16:21:31 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-22 16:47:33 +00:00
|
|
|
|
SYM.Reset >STZ.G SYM.bInGlobal
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2018-03-22 16:45:23 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-22 07:41:35 +00:00
|
|
|
|
SYM.Quit >LDA.G SYM.hNameBuf
|
2018-03-28 15:23:32 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
.2 >LDA.G SYM.hGlobalBuf
|
|
|
|
|
beq .3
|
|
|
|
|
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.3 >LDA.G SYM.hGlobalList
|
2019-03-20 16:55:26 +00:00
|
|
|
|
beq SYM.Quit.8
|
2018-07-24 16:00:24 +00:00
|
|
|
|
>SYSCALL SListFree
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
SYM.Quit.8 clc
|
|
|
|
|
SYM.Quit.RTS rts
|
2015-10-30 16:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-20 16:55:26 +00:00
|
|
|
|
SYM.Dump >LDA.G ASM.LI.ON
|
|
|
|
|
bpl SYM.Quit.8
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.SYMBOLS
|
2018-11-26 21:52:49 +00:00
|
|
|
|
>SYSCALL puts
|
2018-01-29 16:48:07 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
stz ZPPtr2
|
|
|
|
|
stz ZPPtr2+1
|
|
|
|
|
|
|
|
|
|
.1 >LDYA ZPPtr2
|
|
|
|
|
>STYA ZPPtr1
|
2019-03-21 07:07:38 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>PUSHW ZPNameBuf
|
2019-03-19 16:52:08 +00:00
|
|
|
|
>PUSHW ZPPtr1
|
2019-03-18 16:48:16 +00:00
|
|
|
|
>LDA.G SYM.hGlobalList
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>SYSCALL SListGetByID
|
2019-03-20 16:55:26 +00:00
|
|
|
|
bcs SYM.Quit.8
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>STYA ZPPtr2 Save Next ID
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-19 16:52:08 +00:00
|
|
|
|
>PUSHWI 0 Start
|
|
|
|
|
>PUSHWI $ffff End
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>PUSHW ZPGlobalBuf
|
|
|
|
|
>PUSHW ZPPtr1 KeyID
|
2019-03-19 16:52:08 +00:00
|
|
|
|
>LDA.G SYM.hGlobalList
|
2019-03-21 16:37:02 +00:00
|
|
|
|
|
2019-03-19 16:52:08 +00:00
|
|
|
|
>SYSCALL SListGetData
|
2019-03-21 07:07:38 +00:00
|
|
|
|
bcs SYM.Quit.RTS
|
2019-03-19 16:52:08 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
ldy #SYMG.SIZE Get Symbol Size
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPGlobalBuf),y
|
|
|
|
|
|
|
|
|
|
tax
|
2018-03-28 15:23:32 +00:00
|
|
|
|
beq .3
|
2018-03-16 16:33:11 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
phx
|
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
.2 iny
|
|
|
|
|
lda (ZPGlobalBuf),y
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
pla Byte Count
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.3 >PUSHA
|
|
|
|
|
|
|
|
|
|
ldy L.MSG.EQU0,x
|
2018-03-28 15:23:32 +00:00
|
|
|
|
lda L.MSG.EQU0+1,x
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-01-25 16:13:28 +00:00
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LDYA ZPNameBuf Label
|
2019-03-21 07:07:38 +00:00
|
|
|
|
>SYSCALL printf
|
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
lda (ZPGlobalBuf)
|
2019-03-21 16:37:02 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
bit #SYMG.F.LOCALS
|
|
|
|
|
beq .7
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
ldy #SYMG
|
|
|
|
|
|
|
|
|
|
.4 lda (ZPGlobalBuf),y
|
|
|
|
|
beq .7 End Local Symbol
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
pha Save ID
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
ldx #4
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
.5 iny
|
|
|
|
|
lda (ZPGlobalBuf),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dex
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
>PUSHA
|
|
|
|
|
phy
|
2018-11-26 21:52:49 +00:00
|
|
|
|
>PUSHBI 6
|
2018-04-06 15:10:02 +00:00
|
|
|
|
>LDYA L.MSG.LSYMBOL
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-03-30 15:21:42 +00:00
|
|
|
|
ply
|
|
|
|
|
bne .4
|
|
|
|
|
|
2018-11-26 21:52:49 +00:00
|
|
|
|
.7 >PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.CRLF
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-03-21 07:07:38 +00:00
|
|
|
|
jmp .1
|
2018-01-19 16:21:31 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SYM.NewOrGetGlobal
|
|
|
|
|
>LDA.G ASM.PASS
|
2019-03-19 16:52:08 +00:00
|
|
|
|
bne SYM.GetGlobal
|
2018-03-23 15:57:35 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
SYM.NewGlobal jsr SYM.StoreGlobal
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>PUSHW ZPLinePtr Pass #1; try to add global...
|
2019-03-19 16:52:08 +00:00
|
|
|
|
>LDA.G SYM.hGlobalList
|
|
|
|
|
>SYSCALL SListNewKey
|
|
|
|
|
bcs .9 Already Defined
|
|
|
|
|
>STYA.G SYM.GlobalID
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
adc ZPLinePtr
|
|
|
|
|
sta ZPLinePtr
|
|
|
|
|
bcc .1
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-19 16:52:08 +00:00
|
|
|
|
inc ZPLinePtr+1
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
.1 jsr SYM.PC2Acc
|
|
|
|
|
|
|
|
|
|
jsr SYM.Acc2Global
|
|
|
|
|
|
|
|
|
|
lda #SYMG
|
|
|
|
|
|
|
|
|
|
>STA.G SYM.GlobalPtr
|
2019-03-21 16:37:02 +00:00
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPGlobalBuf),y
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
lda #$ff
|
2019-03-22 16:47:33 +00:00
|
|
|
|
>STA.G SYM.bInGlobal
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #ERR.SYMBOL.REDEF
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2018-03-23 15:57:35 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-19 16:52:08 +00:00
|
|
|
|
SYM.GetGlobal >PUSHW ZPLinePtr Pass #2: should be already defined...
|
|
|
|
|
>LDA.G SYM.hGlobalList
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>SYSCALL SListLookup
|
|
|
|
|
bcs .9
|
2019-03-19 16:52:08 +00:00
|
|
|
|
>STYA.G SYM.GlobalID
|
|
|
|
|
|
|
|
|
|
txa
|
2018-03-28 15:23:32 +00:00
|
|
|
|
adc ZPLinePtr
|
|
|
|
|
sta ZPLinePtr
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
inc ZPLinePtr+1
|
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
.1 >PUSHWI 0 Start
|
|
|
|
|
>PUSHWI $ffff End
|
2019-03-22 16:47:33 +00:00
|
|
|
|
>PUSHW ZPGlobalBuf
|
|
|
|
|
>PUSHW.G SYM.GlobalID
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>LDA.G SYM.hGlobalList
|
|
|
|
|
>SYSCALL SListGetData
|
2019-03-22 16:47:33 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
|
|
|
|
>STA.G SYM.bInGlobal
|
|
|
|
|
* clc
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #ERR.UNDEF.SYMBOL
|
|
|
|
|
sec
|
2019-03-22 16:47:33 +00:00
|
|
|
|
.99 rts
|
2018-01-22 07:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SYM.LookupGlobal
|
|
|
|
|
>PUSHW ZPLinePtr
|
2019-03-18 16:48:16 +00:00
|
|
|
|
>LDA.G SYM.hGlobalList
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>SYSCALL SListLookup
|
|
|
|
|
bcs .9
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
2019-03-22 07:41:35 +00:00
|
|
|
|
>STYA ZPPtr1
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
2019-03-18 16:48:16 +00:00
|
|
|
|
txa
|
2018-03-28 15:23:32 +00:00
|
|
|
|
adc ZPLinePtr
|
|
|
|
|
sta ZPLinePtr
|
2019-03-20 16:55:26 +00:00
|
|
|
|
bcc .1
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
inc ZPLinePtr+1
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
2019-03-22 07:41:35 +00:00
|
|
|
|
.1 >LDA.G SYM.GlobalID
|
|
|
|
|
cmp ZPPtr1
|
|
|
|
|
bne .3
|
2019-03-22 16:47:33 +00:00
|
|
|
|
iny SYM.GlobalID+1
|
2019-03-22 07:41:35 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
cmp ZPPtr1+1
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
ldy #SYMG-1
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPGlobalBuf),y
|
|
|
|
|
sta SRC.ACC.F,y
|
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
2019-03-22 16:47:33 +00:00
|
|
|
|
|
2019-03-22 07:41:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 >PUSHWI 0 Start
|
|
|
|
|
>PUSHWI SYMG Get only Global value
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>PUSHW L.SRC.ACC.F
|
2019-03-22 07:41:35 +00:00
|
|
|
|
>PUSHW ZPPtr1
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>LDA.G SYM.hGlobalList
|
|
|
|
|
>SYSCALL SListGetData
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #ERR.UNDEF.SYMBOL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-19 16:52:08 +00:00
|
|
|
|
SYM.StoreGlobal >LDA.G ASM.PASS
|
|
|
|
|
bne .8
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-22 16:47:33 +00:00
|
|
|
|
>LDA.G SYM.bInGlobal
|
2019-03-20 16:55:26 +00:00
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
>LDA.G SYM.GlobalPtr
|
|
|
|
|
tay
|
|
|
|
|
lda #0
|
|
|
|
|
cpy #SYMG
|
|
|
|
|
beq .1
|
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
lda (ZPGlobalBuf)
|
|
|
|
|
ora #SYMG.F.LOCALS
|
|
|
|
|
sta (ZPGlobalBuf)
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPGlobalBuf),y
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
inc
|
|
|
|
|
|
|
|
|
|
.1 >PUSHYA
|
|
|
|
|
|
|
|
|
|
.2 >PUSHW ZPGlobalBuf
|
2019-03-18 16:48:16 +00:00
|
|
|
|
>PUSHW.G SYM.GlobalID
|
|
|
|
|
>LDA.G SYM.hGlobalList
|
|
|
|
|
>SYSCALL SListAddData
|
2019-03-19 16:52:08 +00:00
|
|
|
|
bcs .9
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
lda #0
|
2019-03-22 16:47:33 +00:00
|
|
|
|
>STA.G SYM.bInGlobal
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 clc
|
2018-04-06 15:10:02 +00:00
|
|
|
|
.9 rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-22 16:47:33 +00:00
|
|
|
|
SYM.UpdateGlobal
|
|
|
|
|
>PUSHWI SYMG
|
|
|
|
|
>PUSHW L.SRC.ACC.F
|
|
|
|
|
>PUSHW.G SYM.GlobalID
|
|
|
|
|
>LDA.G SYM.hGlobalList
|
|
|
|
|
>SYSCALL SListSetData
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2019-03-19 16:52:08 +00:00
|
|
|
|
SYM.PC2Acc ldy #ASM.PC+3
|
2019-03-22 16:47:33 +00:00
|
|
|
|
ldx #3
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
.1 lda (pData),y
|
2019-03-19 16:52:08 +00:00
|
|
|
|
sta SRC.ACC,x
|
2018-03-28 15:23:32 +00:00
|
|
|
|
dey
|
2019-03-22 16:47:33 +00:00
|
|
|
|
dex
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bpl .1
|
2019-03-19 16:52:08 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
lda #2
|
2019-03-19 16:52:08 +00:00
|
|
|
|
sta SRC.ACC.SIZE
|
2019-03-21 16:37:02 +00:00
|
|
|
|
stz SRC.ACC.F
|
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2018-01-24 16:24:06 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-21 16:37:02 +00:00
|
|
|
|
SYM.Acc2Global ldy #SYMG-1
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
.2 lda SRC.ACC.F,y
|
|
|
|
|
sta (ZPGlobalBuf),y
|
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
2019-03-20 16:55:26 +00:00
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2018-04-06 15:10:02 +00:00
|
|
|
|
* Local Symbol Record: (5 bytes)
|
2018-03-28 15:23:32 +00:00
|
|
|
|
* 0 : Local ID (1->255)
|
2018-04-06 15:10:02 +00:00
|
|
|
|
* 1-4 : 32 bits Value (PC)
|
2018-03-22 16:45:23 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SYM.NewOrGetLocalA
|
2019-03-22 16:47:33 +00:00
|
|
|
|
tax Save Local ID
|
2019-03-21 16:37:02 +00:00
|
|
|
|
|
2019-03-22 16:47:33 +00:00
|
|
|
|
>LDA.G SYM.bInGlobal not in a global label
|
2019-03-20 16:55:26 +00:00
|
|
|
|
bpl .91
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
>LDA.G ASM.PASS Pass #2: should be already defined...
|
2019-03-20 16:55:26 +00:00
|
|
|
|
bne SYM.GetLocalX
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
jsr SYM.GetLocalX Pass #1; try to add
|
2018-04-06 15:10:02 +00:00
|
|
|
|
bcc .9 Already Defined
|
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>LDA.G SYM.GlobalPtr
|
2018-03-28 15:23:32 +00:00
|
|
|
|
tay
|
2019-03-20 16:55:26 +00:00
|
|
|
|
beq .90
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-04-06 15:10:02 +00:00
|
|
|
|
ldy #ASM.PC+4
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-04-06 15:10:02 +00:00
|
|
|
|
.1 dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
pha
|
|
|
|
|
cpy #ASM.PC
|
|
|
|
|
bne .1
|
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
>LDA.G SYM.GlobalPtr
|
2018-04-06 15:10:02 +00:00
|
|
|
|
tay
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-04-06 15:10:02 +00:00
|
|
|
|
txa Get Back ID
|
|
|
|
|
sta (ZPGlobalBuf),y
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
ldx #4
|
|
|
|
|
|
|
|
|
|
.2 pla
|
|
|
|
|
iny
|
2018-04-06 15:10:02 +00:00
|
|
|
|
sta (ZPGlobalBuf),y
|
2018-03-28 15:23:32 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2019-03-22 16:47:33 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
tya
|
2019-03-20 16:55:26 +00:00
|
|
|
|
>STA.G SYM.GlobalPtr
|
2019-03-22 16:47:33 +00:00
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPGlobalBuf),y
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-04-06 15:10:02 +00:00
|
|
|
|
clc
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
.91 lda #ERR.INV.LABEL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2018-04-06 15:10:02 +00:00
|
|
|
|
.90 lda #ERR.TOO.MANY.LOCAL
|
2019-03-20 16:55:26 +00:00
|
|
|
|
sec
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #ERR.SYMBOL.REDEF
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2018-01-29 16:48:07 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-22 16:47:33 +00:00
|
|
|
|
SYM.GetLocalX lda (ZPGlobalBuf)
|
|
|
|
|
and #SYMG.F.LOCALS
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldy #SYML
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2019-03-21 16:37:02 +00:00
|
|
|
|
.1 lda (ZPGlobalBuf),y
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
txa
|
2019-03-20 16:55:26 +00:00
|
|
|
|
cmp (ZPGlobalBuf),y
|
|
|
|
|
bne .3
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2019-03-20 16:55:26 +00:00
|
|
|
|
ldx #4
|
|
|
|
|
stx SRC.ACC.SIZE
|
|
|
|
|
|
|
|
|
|
.2 iny
|
2018-04-06 15:10:02 +00:00
|
|
|
|
lda (ZPGlobalBuf),y
|
2019-03-20 16:55:26 +00:00
|
|
|
|
sta SRC.ACC.SIZE,x
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2018-01-26 16:19:17 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2019-03-20 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
.3 tya
|
|
|
|
|
clc
|
|
|
|
|
adc #SYML
|
|
|
|
|
tay
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.9 lda #ERR.UNDEF.SYMBOL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
*---------------------------------------
|
|
|
|
|
* Private Symbol Record: (9 bytes)
|
|
|
|
|
* 0 : Len (8)
|
|
|
|
|
* 1 : Flags:
|
|
|
|
|
* b7=0=pending,1=resolved
|
|
|
|
|
* 2-5 : 32 bits Value (PC)
|
|
|
|
|
* 6,7 : MCID (Macro Context ID)
|
|
|
|
|
* 8 : Private ID (0->255)
|
2015-10-04 20:55:51 +00:00
|
|
|
|
*---------------------------------------
|
2018-01-22 07:34:59 +00:00
|
|
|
|
SYM.AddPrivate
|
2018-03-28 15:23:32 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-10-04 20:55:51 +00:00
|
|
|
|
*---------------------------------------
|
2018-01-22 07:34:59 +00:00
|
|
|
|
SYM.LookupPrivate
|
2018-03-28 15:23:32 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-11-27 16:26:11 +00:00
|
|
|
|
*---------------------------------------
|
2015-10-04 20:55:51 +00:00
|
|
|
|
MAN
|
2019-01-28 07:44:37 +00:00
|
|
|
|
SAVE USR/SRC/BIN/ASM.S.SYM
|
|
|
|
|
LOAD USR/SRC/BIN/ASM.S
|
2015-10-04 20:55:51 +00:00
|
|
|
|
ASM
|