A2osX/BIN/ASM.S.SYM.txt

162 lines
3.1 KiB
Plaintext
Raw Normal View History

NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
2015-10-04 20:55:51 +00:00
*---------------------------------------
2015-11-13 16:25:31 +00:00
* Global Symbol Record: (8+ bytes)
* 0 : Len (6)
* 1 : Flags:
* b7=0=pending,1=resolved
* b6=R/W (.SE)
* 2-5 : 32 bits Value
*
2015-11-13 16:25:31 +00:00
* Local Symbol Record: (2 bytes)
2015-11-20 16:31:14 +00:00
* 2 : Local ID (1->255)
2015-10-30 16:34:59 +00:00
* 3 : offset from Global Symbol
2015-11-13 16:25:31 +00:00
* ......
* Ending 0
*---------------------------------------
* Global Symbol Index (Sorted)
* 0 : hGblock
* 1 : Offset in block
2015-10-30 16:34:59 +00:00
*---------------------------------------
* Private Symbol Record: (7 bytes)
* 0,1 : MacroID
2015-11-13 16:25:31 +00:00
* 2 : Private ID (0->255)
2015-10-30 16:34:59 +00:00
* 3-6 : Value
*---------------------------------------
2015-11-13 16:25:31 +00:00
* Macro Record: ( bytes)
*---------------------------------------
SYM.Init >SYSCALL SListNew
bcs .9
2018-01-22 16:52:04 +00:00
>STA.G SYM.hGlobals
.9 rts
*---------------------------------------
SYM.Quit >LDA.G SYM.hGlobals
>SYSCALL SListFree.A
2015-10-30 16:34:59 +00:00
rts
*---------------------------------------
SYM.Dump >LDYA L.MSG.SYMBOLS
>SYSCALL PrintF.YA
2015-11-20 16:31:14 +00:00
2018-01-22 16:52:04 +00:00
stz ZPLinePtr
stz ZPLinePtr+1
.1 >PUSHB.G SYM.hGlobals
>PUSHW ZPLinePtr
>PUSHW ZPTmpBuf
>SYSCALL SListGetByID
bcs .8
>STYA ZPLinePtr
>PUSHW ZPTmpBuf Label (PString)
lda (ZPTmpBuf)
sec
adc ZPTmpBuf
sta ZPPtr1
lda ZPTmpBuf+1
adc #0
sta ZPPtr1+1
ldx #4
ldy #2
.2 lda (ZPPtr1),y
>PUSHA
iny
dex
bne .2
>LDYA L.MSG.GSYMBOL
>SYSCALL PrintF.YA
bcc .1
rts
.8 clc
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.AddGlobalPC ldx #4
ldy #ASM.PC
.1 lda (pData),y
pha
iny
dex
bne .1
ldx #4
ldy #SYM.Global+SYM.V+3
.2 pla
sta (pData),y
dey
dex
bne .2
2015-10-04 20:55:51 +00:00
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.AddGlobal lda #SYM.F.RESOLVED
>STA.G SYM.Global+SYM.F
2018-01-22 16:52:04 +00:00
2018-01-22 07:34:59 +00:00
lda #6 LEN+F+DWORD
>STA.G SYM.Global+SYM.LEN
>PUSHB.G SYM.hGlobals
>PUSHW ZPLinePtr
2018-01-22 16:52:04 +00:00
2018-01-22 07:34:59 +00:00
>PUSHEA.G SYM.Global
>SYSCALL SListAdd
bcs .9
2018-01-22 16:52:04 +00:00
2018-01-22 07:34:59 +00:00
adc ZPLinePtr
sta ZPLinePtr
bcc .1
inc ZPLinePtr+1
2015-10-04 20:55:51 +00:00
clc
2018-01-22 07:34:59 +00:00
.1 tya
>STA.G ASM.SYM.ID+1
dey
txa
sta (pData),y
.9 rts
*---------------------------------------
SYM.UpdateGlobal >PUSHB.G SYM.hGlobals
>PUSHW.G ASM.SYM.ID
>PUSHEA.G SYM.Global
>SYSCALL SListUpdateByID
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.AddLocal
2015-10-04 20:55:51 +00:00
clc
rts
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.GetLocal
2015-10-04 20:55:51 +00:00
clc
rts
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.AddPrivate
2015-10-04 20:55:51 +00:00
clc
rts
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.LookupPrivate
2015-11-27 16:26:11 +00:00
clc
rts
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.AddMacro
2015-11-27 16:26:11 +00:00
clc
rts
2015-11-20 16:31:14 +00:00
*---------------------------------------
2018-01-22 07:34:59 +00:00
SYM.LookupMacro
clc
2015-11-20 16:31:14 +00:00
rts
2018-01-22 07:34:59 +00:00
*---------------------------------------
2015-10-04 20:55:51 +00:00
MAN
SAVE /A2OSX.BUILD/BIN/DEV/ASM.S.SYM
LOAD /A2OSX.BUILD/BIN/DEV/ASM.S
2015-10-04 20:55:51 +00:00
ASM