A2osX/BIN/CC.S.SCOPE.txt
burniouf 1e404b5bcf KERNEL:IRQ mode for IIgs (not yet preemptive)
CC:most of it working, many bugs remain
DAN2ETH.DRV:broken, lot of debug code included
2023-01-11 19:34:34 +01:00

158 lines
2.3 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
*--------------------------------------
SCOPE.New lda ScopePtr
tay
clc
adc #SCOPE
bcs .9
sta ScopePtr
dec bLocalScope
iny
iny #SCOPE.LocalPtr
lda (ScopeStk),y
pha
>LDA.G CC.ScopeID
* clc
adc #1
sta (pData),y
tax
iny
lda (pData),y
adc #0
ldy ScopePtr
iny
sta (ScopeStk),y #SCOPE.ID Hi
txa
dey
sta (ScopeStk),y #SCOPE.ID Lo
iny
iny
pla
sta (ScopeStk),y #SCOPE.LocalPtr
iny
lda #0
sta (ScopeStk),y #SCOPE.FrameSize
lda #'F'
jsr SYM.LookupLabelA
bcs .99
txa
jsr CODE.AddLocal
bcs .99
.DO _DBG_SCOPE=1
>PUSHW L.MSG.DEBUG.SCIN
jsr SCOPE.Push
lda ScopePtr
>PUSHA
tay
iny
iny
>PUSHB (ScopeStk),y
iny
>PUSHB (ScopeStk),y
>PUSHBI 5
>SYSCALL PrintF
* >DEBUG
.FIN
clc
rts
.9 lda #E.OOH
sec
.99
SCOPE.New.RTS rts
*--------------------------------------
SCOPE.Close lda #'F' define FRAME SIZE
jsr SYM.NewLabelA
bcs SCOPE.New.RTS
ldy ScopePtr
iny
iny
iny
lda (ScopeStk),y #SCOPE.FrameSize
jsr CODE.RemLocal
bcs SCOPE.New.RTS
.DO _DBG_SCOPE=1
>PUSHW L.MSG.DEBUG.SCOUT
jsr SCOPE.Push
lda ScopePtr
>PUSHA
tay
iny
iny
>PUSHB (ScopeStk),y #SCOPE.LocalPtr
iny
>PUSHB (ScopeStk),y #SCOPE.FrameSize
>PUSHBI 5
>SYSCALL PrintF
.FIN
lda ScopePtr
beq *
sec
sbc #SCOPE
sta ScopePtr
inc bLocalScope
.DO _DBG_SCOPE=1
>PUSHW L.MSG.DEBUG.SC
jsr SCOPE.Push
lda ScopePtr
>PUSHA
tay
iny
iny
>PUSHB (ScopeStk),y
iny
>PUSHB (ScopeStk),y
>PUSHBI 5
>SYSCALL PrintF
* >DEBUG
.FIN
clc
.99 rts
*--------------------------------------
SCOPE.Push lda ScopePtr
SCOPE.PushA clc
adc #SCOPE.ID+1
tay
lda (ScopeStk),y
>PUSHA
dey #SCOPE.ID
lda (ScopeStk),y
>PUSHA
rts
*--------------------------------------
MAN
SAVE usr/src/bin/cc.s.scope
LOAD usr/src/bin/cc.s
ASM