mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-17 15:06:49 +00:00
1e404b5bcf
CC:most of it working, many bugs remain DAN2ETH.DRV:broken, lot of debug code included
158 lines
2.3 KiB
Plaintext
158 lines
2.3 KiB
Plaintext
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
|