2022-01-30 21:47:08 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2023-01-22 14:38:20 +00:00
|
|
|
|
F.Decl jsr SCOPE.New function (
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .99
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
lda (ZPSymBufPtr) #SYM.T
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
and #SYM.Q.PPPOINTER+SYM.Q.AAARRAY
|
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
cpy #SYM.T.VOID
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bne .10
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
tax
|
|
|
|
|
beq .11 function is void
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.10 lda #'R'
|
|
|
|
|
jsr SYM.NewLabelA
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.11 jsr CORE.GetNCharNBNL Skip (
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #')' func()
|
|
|
|
|
beq .6
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.1 jsr F.DeclGetTQ
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr2 Save T/Q
|
|
|
|
|
|
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
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
cpy #SYM.T.VARIADIC
|
|
|
|
|
beq .5
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr CC.IsLetter
|
|
|
|
|
bcs .2
|
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
jsr F.NewArg will update LocalPtr,FrameSize
|
2023-01-06 14:02:35 +00:00
|
|
|
|
bcs .99
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
.2 jsr CC.GetCharNB
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
cmp #')'
|
2022-01-30 21:47:08 +00:00
|
|
|
|
beq .6
|
|
|
|
|
|
|
|
|
|
cmp #','
|
|
|
|
|
bne .9
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB Skip ,
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2023-01-06 14:02:35 +00:00
|
|
|
|
.5 jsr CC.GetCharNB
|
|
|
|
|
bcs .9
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
cmp #')'
|
|
|
|
|
bne .9
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.6 jsr SYM.Add0000 definition End
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .99
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNBNL Skip ')'
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #';'
|
|
|
|
|
bne .7
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jsr SCOPE.Close function ();
|
2022-12-13 06:55:13 +00:00
|
|
|
|
bcs .99
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jmp SYM.Update Store this declaration & exit
|
2022-12-30 16:29:57 +00:00
|
|
|
|
|
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.7 cmp #'{'
|
|
|
|
|
bne .9
|
2023-01-31 06:55:01 +00:00
|
|
|
|
|
|
|
|
|
jmp F.Body
|
2022-12-07 07:02:29 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
F.Def >DEBUG
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
F.Body >LDA.G CC.bInitCode
|
2022-12-07 16:09:29 +00:00
|
|
|
|
bmi .1
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
lda #$60 RTS
|
|
|
|
|
jsr CODE.EmitByte Close INIT code
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
lda #$FF
|
|
|
|
|
>STA.G CC.bInitCode
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
|
|
|
|
.1 jsr SYM.SetAddrCCode f() Code starts HERE
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr SYM.Update Store f() Declaration
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
ldy #SYM.SizeOf
|
|
|
|
|
lda (ZPSymBufPtr),y
|
|
|
|
|
beq .2 void f()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
.2 ldy ScopePtr
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
lda (ScopeStk),y #SCOPE.FrameSize
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
jsr CODE.LDAI A = f() ARGS size
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.ENTER
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr CODE.EmitPCC Start Definition
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
|
|
|
|
>STA.G CC.CmdSave
|
|
|
|
|
|
|
|
|
|
jsr STMT.New00
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jsr STMT.SetTypeCP type = {}
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jmp SCOPE.AddLocal function () {
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-13 06:55:13 +00:00
|
|
|
|
F.Def.END lda #'X' define EXIT Label
|
|
|
|
|
jsr SYM.NewLabelA
|
|
|
|
|
bcs .9
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jsr SCOPE.RemLocal function () {}
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
jsr STMT.Close
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
>LDYA L.PCC.LEAVE
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jsr SCOPE.Close function () {};
|
2022-12-13 06:55:13 +00:00
|
|
|
|
bcs .9
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.DeclGetTQ lda (ZPLineBufPtr)
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cmp #'.'
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
ldx #2
|
|
|
|
|
|
|
|
|
|
.1 jsr CC.GetNextChar
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #'.'
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
eor #')'
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.T.VARIADIC Type
|
|
|
|
|
* lda #0 Qual
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.5 jsr SYM.Lookup var or func() ?
|
|
|
|
|
bcs .6
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
ldy #SYM.SC
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
cmp #SYM.SC.TYPEDEF
|
|
|
|
|
bne .9
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp TYPE.GetTQInYA2
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.6 >LDYA L.CC.TYPEQUAL
|
|
|
|
|
jsr CC.LookupID
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp TYPE.GetTQInYA
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
2022-10-07 19:21:37 +00:00
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.NewArg >LDYA.G CC.SymID
|
2022-06-22 06:26:44 +00:00
|
|
|
|
>STYA.G CC.SymIDSave
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
>LEA.G CC.ArgBuf
|
|
|
|
|
>STYA ZPSymBufPtr
|
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr2
|
|
|
|
|
ldx #SYM.SC.AUTO
|
2022-09-11 19:11:32 +00:00
|
|
|
|
sec Reset Buffer
|
2022-12-13 06:55:13 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.New
|
2022-06-22 06:26:44 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
jsr SYM.Store
|
2022-06-22 06:26:44 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDA.G CC.hSymBuf
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPSymBufPtr
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
>LDYA.G CC.SymIDSave
|
|
|
|
|
>STYA.G CC.SymID
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
.9
|
|
|
|
|
F.NewArg.RTS rts
|
2022-06-22 06:26:44 +00:00
|
|
|
|
*--------------------------------------
|
2022-01-30 21:47:08 +00:00
|
|
|
|
* in : ZPSymPtr
|
|
|
|
|
* Y,A = Expected T/Q
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.CallNoRetV ldy #0 no expected T/Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
tya
|
|
|
|
|
clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.HS B0 BCS
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.CallRetV sec
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
ldx ZPPtr1 local : variadic size
|
|
|
|
|
phx
|
|
|
|
|
ldx ZPPtr1+1 local : bRetV
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
ldx ZPPtr2 local : expected T
|
|
|
|
|
phx
|
|
|
|
|
ldx ZPPtr2+1 local : expected Q
|
|
|
|
|
phx
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
>STYA ZPPtr2 T/Q
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ror ZPPtr1+1 bRetV
|
2023-01-31 06:55:01 +00:00
|
|
|
|
bpl .1 no Return value expected....
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
cmp #3+LIBS.MAX
|
|
|
|
|
bcc .1 SYS/FPU/LIB call, no room on stack required
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
>LDYA ZPPtr2
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr EXP.GetYASizeOfInAX
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jsr CODE.AddLocal add room for return value
|
|
|
|
|
bcs F.NewArg.RTS
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
.1 jsr CORE.GetNCharNB skip '('
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .90
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.LookupCheckTQ
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .93
|
2022-08-20 14:37:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
stz ZPPtr1 Reset VARIADIC byte count
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
lda #SYM.Def
|
2022-06-18 06:16:39 +00:00
|
|
|
|
>STA.G CC.LookupSymPtr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.GetTQ get First Arg T/Q
|
2022-01-30 21:47:08 +00:00
|
|
|
|
beq .7 end of list, go check ending ')'
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.3 cpy #SYM.T.VARIADIC
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
lda #0 Expected T/Q = 0 if VARIADIC
|
|
|
|
|
tay
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2022-03-06 22:28:52 +00:00
|
|
|
|
.4 and #$F0 CONST+VOLATILE+FUNC+FASTCALL
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.Eval
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .93
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr EXP.GetYASizeOfInAX
|
2022-01-30 21:47:08 +00:00
|
|
|
|
tax save Sizeof in X
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.GetTQ
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cpy #SYM.T.VARIADIC
|
|
|
|
|
bne .50 if VARIADIC, don't advance to next arg
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
clc make sure pointer only 2 bytes
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1 Add to byte count
|
|
|
|
|
bra .5
|
|
|
|
|
|
2022-06-18 06:16:39 +00:00
|
|
|
|
.50 >LDA.G CC.LookupSymPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #2
|
|
|
|
|
sta (pData),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
.5 jsr CC.GetCharNB
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .90
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
cmp #','
|
|
|
|
|
bne .6
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNBNL Skip ','
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.GetTQ
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bne .3 Another ARG....
|
|
|
|
|
|
|
|
|
|
bra .90 extra args....error
|
|
|
|
|
|
|
|
|
|
.6 cmp #')'
|
|
|
|
|
bne .90
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.GetTQ
|
2022-01-30 21:47:08 +00:00
|
|
|
|
beq .8 no more arg after ')', exit
|
|
|
|
|
|
|
|
|
|
cpy #SYM.T.VARIADIC
|
|
|
|
|
bne .90 missing arg
|
|
|
|
|
|
|
|
|
|
lda ZPPtr1 push VARIADIC byte count
|
|
|
|
|
jsr CODE.PUSHI
|
|
|
|
|
|
|
|
|
|
.7 jsr CC.GetCharNB
|
|
|
|
|
bcs .90
|
|
|
|
|
|
|
|
|
|
cmp #')'
|
|
|
|
|
bne .90
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.8 jsr CORE.GetNCharNB Skip )
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.Call2
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bra .93
|
|
|
|
|
|
|
|
|
|
.90 lda #E.CSYN
|
|
|
|
|
|
|
|
|
|
.92 sec
|
|
|
|
|
|
|
|
|
|
.93 plx
|
|
|
|
|
stx ZPPtr2+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr2
|
|
|
|
|
|
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr1+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr1
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* X = last var size
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.Call2 ldy #SYM.Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #SYM.Q.FASTCALL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Def Get first (only) argument
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.GetTQAtY
|
|
|
|
|
jsr TYPE.SizeOf
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .19
|
|
|
|
|
|
|
|
|
|
jsr CODE.PULLA
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.19 jsr CODE.PULLYA
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.1 jsr F.Call3
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
bit ZPPtr1+1 bRetV
|
|
|
|
|
bmi .5
|
|
|
|
|
|
|
|
|
|
* NO Return Value : call & discard stack if not in Y,A
|
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr2 function T/Q
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr TYPE.SizeOf
|
2022-01-30 21:47:08 +00:00
|
|
|
|
txa
|
|
|
|
|
beq .11 void
|
|
|
|
|
|
|
|
|
|
cpx #3 A or Y,A
|
|
|
|
|
bcc .11
|
|
|
|
|
|
|
|
|
|
.10 jsr CODE.INCPSTACK
|
|
|
|
|
dex
|
|
|
|
|
bne .10
|
|
|
|
|
|
|
|
|
|
.11 clc
|
|
|
|
|
.9 rts
|
|
|
|
|
|
|
|
|
|
* Return Value : call & put result on stack if in Y,A
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.5
|
|
|
|
|
ldy #SYM.Addr+1
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #3+LIBS.MAX
|
|
|
|
|
bcs .8 not a SYS/FPU/LIB call...Ret value on stack
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>LDYA ZPPtr2 function T/Q
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr TYPE.SizeOf
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cpx #3
|
|
|
|
|
bcs .8 leave on stack
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .60
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.PUSHA push ONE byte on stack
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.60 jsr CODE.PUSHYA push TWO bytes on stack
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
.8 >LDYA ZPPtr2 T/Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.Call3 ldy #SYM.Addr+1
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
dey
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
tax
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ply Y=HI,X=LO
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
cpy #1
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp CODE.SYSCALL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
.1 cpy #2
|
|
|
|
|
bne .2
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp CODE.FPUCALL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.2 cpy #3+LIBS.MAX
|
|
|
|
|
bcs .3
|
|
|
|
|
|
|
|
|
|
jmp CODE.LIBCALL
|
|
|
|
|
|
|
|
|
|
.3 lda #$EA NOP
|
2022-06-22 06:26:44 +00:00
|
|
|
|
jsr CODE.EmitByte
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #$EA NOP
|
2022-06-22 06:26:44 +00:00
|
|
|
|
jsr CODE.EmitByte
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
lda #$20 JSR abs
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp CODE.TOABSYX
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
.9 bit bPass2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bmi .91
|
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda #5 leave room for LDX #imm, JSR abs
|
|
|
|
|
clc
|
2022-06-22 06:26:44 +00:00
|
|
|
|
adc ZPCCCode
|
|
|
|
|
sta ZPCCCode
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcc .90
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
inc ZPCCCode+1
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
.90 clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
.91 lda #E.FUNDEF
|
2022-06-12 20:42:22 +00:00
|
|
|
|
sec
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.GetTQ >LDA.G CC.LookupSymPtr
|
2022-06-18 06:16:39 +00:00
|
|
|
|
tay
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
F.GetTQAtY lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
pha
|
|
|
|
|
iny
|
2022-06-18 06:16:39 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ply
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.f
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|