2015-10-04 20:55:51 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2015-10-06 16:14:48 +00:00
|
|
|
|
.LIST OFF
|
2015-10-04 20:55:51 +00:00
|
|
|
|
*---------------------------------------
|
2015-10-30 16:34:59 +00:00
|
|
|
|
* Global Symbol Record: (7 bytes)
|
|
|
|
|
* 0 : SYM.Block.ID
|
|
|
|
|
* 1 : Index in SYM.Block
|
|
|
|
|
* 2 : Flags:
|
|
|
|
|
* b7=R/W (.SE)
|
|
|
|
|
* b6=Forward ref
|
|
|
|
|
* 3-6 : Value
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
* Local Symbol Record: (4 bytes)
|
|
|
|
|
* 0,1 : Pointer to Global Symbol in main table
|
|
|
|
|
* 2 : 2 digits name (.99)
|
|
|
|
|
* 3 : offset from Global Symbol
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
* Private Symbol Record: (7 bytes)
|
|
|
|
|
* 0,1 : MacroID
|
|
|
|
|
* 2 : 2 digits name (:99)
|
|
|
|
|
* 3-6 : Value
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SYM.Init >PUSHWI SYM.MAXCOUNT*8
|
|
|
|
|
>PUSHBI S.MEM.F.INIT0
|
|
|
|
|
>SYSCALL SYS.GetMem
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.hMem
|
|
|
|
|
txa
|
|
|
|
|
sta (pData),y
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SYM.Quit ldy #SYM.hMem
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .8
|
|
|
|
|
>SYSCALL SYS.FreeMemA
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-09 15:53:30 +00:00
|
|
|
|
SYM.Add
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-28 16:55:12 +00:00
|
|
|
|
SYM.AddGlobal
|
2015-10-04 20:55:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-28 16:55:12 +00:00
|
|
|
|
SYM.LookupGlobal
|
2015-10-04 20:55:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-28 16:55:12 +00:00
|
|
|
|
SYM.ClearPrivate
|
2015-10-04 20:55:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SYM.ClearLocal
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SYM.AddLocal
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SYM.LookupLocal
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-28 16:55:12 +00:00
|
|
|
|
SYM.AddPrivate
|
2015-10-04 20:55:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-28 16:55:12 +00:00
|
|
|
|
SYM.LookupPrivate
|
2015-10-04 20:55:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-30 16:34:59 +00:00
|
|
|
|
SYM.AddBlock ldx #0
|
2015-10-04 20:55:51 +00:00
|
|
|
|
.1 lda SYM.BLOCKS,x
|
|
|
|
|
beq .2
|
|
|
|
|
inx
|
|
|
|
|
cpx #SYM.BLOCK.MAX
|
|
|
|
|
bne .1
|
|
|
|
|
lda #ERR.SYM.TOO.LONG
|
|
|
|
|
sec Out of block error
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.2 phx Save next free block
|
|
|
|
|
>LDYA SYM.BLOCK.SIZE
|
|
|
|
|
>SYSCALL SYS.GetMem
|
|
|
|
|
bcs .9
|
|
|
|
|
txa
|
|
|
|
|
plx
|
|
|
|
|
sta SYM.BLOCKS,x
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE BIN/ASM.S.SYM
|
|
|
|
|
LOAD BIN/ASM.S
|
|
|
|
|
ASM
|