2022-01-30 21:47:08 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Input : ZPLineBufPtr, Y,A = T/Q, X = SC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* CS : Reset Buffer
|
|
|
|
|
* CC : Reuse Buffer
|
2022-01-30 21:47:08 +00:00
|
|
|
|
* Output : Y,A = VarID
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.New >STYA ZPPtr2 T/Q
|
2022-01-30 21:47:08 +00:00
|
|
|
|
stx ZPPtr3 SC
|
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
bit bPass2
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bmi SYM.New.Pass2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SYM.New.Pass1 jsr SYM.BufInitYAXC set buf according C
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jsr SYM.Get
|
|
|
|
|
bcs .1
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.FUNC
|
|
|
|
|
beq .90
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
bne .90
|
|
|
|
|
|
|
|
|
|
jmp F.Def
|
|
|
|
|
|
|
|
|
|
.1 >PUSHB.G CC.hSyms
|
2022-06-22 06:26:44 +00:00
|
|
|
|
>PUSHW ZPLineBufPtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
jsr SCOPE.Push
|
2022-12-30 16:29:57 +00:00
|
|
|
|
>SYSCALL SListNewKey
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs SYM.New.9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
>STYA.G CC.SymID Y,A = KeyID
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
jsr CC.SkipX X = KeyLen
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.DO _DBG_SYM=1
|
|
|
|
|
jsr SYM.DEBUGN
|
|
|
|
|
.FIN
|
|
|
|
|
|
|
|
|
|
bra SYM.New.2
|
2023-01-31 06:55:01 +00:00
|
|
|
|
|
|
|
|
|
.90 lda #E.REDEF
|
|
|
|
|
sec
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
SYM.New.9 rts
|
2022-06-22 06:26:44 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
SYM.New.Pass2 jsr SYM.Get
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bcs SYM.New.9
|
2022-09-11 19:11:32 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.New.2 jsr CC.GetCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
cmp #';'
|
|
|
|
|
bne .1
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
lda ZPPtr3
|
2022-09-11 19:11:32 +00:00
|
|
|
|
cmp #SYM.SC.TYPEDEF
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne SYM.SetAddr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.1 cmp #'('
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne SYM.NewV
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.GetSymSizeOfInAX
|
|
|
|
|
jsr SYM.SetSizeOf
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
ora #SYM.Q.FUNC
|
|
|
|
|
sta (ZPSymBufPtr),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.Store Store this f() with no prototype...
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr F.Decl
|
|
|
|
|
rts
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.NewV cmp #'['
|
|
|
|
|
bne SYM.SetAddr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Q
|
2022-01-30 21:47:08 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
and #%11001111
|
|
|
|
|
sta (ZPSymBufPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.DefSize
|
2022-10-07 19:21:37 +00:00
|
|
|
|
lda #SYM.Def
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPSymBufPtr),y
|
|
|
|
|
clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
adc #SYM.Q.ARRAY
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB Skip [
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
cmp #']'
|
|
|
|
|
bne .2
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.PPPOINTER
|
2022-09-11 19:11:32 +00:00
|
|
|
|
beq .98 [] only allowed for *
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.Add0000 set as [0] (deref)
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bra .3
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.2 jsr EXP.IntConst
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.AddWord
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
cmp #']'
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .98
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.3 jsr CORE.GetNCharNB Skip ]
|
|
|
|
|
bcs SYM.SetAddr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
cmp #'['
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne SYM.SetAddr
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.AAARRAY
|
|
|
|
|
cmp #SYM.Q.AAARRAY
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .1 already [][][] ?
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.98 lda #E.CSYN
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sec
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.SetAddr ldy #SYM.SizeOf
|
2022-09-11 19:11:32 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
iny
|
|
|
|
|
ora (ZPSymBufPtr),y
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr SYM.GetSymSizeOfInAX
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.SetSizeOf
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.1 ldy #SYM.SC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
2022-10-07 19:21:37 +00:00
|
|
|
|
beq SYM.SetAddrG SYM.SC.STATIC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
cmp #SYM.SC.AUTO
|
2022-10-07 19:21:37 +00:00
|
|
|
|
beq SYM.SetAddrL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.SetAddrG ldy #SYM.Addr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
lda ZPCCData
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda ZPCCData+1
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
ldy #SYM.SizeOf
|
|
|
|
|
lda (ZPSymBufPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
clc
|
|
|
|
|
adc ZPCCData
|
|
|
|
|
sta ZPCCData
|
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPSymBufPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
adc ZPCCData+1
|
|
|
|
|
sta ZPCCData+1
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.SetAddrL ldy #SYM.SizeOf+1
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
dey #SYM.SizeOf
|
|
|
|
|
|
|
|
|
|
lda (ZPSymBufPtr),y
|
2022-12-13 06:55:13 +00:00
|
|
|
|
clc
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy ScopePtr
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
adc (ScopeStk),y
|
2022-12-13 06:55:13 +00:00
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
sta (ScopeStk),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Addr
|
|
|
|
|
sta (ZPSymBufPtr),y
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
ldy #SYM.SizeOf
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
clc
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy ScopePtr
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
adc (ScopeStk),y
|
|
|
|
|
sta (ScopeStk),y
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.BUF
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.BufInitYAXC pha
|
2022-09-11 19:11:32 +00:00
|
|
|
|
tya
|
|
|
|
|
sta (ZPSymBufPtr) #SYM.T
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
iny #SYM.SC
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
bcc .8 DONT reset buffer
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.1 iny
|
|
|
|
|
sta (ZPSymBufPtr),y
|
2023-01-06 14:02:35 +00:00
|
|
|
|
cpy #SYM-1
|
2022-12-13 06:55:13 +00:00
|
|
|
|
bcc .1
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
ldy #SYM.DefSize
|
2022-10-07 19:21:37 +00:00
|
|
|
|
lda #SYM.Def
|
2022-09-11 19:11:32 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.PushAddr ldy #SYM.SC
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
beq .1 SYM.SC.STATIC
|
|
|
|
|
* LOCAL
|
|
|
|
|
>LDYA L.PCC.PushLAddrH
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Addr
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
eor #$FF
|
|
|
|
|
inc
|
|
|
|
|
jsr CODE.LDAI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PushLAddrL
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
* GLOBAL
|
|
|
|
|
|
|
|
|
|
.1 ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.CONST
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PushIAddr
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.2 >LDYA L.PCC.PushUAddr
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.GetAddr1 ldy #SYM.SC
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
beq .1 SYM.SC.STATIC
|
|
|
|
|
* LOCAL
|
|
|
|
|
ldy #SYM.Addr
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
eor #$FF
|
|
|
|
|
inc
|
|
|
|
|
jsr CODE.LDAI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.GetLAddr1
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
* GLOBAL
|
|
|
|
|
|
|
|
|
|
.1 ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.CONST
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.GetIAddr1
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.2 >LDYA L.PCC.GetUAddr1
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.GetAddr2 ldy #SYM.SC
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
beq .1 SYM.SC.STATIC
|
|
|
|
|
* LOCAL
|
|
|
|
|
ldy #SYM.Addr
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
eor #$FF
|
|
|
|
|
inc
|
|
|
|
|
jsr CODE.LDAI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.GetLAddr2
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
* GLOBAL
|
|
|
|
|
|
|
|
|
|
.1 ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.CONST
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.GetIAddr2
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.2 >LDYA L.PCC.GetUAddr2
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
SYM.Get >PUSHB.G CC.hSyms
|
|
|
|
|
>PUSHW ZPLineBufPtr
|
|
|
|
|
jsr SCOPE.Push
|
|
|
|
|
>SYSCALL SListLookup
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA.G CC.SymID Y,A = KeyID
|
|
|
|
|
|
|
|
|
|
jsr CC.SkipX X = KeyLen
|
|
|
|
|
|
|
|
|
|
>PUSHB.G CC.hSyms
|
|
|
|
|
>PUSHW.G CC.SymID
|
|
|
|
|
>PUSHW ZPSymBufPtr
|
|
|
|
|
>PUSHWI 65535 all
|
|
|
|
|
>PUSHWZ From Start
|
|
|
|
|
>SYSCALL SListGetData
|
|
|
|
|
.DO _DBG_SYM=1
|
|
|
|
|
bcs .9
|
|
|
|
|
jsr SYM.DEBUGG
|
|
|
|
|
.FIN
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.NewKey >PUSHA
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>PUSHW ZPLineBufPtr
|
2022-11-02 06:54:30 +00:00
|
|
|
|
>PUSHWI 0 ScopeID
|
2022-06-22 06:26:44 +00:00
|
|
|
|
>SYSCALL SListNewKey
|
2022-12-07 07:02:29 +00:00
|
|
|
|
rts Y,A = KeyID, X = KeyLen
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.Add0000 >LDYAI 0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.AddWord phy
|
2022-09-11 19:11:32 +00:00
|
|
|
|
pha
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.DefSize
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #2
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
2022-09-11 19:11:32 +00:00
|
|
|
|
tay
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
dey
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
pla A
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
dey
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
pla Y
|
|
|
|
|
pha
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
iny
|
2022-09-11 19:11:32 +00:00
|
|
|
|
lda (ZPSymBufPtr),y get back A
|
|
|
|
|
ply get back Y
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 pla
|
|
|
|
|
pla
|
|
|
|
|
lda #E.BUF
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.AddName jsr CC.GetCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
jsr CC.IsLetter
|
|
|
|
|
bcs .98
|
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
jsr CC.GetIDLen
|
|
|
|
|
tax
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.AddByte
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
ldy #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.1 lda (ZPLineBufPtr),y
|
|
|
|
|
phy
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.AddByte
|
2022-09-17 11:35:52 +00:00
|
|
|
|
ply
|
|
|
|
|
bcs .99
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
tya
|
|
|
|
|
jsr CC.SkipA
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.AddByte pha
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.DefSize
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
inc
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
dec
|
|
|
|
|
tay
|
2022-08-20 14:37:37 +00:00
|
|
|
|
pla
|
|
|
|
|
sta (ZPSymBufPtr),y
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 pla
|
|
|
|
|
lda #E.BUF
|
|
|
|
|
sec
|
2022-08-20 14:37:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-12-07 07:02:29 +00:00
|
|
|
|
SYM.Update sec
|
|
|
|
|
.HS 90 BCC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SYM.Store clc
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bit bPass2
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bmi .8
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
php
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SYM=1
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bcc .10
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.DEBUGU
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
|
|
|
|
bra .11
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.10
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.DEBUGS
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.11 .FIN
|
|
|
|
|
>PUSHB.G CC.hSyms
|
2022-06-22 06:26:44 +00:00
|
|
|
|
>PUSHW.G CC.SymID
|
|
|
|
|
>PUSHW ZPSymBufPtr
|
|
|
|
|
>PUSHBI 0
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.FUNC
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
ldy #SYM.DefSize
|
|
|
|
|
lda (ZPSymBufPtr),y
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bra .2
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.1 lda #SYM.F.MAX
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.2 >PUSHA
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
plp
|
|
|
|
|
bcs .3
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>SYSCALL SListAddData
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.3 >SYSCALL SListSetData
|
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.8 bcc .9
|
|
|
|
|
|
|
|
|
|
>PUSHB.G CC.hSyms
|
|
|
|
|
>PUSHW.G CC.SymID
|
|
|
|
|
>PUSHW ZPSymBufPtr
|
|
|
|
|
>PUSHWI 65535 all
|
|
|
|
|
>PUSHWZ From Start
|
|
|
|
|
>SYSCALL SListGetData
|
|
|
|
|
|
|
|
|
|
.DO _DBG_SYM=1
|
|
|
|
|
bcs .9
|
|
|
|
|
jsr SYM.DEBUGG
|
|
|
|
|
.FIN
|
|
|
|
|
.9 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.Lookup >LDA.G CC.LookupIdx
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
cmp #CC.LookupIdx+LOOKUP.MAX
|
|
|
|
|
beq .99
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHB.G CC.hSyms ...for SListGetData
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
|
|
|
|
.1 pha
|
|
|
|
|
>PUSHB.G CC.hSyms
|
|
|
|
|
>PUSHW ZPLineBufPtr
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pla
|
|
|
|
|
pha
|
|
|
|
|
jsr SCOPE.PushA
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>SYSCALL SListLookup
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcc .8
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
pla
|
2022-06-12 20:42:22 +00:00
|
|
|
|
beq .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
* sec
|
|
|
|
|
sbc #SCOPE
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bra .1
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.99 lda #E.OOH
|
|
|
|
|
* sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 inc pStack discard CC.hSyms
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
lda #E.NOKEY
|
2022-06-12 20:42:22 +00:00
|
|
|
|
sec
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.8 >PUSHA KeyID.HI
|
|
|
|
|
tya
|
|
|
|
|
>PUSHA KeyID.LO
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
pla discard ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
|
|
|
|
jsr CC.SkipX
|
|
|
|
|
|
|
|
|
|
>PUSHWZ allocate
|
|
|
|
|
>PUSHWI 65535 all
|
|
|
|
|
>PUSHWZ From Start
|
|
|
|
|
>SYSCALL SListGetData
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
|
|
|
|
>STYA.G CC.LookupSymSize
|
|
|
|
|
|
|
|
|
|
>INC.G CC.LookupIdx
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
sta (pdata),y
|
|
|
|
|
|
|
|
|
|
>SYSCALL GetMemPtr
|
2022-06-12 20:42:22 +00:00
|
|
|
|
>STYA ZPLookupSymPtr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
* clc
|
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-30 16:29:57 +00:00
|
|
|
|
* "_B"reak
|
|
|
|
|
* "_C"ontinue
|
|
|
|
|
* "_D"efault
|
|
|
|
|
* "_E"lse
|
2023-01-11 18:34:34 +00:00
|
|
|
|
* "_F"rame Size
|
2022-12-30 16:29:57 +00:00
|
|
|
|
* "_J"umpTable
|
|
|
|
|
* "_L"oop
|
2023-01-11 18:34:34 +00:00
|
|
|
|
* "_R"eturn value
|
2022-12-30 16:29:57 +00:00
|
|
|
|
* "_S"statement
|
|
|
|
|
* e"_X"it
|
2022-12-13 06:55:13 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SYM.NewLabelA bit bPass2
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
clc
|
2023-01-06 14:02:35 +00:00
|
|
|
|
.98 rts
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
|
|
|
|
.10 >STA.G CC.Label+1
|
|
|
|
|
|
|
|
|
|
>PUSHB.G CC.hSyms
|
|
|
|
|
>PUSHEA.G CC.Label
|
|
|
|
|
jsr SCOPE.Push
|
|
|
|
|
>SYSCALL SListNewKey
|
2023-01-06 14:02:35 +00:00
|
|
|
|
bcs .98
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
>STYA.G CC.LabelID
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
ldy #CC.LabelBuf+SYM.DefSize
|
|
|
|
|
lda #SYM.Def
|
|
|
|
|
sta (pData),y
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G CC.Label+1
|
|
|
|
|
cmp #'F'
|
|
|
|
|
bne .1
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
jsr SYM.NewLabelF
|
|
|
|
|
bra .7
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.1 cmp #'R'
|
|
|
|
|
bne .6
|
|
|
|
|
|
|
|
|
|
jsr SYM.NewLabelR
|
|
|
|
|
bra .7
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.6 lda #SYM.T.VOID
|
|
|
|
|
>STA.G CC.LabelBuf
|
|
|
|
|
lda #SYM.Q.POINTER
|
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
iny
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda #SYM.SC.STATIC
|
|
|
|
|
sta (pData),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
ldy #CC.LabelBuf+SYM.Addr
|
|
|
|
|
lda ZPCCCode
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
lda ZPCCCode+1
|
|
|
|
|
sta (pData),y
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.7 .DO _DBG_SYM=1
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr SYM.DEBUGNL
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.FIN
|
|
|
|
|
|
|
|
|
|
>PUSHB.G CC.hSyms
|
2023-01-06 14:02:35 +00:00
|
|
|
|
>PUSHW.G CC.LabelID
|
|
|
|
|
>PUSHEA.G CC.LabelBuf
|
2022-12-13 06:55:13 +00:00
|
|
|
|
>PUSHBI 0
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda #SYM.Def
|
2022-12-13 06:55:13 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
>SYSCALL SListAddData
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
.DO _DBG_SYM=1
|
|
|
|
|
bcs .99
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr SYM.DEBUGSL
|
2022-12-23 16:50:50 +00:00
|
|
|
|
.FIN
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
SYM.NewLabelF lda #SYM.T.UCHAR
|
|
|
|
|
>STA.G CC.LabelBuf
|
|
|
|
|
lda #0
|
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
iny
|
|
|
|
|
lda #SYM.SC.AUTO
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
ldy ScopePtr
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
lda (ScopeStk),y #SCOPE.FrameSize
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy #CC.LabelBuf+SYM.Addr
|
|
|
|
|
sta (pData),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SYM.NewLabelR ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #$F8 strip off SYM.Q.FUNC...
|
|
|
|
|
pha
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
lda (ZPSymBufPtr)
|
|
|
|
|
>STA.G CC.LabelBuf
|
|
|
|
|
pla
|
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
iny
|
|
|
|
|
lda #SYM.SC.AUTO
|
|
|
|
|
sta (pData),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-01-22 14:38:20 +00:00
|
|
|
|
* _R : Y,A = T/Q
|
|
|
|
|
* others : X,Y = SYM.Addr
|
|
|
|
|
*--------------------------------------
|
2022-12-07 07:02:29 +00:00
|
|
|
|
SYM.LookupLabelA
|
2023-01-11 18:34:34 +00:00
|
|
|
|
cmp #'R'
|
|
|
|
|
beq .1
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bit bPass2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bmi .1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
ldy #0
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.1 >STA.G CC.Label+1 A = "B"reak, "C"ontinue...
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHB.G CC.hSyms ...for SListGetData
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
lda ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.2 pha
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHB.G CC.hSyms
|
|
|
|
|
>PUSHEA.G CC.Label
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pla
|
|
|
|
|
pha
|
|
|
|
|
jsr SCOPE.PushA
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>SYSCALL SListLookup
|
2023-01-11 18:34:34 +00:00
|
|
|
|
bcc .3
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
pla
|
2022-12-07 07:02:29 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
* sec
|
|
|
|
|
sbc #SCOPE
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.9 inc pStack discard CC.hSyms
|
|
|
|
|
|
|
|
|
|
lda #E.NOKEY
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.3 plx
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
|
|
|
|
>PUSHA KeyID.HI
|
2022-12-07 07:02:29 +00:00
|
|
|
|
tya
|
|
|
|
|
>PUSHA KeyID.LO
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
>PUSHWZ allocate
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>PUSHWI 65535 all
|
|
|
|
|
>PUSHWZ From Start
|
|
|
|
|
>SYSCALL SListGetData
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
phx
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
txa
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPLookupPtr
|
|
|
|
|
|
|
|
|
|
plx
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>LDA.G CC.Label+1
|
|
|
|
|
cmp #'R'
|
|
|
|
|
beq .4
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Addr
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
lda (ZPLookupPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
pha
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
iny
|
2022-12-30 16:29:57 +00:00
|
|
|
|
lda (ZPLookupPtr),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
plx
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.4 ldy #SYM.T return T/Q
|
|
|
|
|
|
|
|
|
|
lda (ZPLookupPtr),y
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
iny #SYM.Q
|
|
|
|
|
lda (ZPLookupPtr),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
ply
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.LookupFree >LDA.G CC.LookupIdx
|
2023-07-16 09:09:23 +00:00
|
|
|
|
beq .9 Never set by CORE.Init
|
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
cmp #CC.LookupIdx
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
lda (pdata),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs .99
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
|
|
|
|
>DEC.G CC.LookupIdx
|
|
|
|
|
cmp #CC.LookupIdx
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
lda (pdata),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPLookupSymPtr
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.9 lda #E.INVH
|
2022-06-22 06:26:44 +00:00
|
|
|
|
* sec
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* ZPPtr2 = expected T/Q
|
|
|
|
|
* ZPLookupSymPtr
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.LookupCheckTQ
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ZPPtr2 target T
|
|
|
|
|
bne .1
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda (ZPLookupSymPtr) SYM.T
|
|
|
|
|
sta ZPPtr2 T
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #$F8 ignore VOLATILE|FUNC|FASTCALL
|
|
|
|
|
sta ZPPtr2+1 Q
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.1 cmp #SYM.T.VOID
|
|
|
|
|
beq .2
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda (ZPLookupSymPtr) SYM.T
|
|
|
|
|
cmp #SYM.T.VOID
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
cmp ZPPtr2 T
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bne .9
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.2 lda ZPPtr2+1 Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #SYM.Q
|
2022-09-04 20:12:49 +00:00
|
|
|
|
eor (ZPLookupSymPtr),y
|
|
|
|
|
and #$F8 ignore VOLATILE|FUNC|FASTCALL
|
2022-10-07 19:21:37 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
and #SYM.Q.AAARRAY is mismatch about array ?
|
|
|
|
|
beq .9 no...
|
|
|
|
|
|
|
|
|
|
lda ZPPtr2+1 Q
|
|
|
|
|
and #SYM.Q.AAARRAY
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bne .9
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.8 clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.9 lda #E.TMISMATCH
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sec
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* on RT stack : Addr,value
|
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
SYM.PopValue jsr SYM.GetYASizeOfInAX
|
2022-09-04 20:12:49 +00:00
|
|
|
|
tax
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>LDYA L.PCC.PopValue1
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.1 cpx #1
|
|
|
|
|
bne .2
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>LDYA L.PCC.PopValue2
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.2 jsr CODE.LDXI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PopValueX
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.9 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* out : Y,A = T/Q
|
|
|
|
|
*--------------------------------------
|
2022-12-30 16:29:57 +00:00
|
|
|
|
SYM.GetTQInYA ldy #SYM.Q
|
2022-01-30 21:47:08 +00:00
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
pha
|
|
|
|
|
lda (ZPSymBufPtr)
|
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
* out : A,X = size
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
SYM.GetSymSizeOfInAX
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
pha
|
|
|
|
|
lda (ZPSymBufPtr) SYM.T
|
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
SYM.GetYASizeOfInAX
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
bit #SYM.Q.PPPOINTER
|
2022-08-20 14:37:37 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
lda #2 pointer
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
sec +1 for hMem Storage
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 bit #SYM.Q.AAARRAY
|
|
|
|
|
bne .2
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
lda CC.TYPESIZE-1,y
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.2 ldx CC.TYPESIZE-1,y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Def
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
|
|
|
|
|
.3 dex
|
|
|
|
|
beq .5
|
|
|
|
|
|
|
|
|
|
.4 lda (pStack),y
|
|
|
|
|
clc
|
|
|
|
|
adc (pStack),y
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
|
|
|
|
|
lda (pStack)
|
|
|
|
|
adc (pStack)
|
|
|
|
|
sta (pStack)
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
.5 >PULLA
|
|
|
|
|
tax
|
|
|
|
|
>PULLA
|
|
|
|
|
|
|
|
|
|
clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-12-30 16:29:57 +00:00
|
|
|
|
* in/out : A,X = size
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.SetSizeOf ldy #SYM.SizeOf
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-12-13 06:55:13 +00:00
|
|
|
|
SYM.SetAddrCCode
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda ZPCCCode
|
|
|
|
|
ldy #SYM.Addr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda ZPCCCode+1
|
|
|
|
|
iny
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sta (ZPSymBufPtr),y
|
|
|
|
|
|
|
|
|
|
rts
|
2022-12-07 07:02:29 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SYM=1
|
2022-12-30 16:29:57 +00:00
|
|
|
|
SYM.DEBUGN >PUSHW L.MSG.DEBUG.SYMN
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHW.G CC.SymID
|
|
|
|
|
jsr SCOPE.Push
|
|
|
|
|
lda (ZPSymBufPtr)
|
|
|
|
|
>PUSHA
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2022-12-30 16:29:57 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHBI 7
|
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
SYM.DEBUGU >PUSHW L.MSG.DEBUG.SYMU
|
|
|
|
|
>PUSHW.G CC.SymID
|
|
|
|
|
lda (ZPSymBufPtr)
|
|
|
|
|
>PUSHA
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>PUSHBI 7
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
rts
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
SYM.DEBUGS >PUSHW L.MSG.DEBUG.SYMS
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHW.G CC.SymID
|
2022-12-23 16:50:50 +00:00
|
|
|
|
lda (ZPSymBufPtr)
|
|
|
|
|
>PUSHA
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2022-12-30 16:29:57 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>PUSHBI 7
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>SYSCALL Printf
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>DEBUG
|
2022-12-07 07:02:29 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
SYM.DEBUGG >PUSHW L.MSG.DEBUG.SYMG
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHW.G CC.SymID
|
2022-12-23 16:50:50 +00:00
|
|
|
|
lda (ZPSymBufPtr)
|
|
|
|
|
>PUSHA
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
2022-12-30 16:29:57 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHBI 5
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
rts
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
|
|
|
|
SYM.DEBUGNL >PUSHW L.MSG.DEBUG.SYMNL
|
|
|
|
|
>PUSHEA.G CC.Label
|
|
|
|
|
>PUSHW.G CC.LabelID
|
|
|
|
|
jsr SCOPE.Push
|
|
|
|
|
ldy #CC.LabelBuf
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHBI 9
|
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
* >DEBUG
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
SYM.DEBUGSL >PUSHW L.MSG.DEBUG.SYMSL
|
|
|
|
|
>PUSHW.G CC.LabelID
|
|
|
|
|
ldy #CC.LabelBuf
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHBI 5
|
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
rts
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.FIN
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.sym
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|