2022-01-30 21:47:08 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
DECL.AUTO
|
|
|
|
|
DECL.REGISTER
|
|
|
|
|
DECL.STATIC
|
|
|
|
|
DECL.EXTERN
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
DECL.TYPEDEF jsr CORE.GetNCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
>LDYA L.CC.TYPEQUAL
|
|
|
|
|
jsr CC.LookupID
|
|
|
|
|
bcs .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
cpx #4 no const nor volatile
|
|
|
|
|
bcc .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr TYPE.GetTQInYA
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx #SYM.SC.TYPEDEF
|
|
|
|
|
sec Reset Buffer
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.New Y,A=T/Q,storage class TYPEDEF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
cmp #';'
|
|
|
|
|
bne .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp SYM.Store
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.99 rts
|
2022-09-11 19:11:32 +00:00
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
* X = type qual
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
DECL.X jsr TYPE.GetTQInYA
|
|
|
|
|
bcs .99
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
cpy #SYM.T.SU
|
|
|
|
|
bne .7
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
tax save Q
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
cmp #';' from a tag def
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
jsr CC.IsLetter
|
|
|
|
|
bcs .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.1 clc reuse buffer
|
|
|
|
|
ldy #SYM.T.SU
|
|
|
|
|
txa restore Q
|
|
|
|
|
jsr DECL.YAC
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
cmp #','
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
jsr CORE.GetNCharNBNL
|
|
|
|
|
bcc .1
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
.2 cmp #';' TODO: struct initalizers
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
.8 clc
|
2023-01-21 21:53:55 +00:00
|
|
|
|
rts
|
2022-10-07 19:21:37 +00:00
|
|
|
|
|
|
|
|
|
.98 lda #E.CSYN
|
|
|
|
|
sec
|
2023-01-21 21:53:55 +00:00
|
|
|
|
.99 rts
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.7 sec Reset Buffer
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
DECL.YAC ldx #SYM.SC.STATIC Y,A = Type/Qual
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bit bLocalScope
|
|
|
|
|
bpl .22
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
|
|
|
|
ldx #SYM.SC.AUTO
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.22 jsr SYM.New Y,A=T/Q, X=SC, C=clear/reuse
|
2023-01-06 14:02:35 +00:00
|
|
|
|
bcs .99 OOM or DUP
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.GetTQInYA Y,A = T/Q
|
|
|
|
|
bit #SYM.Q.FUNC
|
2023-01-21 21:53:55 +00:00
|
|
|
|
bne .8
|
2022-12-30 16:29:57 +00:00
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
cmp #';' no initializer...store SYM
|
|
|
|
|
beq .28
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
cmp #'=' type var = value ?
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .98
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip '='
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .98
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.GetTQInYA expected T/Q
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.Eval
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.GetAddr1
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.GetTQInYA Y,A = T/Q
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.PopValue Set value to this var
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.29 bcs .99
|
2022-02-06 17:14:18 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.28 jsr SYM.Store
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
cmp #';'
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bne .98
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.8 clc
|
2022-02-06 17:14:18 +00:00
|
|
|
|
rts
|
2022-02-04 14:57:17 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.98 lda #E.CSYN
|
2022-02-04 14:57:17 +00:00
|
|
|
|
sec
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.decl
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|