2022-12-07 07:02:29 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
SCOPE.New lda ScopePtr
|
|
|
|
|
tay
|
2023-01-06 22:07:00 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #SCOPE
|
2022-12-07 07:02:29 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
sta ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
dec bLocalScope
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
iny
|
|
|
|
|
iny #SCOPE.LocalPtr
|
|
|
|
|
lda (ScopeStk),y
|
2023-01-06 22:07:00 +00:00
|
|
|
|
pha
|
2023-01-11 18:34:34 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G CC.ScopeID
|
|
|
|
|
* clc
|
|
|
|
|
adc #1
|
|
|
|
|
sta (pData),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
adc #0
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy ScopePtr
|
|
|
|
|
iny
|
|
|
|
|
sta (ScopeStk),y #SCOPE.ID Hi
|
|
|
|
|
txa
|
2023-01-06 22:07:00 +00:00
|
|
|
|
dey
|
2023-01-11 18:34:34 +00:00
|
|
|
|
sta (ScopeStk),y #SCOPE.ID Lo
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
pla
|
|
|
|
|
sta (ScopeStk),y #SCOPE.LocalPtr
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
iny
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ScopeStk),y #SCOPE.FrameSize
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SCOPE=1
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>PUSHW L.MSG.DEBUG.SCIN
|
|
|
|
|
jsr SCOPE.Push
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
lda ScopePtr
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
tay
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>PUSHBI 5
|
|
|
|
|
>SYSCALL PrintF
|
|
|
|
|
* >DEBUG
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.FIN
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.OOH
|
|
|
|
|
sec
|
2023-01-21 21:53:55 +00:00
|
|
|
|
.99
|
2023-01-06 14:02:35 +00:00
|
|
|
|
SCOPE.New.RTS rts
|
2022-12-07 07:02:29 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-22 14:38:20 +00:00
|
|
|
|
SCOPE.AddLocal lda #'F'
|
|
|
|
|
jsr SYM.LookupLabelA
|
|
|
|
|
bcs SCOPE.New.RTS
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
jmp CODE.AddLocal
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SCOPE.RemLocal lda #'F' define FRAME SIZE
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr SYM.NewLabelA
|
|
|
|
|
bcs SCOPE.New.RTS
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
ldy ScopePtr
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
lda (ScopeStk),y #SCOPE.FrameSize
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jmp CODE.RemLocal
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SCOPE.Close .DO _DBG_SCOPE=1
|
2023-01-06 22:07:00 +00:00
|
|
|
|
>PUSHW L.MSG.DEBUG.SCOUT
|
|
|
|
|
jsr SCOPE.Push
|
|
|
|
|
lda ScopePtr
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
tay
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y #SCOPE.LocalPtr
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y #SCOPE.FrameSize
|
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
>PUSHBI 5
|
|
|
|
|
>SYSCALL PrintF
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.FIN
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
lda ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
beq *
|
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #SCOPE
|
|
|
|
|
sta ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
|
|
|
|
inc bLocalScope
|
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SCOPE=1
|
2023-01-06 22:07:00 +00:00
|
|
|
|
>PUSHW L.MSG.DEBUG.SC
|
|
|
|
|
jsr SCOPE.Push
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
lda ScopePtr
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
tay
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y
|
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
>PUSHBI 5
|
|
|
|
|
>SYSCALL PrintF
|
2023-01-11 18:34:34 +00:00
|
|
|
|
* >DEBUG
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.FIN
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
2022-12-07 07:02:29 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-11 18:34:34 +00:00
|
|
|
|
SCOPE.Push lda ScopePtr
|
2022-12-07 07:02:29 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
SCOPE.PushA clc
|
|
|
|
|
adc #SCOPE.ID+1
|
|
|
|
|
tay
|
2023-01-06 22:07:00 +00:00
|
|
|
|
lda (ScopeStk),y
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHA
|
2023-01-06 22:07:00 +00:00
|
|
|
|
dey #SCOPE.ID
|
|
|
|
|
lda (ScopeStk),y
|
2022-12-07 07:02:29 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.scope
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|