A2osX/BIN/CC.S.DECL.txt
burniouf a5ba00f1a6 SCMASM.SYSTEM & ASM:C-string support (new directives .CS. CZ .PS, updated Notepad++ XML)
CC:Added typedef, struct/union need a KERNEL mod
VEDRIVE:bugfixes, added LanCEGS code (oops ;-)
2022-09-11 21:11:32 +02:00

117 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*--------------------------------------
CC.SCSPEC.AUTO
CC.SCSPEC.REGISTER
CC.SCSPEC.STATIC
CC.SCSPEC.EXTERN
.98 lda #E.CSYN
sec
.99 rts
*--------------------------------------
CC.SCSPEC.TYPEDEF
jsr CC.GetNextCharNB
bcs .98
>LDYA L.CC.TYPEQUAL
jsr CC.LookupID
bcs .98
cpx #4 no const nor volatile
bcc .98
jsr CC.TYPE.Decl
bcs .99
ldx #SYM.SC.TYPEDEF
sec Reset Buffer
jsr CC.SYM.New Y,A=T/Q,storage class TYPEDEF
bcs .99
jsr CC.GetCharNB
bcs .98
cmp #';'
bne .98
jsr CC.GetNextCharNB skip ';'
jmp CC.SYM.Store
.98 lda #E.CSYN
sec
.99
CC.SCSPEC.TYPEDEF.RTS
rts
*--------------------------------------
* X = type qual
*--------------------------------------
CC.DECL jsr CC.TYPE.Decl
bcs CC.SCSPEC.TYPEDEF.RTS
sec Reset Buffer
CC.DECL.YAC ldx #SYM.SC.STATIC Y,A = Type/Qual
bit bLocalScope
bpl .25
bit #SYM.Q.FUNC someone wants to add a local f() ?
bne .98
ldx #SYM.SC.AUTO
.25 jsr CC.SYM.New Y,A=T/Q, add with undef value...
bcs .98 OOM or DUP
.22 jsr CC.GetCharNB
bcs .98
cmp #';'
beq .28
cmp #'{'
bne .26
jsr CC.GetNextCharNB skip '{'
bcs .98
jmp CC.SYM.StoreF
*--------------------------------------
* Initializer
*--------------------------------------
.26 cmp #'=' type var = value ?
bne .98
jsr CC.GetNextCharNB skip '='
bcs .98
jsr CC.SYM.GetTypeInYA expected T/Q
jsr CC.EXP.Eval
bcs .99
jsr CC.SYM.GetAddr1
bcs .99
jsr CC.SYM.GetTypeInYA Y,A = T/Q
jsr CC.SYM.PopValue Set value to this var
.29 bcs .99
.28 jsr CC.SYM.Store
bcs .99
jsr CC.GetCharNB
cmp #';'
bne .98
clc
rts
.98 lda #E.CSYN
sec
.99 rts
*--------------------------------------
MAN
SAVE usr/src/bin/cc.s.decl
LOAD usr/src/bin/cc.s
ASM