mirror of
https://github.com/A2osX/A2osX.git
synced 2024-08-10 16:29:28 +00:00
Work In Progress (ASM)
This commit is contained in:
parent
adc8ad9630
commit
27c265a290
@ -14,22 +14,33 @@ AUTO 6
|
|||||||
* * = PC
|
* * = PC
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
EXP.Eval stz EXP.Operator
|
EXP.Eval stz EXP.Operator
|
||||||
|
|
||||||
EXP.Eval.Next jsr SRC.GetCharNB
|
|
||||||
bne .13
|
|
||||||
|
|
||||||
lda #ERR.MISSING.EXP
|
stz EXP.Modifier
|
||||||
|
|
||||||
|
jsr SRC.GetCharNB
|
||||||
|
beq EXP.Eval.Missing
|
||||||
|
|
||||||
|
jsr SRC.IsMODReserved
|
||||||
|
bcs EXP.Eval.Next1
|
||||||
|
|
||||||
|
stx EXP.Modifier
|
||||||
|
bra EXP.Eval.Next
|
||||||
|
|
||||||
|
EXP.Eval.Missing lda #ERR.MISSING.EXP
|
||||||
sec
|
sec
|
||||||
.14 rts
|
rts
|
||||||
|
|
||||||
.13 cmp #'.' Local Label?
|
EXP.Eval.Next jsr SRC.GetCharUC
|
||||||
|
beq EXP.Eval.Missing
|
||||||
|
|
||||||
|
EXP.Eval.Next1 cmp #'.' Local Label?
|
||||||
bne .12
|
bne .12
|
||||||
|
|
||||||
jsr EXP.GetLocal
|
jsr EXP.GetLocal
|
||||||
bcs .14
|
bcs .14
|
||||||
|
|
||||||
jmp EXP.EvalOperator
|
jmp EXP.EvalOperator
|
||||||
|
.14 rts
|
||||||
|
|
||||||
.12 cmp #'*'
|
.12 cmp #'*'
|
||||||
bne .10
|
bne .10
|
||||||
@ -42,8 +53,8 @@ EXP.Eval.Next jsr SRC.GetCharNB
|
|||||||
dey
|
dey
|
||||||
dex
|
dex
|
||||||
bpl .11
|
bpl .11
|
||||||
|
|
||||||
bra EXP.EvalOperator
|
jmp EXP.EvalOperator
|
||||||
|
|
||||||
.10 jsr SRC.IsDigit10 Decimal constant ?
|
.10 jsr SRC.IsDigit10 Decimal constant ?
|
||||||
bcs .1
|
bcs .1
|
||||||
@ -132,7 +143,7 @@ EXP.EvalOperator lda EXP.Operator
|
|||||||
beq EXP.EvalExitOK1
|
beq EXP.EvalExitOK1
|
||||||
|
|
||||||
cmp #' '
|
cmp #' '
|
||||||
beq EXP.EvalExitOK1
|
beq EXP.EvalExitOK
|
||||||
|
|
||||||
jsr SRC.IsAMReserved
|
jsr SRC.IsAMReserved
|
||||||
bcc EXP.EvalExitOK
|
bcc EXP.EvalExitOK
|
||||||
@ -149,9 +160,6 @@ EXP.EvalOperator lda EXP.Operator
|
|||||||
bpl .8
|
bpl .8
|
||||||
|
|
||||||
jmp EXP.Eval.Next
|
jmp EXP.Eval.Next
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
EXP.GetLocal jsr SRC.GetDecimal
|
EXP.GetLocal jsr SRC.GetDecimal
|
||||||
bcs EXP.EvalExitSYN
|
bcs EXP.EvalExitSYN
|
||||||
@ -200,7 +208,12 @@ EXP.GetSymbol >LDYA L.SRC.ELabel.Len
|
|||||||
EXP.Compute dec
|
EXP.Compute dec
|
||||||
asl
|
asl
|
||||||
tax
|
tax
|
||||||
|
* ldy #ASM.PASS
|
||||||
|
* lda (pData),y pass#2?
|
||||||
|
* beq .8
|
||||||
jmp (J.EXP.OP,x)
|
jmp (J.EXP.OP,x)
|
||||||
|
.8 clc
|
||||||
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
EXP.Compute.EOR
|
EXP.Compute.EOR
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
|
@ -5,6 +5,66 @@ INC 1
|
|||||||
AUTO 6
|
AUTO 6
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
|
SRC.PrintLine ldy #ASM.MACRO.ON
|
||||||
|
lda (pData),y
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
ldy #ASM.LI.CON
|
||||||
|
lda (pData),y
|
||||||
|
bpl .9
|
||||||
|
bmi .8
|
||||||
|
|
||||||
|
.1 ldy #ASM.LI.ON
|
||||||
|
lda (pData),y
|
||||||
|
bpl .9
|
||||||
|
|
||||||
|
.8 >PUSHWI TmpBuffer256
|
||||||
|
>PUSHW SRC.LINENUM
|
||||||
|
ldy #ASM.PC+1
|
||||||
|
>PUSHB (pData),y
|
||||||
|
dey
|
||||||
|
>PUSHB (pData),y
|
||||||
|
>PUSHW L.MSG.SRCLINE
|
||||||
|
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
||||||
|
.9 rts
|
||||||
|
*---------------------------------------
|
||||||
|
SRC.PrintLineErr ldx #0
|
||||||
|
.1 lda TmpBuffer256,x
|
||||||
|
beq .2
|
||||||
|
phx
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
plx
|
||||||
|
inx
|
||||||
|
bcc .1
|
||||||
|
rts
|
||||||
|
|
||||||
|
.2 lda #13
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
.3 lda TmpBuffer256,x
|
||||||
|
beq .5
|
||||||
|
inx
|
||||||
|
cpx SRC.BufPtr
|
||||||
|
beq .4
|
||||||
|
phx
|
||||||
|
lda #'-'
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
plx
|
||||||
|
bcs .9
|
||||||
|
bra .3
|
||||||
|
|
||||||
|
.4 lda #'^'
|
||||||
|
phx
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
plx
|
||||||
|
bcs .9
|
||||||
|
|
||||||
|
.5 lda #13
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
.9 rts
|
||||||
|
*---------------------------------------
|
||||||
SRC.ParseLine ldx TmpBuffer256
|
SRC.ParseLine ldx TmpBuffer256
|
||||||
beq .1
|
beq .1
|
||||||
|
|
||||||
@ -59,40 +119,37 @@ SRC.ParseLine ldx TmpBuffer256
|
|||||||
SRC.ParseLine.Ok lda SRC.GLabel.New
|
SRC.ParseLine.Ok lda SRC.GLabel.New
|
||||||
bpl .8
|
bpl .8
|
||||||
|
|
||||||
|
ldy #ASM.PASS
|
||||||
|
lda (pData),y pass#2?
|
||||||
|
bne .8 yes, nothing to do
|
||||||
|
* --- Pass #1
|
||||||
>LDYA L.SRC.GLabel.Flags
|
>LDYA L.SRC.GLabel.Flags
|
||||||
jsr SYM.SearchGlobal
|
jsr SYM.SearchGlobal
|
||||||
bcs .1 if CS, not found, add
|
bcs .1 if CS, not found, add
|
||||||
|
|
||||||
lda SRC.FLabel.Flags
|
lda SRC.FLabel.Flags
|
||||||
and SRC.GLabel.Flags
|
bit #$40 found symbol pending ?
|
||||||
lsr both are .SE ?
|
bne .2 yes, update
|
||||||
bcs .1 yes, update during pass 1 & 2
|
|
||||||
|
bit #$1 found is .SE ?
|
||||||
|
beq SRC.ParseLine.Redef no, redefine error
|
||||||
|
|
||||||
lda SRC.FLabel.Flags
|
.2 ldx #0 update current symbol with
|
||||||
and #$40 found symbol pending ?
|
.3 lda SRC.GLabel.Flags flags & value
|
||||||
bne .10
|
jsr SYM.AddByteGBlock
|
||||||
|
inx
|
||||||
lda SRC.GLabel.Flags
|
cpx #5
|
||||||
and #$40 new is pending ? (if yes, no need to update)
|
bne .3
|
||||||
bne .8
|
bra .8
|
||||||
|
|
||||||
.10 ldy #ASM.PASS
|
|
||||||
lda (pData),y pass#2?
|
|
||||||
beq .1 yes, skip to avoid redefinition error
|
|
||||||
|
|
||||||
lda SRC.FLabel.Flags
|
|
||||||
and #$40
|
|
||||||
beq SRC.ParseLine.Redef
|
|
||||||
|
|
||||||
.1 >LDYA L.SRC.GLabel.Flags
|
.1 >LDYA L.SRC.GLabel.Flags
|
||||||
jsr SYM.AddGToGBlockYA
|
jsr SYM.AddGToGBlockYA
|
||||||
bcs SRC.ParseLine.Err
|
bcs SRC.ParseLine.Err
|
||||||
|
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
SRC.ParseLine.Err1 lda #ERR.INVALID.LABEL
|
SRC.ParseLine.Inv lda #ERR.INVALID.LABEL
|
||||||
SRC.ParseLine.Err sec
|
SRC.ParseLine.Err sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -202,9 +259,10 @@ SRC.ParseLine.Add.Macro
|
|||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.ParseLine.OpCode
|
SRC.ParseLine.OpCode
|
||||||
jsr SRC.GetArg
|
jsr SRC.GetArg
|
||||||
bcs .9
|
bcc .11
|
||||||
|
rts
|
||||||
|
|
||||||
ldy #ASM.T.hMem
|
.11 ldy #ASM.T.hMem
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL SYS.GetMemPtrA
|
>SYSCALL SYS.GetMemPtrA
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
@ -252,7 +310,7 @@ SRC.ParseLine.OpCode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bcs *
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -261,8 +319,22 @@ SRC.ParseLine.OpCode
|
|||||||
|
|
||||||
|
|
||||||
bcs .99
|
bcs .99
|
||||||
|
bcc .20
|
||||||
|
ldx SRC.AM.StrBuf
|
||||||
|
beq .20
|
||||||
|
ldx #0
|
||||||
|
.21 inx
|
||||||
|
lda SRC.AM.StrBuf,x
|
||||||
|
phx
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
plx
|
||||||
|
cpx SRC.AM.StrBuf
|
||||||
|
bne .21
|
||||||
|
lda #13
|
||||||
|
>SYSCALL SYS.CoutA
|
||||||
|
|
||||||
ldy #ASM.PC
|
|
||||||
|
.20 ldy #ASM.PC
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
inc
|
inc
|
||||||
sta (pData),y
|
sta (pData),y
|
||||||
@ -310,11 +382,19 @@ SRC.ParseLine.AM stz SRC.AM.ID
|
|||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.2 jsr SRC.IsLetter Any register?
|
.2 jsr SRC.IsMODReserved
|
||||||
|
bcs .21
|
||||||
|
lda #'#'
|
||||||
|
inc SRC.AM.StrBuf
|
||||||
|
ldx SRC.AM.StrBuf
|
||||||
|
sta SRC.AM.StrBuf,x
|
||||||
|
bra .1
|
||||||
|
|
||||||
|
.21 jsr SRC.IsLetter Any register?
|
||||||
bcs .70 no, try something else
|
bcs .70 no, try something else
|
||||||
|
|
||||||
lda SRC.BufPtr
|
ldx SRC.BufPtr
|
||||||
sta SRC.BufPtrSave
|
stx SRC.BufPtrSave
|
||||||
|
|
||||||
stz SRC.AM.tmpBuf
|
stz SRC.AM.tmpBuf
|
||||||
sta SRC.AM.tmpBuf+1
|
sta SRC.AM.tmpBuf+1
|
||||||
@ -323,7 +403,7 @@ SRC.ParseLine.AM stz SRC.AM.ID
|
|||||||
.3 jsr SRC.GetCharUC
|
.3 jsr SRC.GetCharUC
|
||||||
beq .41
|
beq .41
|
||||||
jsr SRC.IsLetterOrDigit
|
jsr SRC.IsLetterOrDigit
|
||||||
bne .4
|
bcs .4
|
||||||
inc SRC.AM.tmpBuf
|
inc SRC.AM.tmpBuf
|
||||||
ldx SRC.AM.tmpBuf
|
ldx SRC.AM.tmpBuf
|
||||||
sta SRC.AM.tmpBuf,x
|
sta SRC.AM.tmpBuf,x
|
||||||
@ -336,8 +416,8 @@ SRC.ParseLine.AM stz SRC.AM.ID
|
|||||||
.5 lda (ZPPtr3),y
|
.5 lda (ZPPtr3),y
|
||||||
beq .71 last register ?
|
beq .71 last register ?
|
||||||
|
|
||||||
ldx #$ff
|
|
||||||
phy
|
phy
|
||||||
|
ldx #$ff
|
||||||
|
|
||||||
.6 lda (ZPPtr3),y
|
.6 lda (ZPPtr3),y
|
||||||
iny
|
iny
|
||||||
@ -361,7 +441,7 @@ SRC.ParseLine.AM stz SRC.AM.ID
|
|||||||
bne .61
|
bne .61
|
||||||
|
|
||||||
stx SRC.AM.StrBuf
|
stx SRC.AM.StrBuf
|
||||||
bra .72
|
jmp .1
|
||||||
|
|
||||||
.7 ply
|
.7 ply
|
||||||
tya
|
tya
|
||||||
@ -376,9 +456,23 @@ SRC.ParseLine.AM stz SRC.AM.ID
|
|||||||
.70 dec SRC.BufPtr back one char
|
.70 dec SRC.BufPtr back one char
|
||||||
|
|
||||||
jsr EXP.Eval
|
jsr EXP.Eval
|
||||||
bcs *
|
|
||||||
bcs .99
|
bcs .99
|
||||||
.72 jmp .1
|
|
||||||
|
ldx #3
|
||||||
|
.73 lda SRC.ACC,x
|
||||||
|
bne .72
|
||||||
|
dex
|
||||||
|
bne .73
|
||||||
|
|
||||||
|
.72 inx
|
||||||
|
txa
|
||||||
|
ora #$30
|
||||||
|
inc SRC.AM.StrBuf
|
||||||
|
ldx SRC.AM.StrBuf
|
||||||
|
sta SRC.AM.StrBuf,x
|
||||||
|
|
||||||
|
jmp .1
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -388,31 +482,6 @@ SRC.ParseLine.AM stz SRC.AM.ID
|
|||||||
sec
|
sec
|
||||||
.99 rts
|
.99 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.PrintLine bcs .8 if CS, unconditional
|
|
||||||
|
|
||||||
ldy #ASM.MACRO.ON
|
|
||||||
lda (pData),y
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
ldy #ASM.LI.CON
|
|
||||||
lda (pData),y
|
|
||||||
bpl .9
|
|
||||||
bmi .8
|
|
||||||
|
|
||||||
.1 ldy #ASM.LI.ON
|
|
||||||
lda (pData),y
|
|
||||||
bpl .9
|
|
||||||
|
|
||||||
.8 >PUSHWI TmpBuffer256
|
|
||||||
>PUSHW SRC.LINENUM
|
|
||||||
ldy #ASM.PC+1
|
|
||||||
>PUSHB (pData),y
|
|
||||||
dey
|
|
||||||
>PUSHB (pData),y
|
|
||||||
>PUSHW L.MSG.SRCLINE
|
|
||||||
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
||||||
.9 rts
|
|
||||||
*---------------------------------------
|
|
||||||
SRC.GetDecimal stz SRC.ACC+1
|
SRC.GetDecimal stz SRC.ACC+1
|
||||||
stz SRC.ACC+2
|
stz SRC.ACC+2
|
||||||
stz SRC.ACC+3
|
stz SRC.ACC+3
|
||||||
@ -427,7 +496,7 @@ SRC.GetDecimal stz SRC.ACC+1
|
|||||||
.1 jsr SRC.GetChar
|
.1 jsr SRC.GetChar
|
||||||
beq .8
|
beq .8
|
||||||
cmp #' '
|
cmp #' '
|
||||||
beq .8
|
beq .88
|
||||||
jsr SRC.IsEXPReserved
|
jsr SRC.IsEXPReserved
|
||||||
bcc .88
|
bcc .88
|
||||||
jsr SRC.IsAMReserved
|
jsr SRC.IsAMReserved
|
||||||
@ -478,7 +547,7 @@ SRC.GetHex stz SRC.ACC+1
|
|||||||
.1 jsr SRC.GetChar
|
.1 jsr SRC.GetChar
|
||||||
beq .8
|
beq .8
|
||||||
cmp #' '
|
cmp #' '
|
||||||
beq .8
|
beq .88
|
||||||
jsr SRC.IsEXPReserved
|
jsr SRC.IsEXPReserved
|
||||||
bcc .88
|
bcc .88
|
||||||
jsr SRC.IsAMReserved
|
jsr SRC.IsAMReserved
|
||||||
@ -524,7 +593,7 @@ SRC.GetOctal stz SRC.ACC+1
|
|||||||
.1 jsr SRC.GetChar
|
.1 jsr SRC.GetChar
|
||||||
beq .8
|
beq .8
|
||||||
cmp #' '
|
cmp #' '
|
||||||
beq .8
|
beq .88
|
||||||
jsr SRC.IsEXPReserved
|
jsr SRC.IsEXPReserved
|
||||||
bcc .88
|
bcc .88
|
||||||
jsr SRC.IsAMReserved
|
jsr SRC.IsAMReserved
|
||||||
@ -577,7 +646,7 @@ SRC.GetBinary stz SRC.ACC+1
|
|||||||
.1 jsr SRC.GetChar
|
.1 jsr SRC.GetChar
|
||||||
beq .8
|
beq .8
|
||||||
cmp #' '
|
cmp #' '
|
||||||
beq .8
|
beq .88
|
||||||
jsr SRC.IsEXPReserved
|
jsr SRC.IsEXPReserved
|
||||||
bcc .88
|
bcc .88
|
||||||
jsr SRC.IsAMReserved
|
jsr SRC.IsAMReserved
|
||||||
@ -609,9 +678,10 @@ SRC.GetBinary stz SRC.ACC+1
|
|||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.GetLabel >STYA ZPPtr1
|
SRC.GetLabel >STYA ZPPtr1
|
||||||
|
|
||||||
jsr SRC.GetCharUC
|
jsr SRC.GetCharUC
|
||||||
|
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
jsr SRC.IsLetter
|
jsr SRC.IsLetter
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
@ -621,31 +691,29 @@ SRC.GetLabel >STYA ZPPtr1
|
|||||||
.1 jsr SRC.GetCharUC
|
.1 jsr SRC.GetCharUC
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
cmp #' '
|
jsr SRC.IsLetterOrDigit
|
||||||
beq .8
|
bcc .2
|
||||||
|
|
||||||
cmp #'.'
|
cmp #'.'
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
cmp #'_'
|
cmp #'_'
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
|
cmp #' '
|
||||||
|
beq .88
|
||||||
jsr SRC.IsEXPReserved
|
jsr SRC.IsEXPReserved
|
||||||
bcc .88
|
bcc .88
|
||||||
jsr SRC.IsAMReserved
|
jsr SRC.IsAMReserved
|
||||||
bcc .88
|
bcc .88
|
||||||
jsr SRC.IsLetterOrDigit
|
|
||||||
bcs *
|
.9 lda #ERR.SYNTAX.ERROR
|
||||||
* bcs .9
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
.2 iny
|
.2 iny
|
||||||
sta (ZPPtr1),y
|
sta (ZPPtr1),y
|
||||||
cpy #SRC.GLABEL.MAXLEN
|
cpy #SRC.GLABEL.MAXLEN
|
||||||
bcc .1 if equ Carry is set
|
bcc .1 if equ Carry is set
|
||||||
|
|
||||||
.9 lda #ERR.SYNTAX.ERROR
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
.88 dec SRC.BufPtr Back One Char
|
.88 dec SRC.BufPtr Back One Char
|
||||||
.8 tya
|
.8 tya
|
||||||
@ -727,6 +795,16 @@ SRC.IsAMReserved ldx SRC.AM.RESERVED
|
|||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
|
SRC.IsMODReserved ldx SRC.MOD.RESERVED
|
||||||
|
.1 cmp SRC.MOD.RESERVED,x
|
||||||
|
beq .8
|
||||||
|
dex
|
||||||
|
bne .1
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
.8 clc
|
||||||
|
rts
|
||||||
|
*---------------------------------------
|
||||||
SRC.IsEXPReserved ldx SRC.EXP.RESERVED
|
SRC.IsEXPReserved ldx SRC.EXP.RESERVED
|
||||||
.1 cmp SRC.EXP.RESERVED,x
|
.1 cmp SRC.EXP.RESERVED,x
|
||||||
beq .8
|
beq .8
|
||||||
@ -804,7 +882,6 @@ SRC.GetChar ldx SRC.BufPtr
|
|||||||
lda TmpBuffer256,x
|
lda TmpBuffer256,x
|
||||||
beq .9
|
beq .9
|
||||||
inc SRC.BufPtr if 255, will make Z
|
inc SRC.BufPtr if 255, will make Z
|
||||||
and #$7f Make sure NZ
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.ACC10 lda SRC.ACC ACC*2-> ACC & ACCTMP
|
SRC.ACC10 lda SRC.ACC ACC*2-> ACC & ACCTMP
|
||||||
|
@ -133,33 +133,6 @@ SYM.Dump >PUSHW L.MSG.SYMBOLS
|
|||||||
jmp .1
|
jmp .1
|
||||||
.9 rts
|
.9 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SYM.DumpGSymbol.DELETE >SYSCALL SYS.CoutA
|
|
||||||
lda ZPSymbolPtr
|
|
||||||
clc
|
|
||||||
adc #5
|
|
||||||
tay
|
|
||||||
lda ZPSymbolPtr+1
|
|
||||||
adc #0
|
|
||||||
>PUSHYA
|
|
||||||
|
|
||||||
ldy #2
|
|
||||||
lda (ZPSymbolPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPSymbolPtr),y
|
|
||||||
>PUSHA
|
|
||||||
ldy #4
|
|
||||||
lda (ZPSymbolPtr),y
|
|
||||||
>PUSHA
|
|
||||||
dey
|
|
||||||
lda (ZPSymbolPtr),y
|
|
||||||
>PUSHA
|
|
||||||
|
|
||||||
>PUSHW L.MSG.GSYMBOL
|
|
||||||
>LIBCALL hLIBSTR,LIBSTR.PRINTF
|
|
||||||
|
|
||||||
rts
|
|
||||||
*---------------------------------------
|
|
||||||
SYM.AddPrivate
|
SYM.AddPrivate
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
@ -188,7 +161,14 @@ SYM.SearchGlobal >STYA ZPSymbolPtr
|
|||||||
|
|
||||||
jsr SYM.ResetGBlockPtr
|
jsr SYM.ResetGBlockPtr
|
||||||
|
|
||||||
.1 jsr SYM.GetByteGBlock Get Flags
|
.1 ldy #SYM.iCurGBlock
|
||||||
|
lda (pData),y
|
||||||
|
sta SYM.iCurGBlock.Save
|
||||||
|
ldy #SYM.pCurGBlock
|
||||||
|
lda (pData),y
|
||||||
|
sta SYM.pCurGBlock.Save
|
||||||
|
|
||||||
|
jsr SYM.GetByteGBlock Get Flags
|
||||||
beq .9
|
beq .9
|
||||||
sta SRC.FLabel.Flags
|
sta SRC.FLabel.Flags
|
||||||
|
|
||||||
@ -221,8 +201,14 @@ SYM.SearchGlobal >STYA ZPSymbolPtr
|
|||||||
cpx SRC.FLabel.Len
|
cpx SRC.FLabel.Len
|
||||||
bne .4
|
bne .4
|
||||||
|
|
||||||
clc
|
lda SYM.pCurGBlock.Save
|
||||||
rts
|
ldy #SYM.pCurGBlock
|
||||||
|
sta (pData),y
|
||||||
|
|
||||||
|
lda SYM.iCurGBlock.Save
|
||||||
|
ldy #SYM.iCurGBlock
|
||||||
|
sta (pData),y
|
||||||
|
jmp SYM.GetGBlockA
|
||||||
|
|
||||||
.5 jsr SYM.GetByteGBlock skip Locals
|
.5 jsr SYM.GetByteGBlock skip Locals
|
||||||
beq .1
|
beq .1
|
||||||
@ -280,16 +266,6 @@ SYM.AddLToGBlock jsr SYM.SetGBlockPtr
|
|||||||
jmp SYM.AddByteGBlock
|
jmp SYM.AddByteGBlock
|
||||||
.9 rts
|
.9 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SYM.ResetGBlockPtr lda #0
|
|
||||||
jsr SYM.GetGBlockA
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
ldy #SYM.pCurGBlock
|
|
||||||
sta (pData),y
|
|
||||||
ldy #SYM.iCurGBlock
|
|
||||||
sta (pData),y
|
|
||||||
rts
|
|
||||||
*---------------------------------------
|
|
||||||
SYM.GetByteGBlock ldy #SYM.iCurGBlock
|
SYM.GetByteGBlock ldy #SYM.iCurGBlock
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
tay
|
tay
|
||||||
@ -312,6 +288,13 @@ SYM.GetByteGBlock ldy #SYM.iCurGBlock
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
|
SYM.ResetGBlockPtr lda #0
|
||||||
|
ldy #SYM.pCurGBlock
|
||||||
|
sta (pData),y
|
||||||
|
ldy #SYM.iCurGBlock
|
||||||
|
sta (pData),y
|
||||||
|
bra SYM.GetGBlockA
|
||||||
|
*---------------------------------------
|
||||||
SYM.SetGBlockPtr ldy #SYM.pLastGBlock
|
SYM.SetGBlockPtr ldy #SYM.pLastGBlock
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ CS.RUN ldy #bCANCEL
|
|||||||
.99 sec
|
.99 sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.2 jsr SRC.PrintLine with CC, conditional
|
.2 jsr SRC.PrintLine
|
||||||
|
|
||||||
jsr SRC.ParseLine
|
jsr SRC.ParseLine
|
||||||
bcs .9
|
bcs .9
|
||||||
@ -250,8 +250,7 @@ CS.RUN ldy #bCANCEL
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
.9 pha
|
.9 pha
|
||||||
sec
|
jsr SRC.PrintLineErr
|
||||||
jsr SRC.PrintLine with CS, print always
|
|
||||||
pla
|
pla
|
||||||
pha
|
pha
|
||||||
>PUSHA
|
>PUSHA
|
||||||
@ -435,7 +434,7 @@ MSG.SYMBOLS >CSTRING "Symbol Table:\n"
|
|||||||
MSG.GSYMBOL >CSTRING "$%H%H:%S"
|
MSG.GSYMBOL >CSTRING "$%H%H:%S"
|
||||||
MSG.LSYMBOL >CSTRING " .%d:+$%h"
|
MSG.LSYMBOL >CSTRING " .%d:+$%h"
|
||||||
MSG.SUMMARY >CSTRING "\nEnd Of Assembly.\n"
|
MSG.SUMMARY >CSTRING "\nEnd Of Assembly.\n"
|
||||||
SRC.AM.RESERVED >PSTRING "[]#(),"
|
SRC.AM.RESERVED >PSTRING "[](),"
|
||||||
SRC.MOD.RESERVED >PSTRING "#/<>"
|
SRC.MOD.RESERVED >PSTRING "#/<>"
|
||||||
SRC.EXP.RESERVED >PSTRING "^!|&<=>+-*/"
|
SRC.EXP.RESERVED >PSTRING "^!|&<=>+-*/"
|
||||||
ASM.T.DEFAULT .AS ".T.6502"
|
ASM.T.DEFAULT .AS ".T.6502"
|
||||||
@ -447,6 +446,10 @@ FIO.hFileName .BS 1
|
|||||||
FIO.hFullPath .BS 1
|
FIO.hFullPath .BS 1
|
||||||
|
|
||||||
EXP.Operator .BS 1
|
EXP.Operator .BS 1
|
||||||
|
EXP.Modifier .BS 1
|
||||||
|
|
||||||
|
SYM.iCurGBlock.Save .BS 1
|
||||||
|
SYM.pCurGBlock.Save .BS 1
|
||||||
|
|
||||||
SRC.LINENUM .BS 2
|
SRC.LINENUM .BS 2
|
||||||
SRC.Directive.ID .BS 1
|
SRC.Directive.ID .BS 1
|
||||||
@ -461,7 +464,6 @@ SRC.Exp .BS 128
|
|||||||
SRC.BufPtr .BS 1
|
SRC.BufPtr .BS 1
|
||||||
SRC.BufPtrSave .BS 1
|
SRC.BufPtrSave .BS 1
|
||||||
SRC.Buffer .BS 256
|
SRC.Buffer .BS 256
|
||||||
*--------------------------------------
|
|
||||||
SRC.GLabel.New .BS 1
|
SRC.GLabel.New .BS 1
|
||||||
SRC.GLabel.Flags .BS 1
|
SRC.GLabel.Flags .BS 1
|
||||||
SRC.GLabel.Value .BS 4
|
SRC.GLabel.Value .BS 4
|
||||||
@ -536,9 +538,9 @@ ASM.LI.XON .BS 1
|
|||||||
ASM.PC .BS 4
|
ASM.PC .BS 4
|
||||||
ASM.PC.PH .BS 4
|
ASM.PC.PH .BS 4
|
||||||
ASM.PC.GLABEL .BS 4
|
ASM.PC.GLABEL .BS 4
|
||||||
ASM.LOCAL.OFFSET .BS 1 Store local offset from last Global Symbol for local (.xx)
|
ASM.LOCAL.OFFSET .BS 1
|
||||||
ASM.LOCAL.INVALID .BS 1 If not in global or offset out of range this flag is set
|
ASM.LOCAL.INVALID .BS 1
|
||||||
ASM.SYM.ID .BS 2 For reference when a local label is parsed
|
ASM.SYM.ID .BS 2
|
||||||
DS.END .ED
|
DS.END .ED
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
.DO DS.END-DS.START>$FF
|
.DO DS.END-DS.START>$FF
|
||||||
|
Loading…
Reference in New Issue
Block a user