2018-01-10 16:34:57 +00:00
|
|
|
|
NEW
|
2019-09-02 06:09:28 +00:00
|
|
|
|
AUTO 3,1
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.ParseLine jsr OUT.Reset
|
|
|
|
|
jsr SRC.GetChar
|
|
|
|
|
bcs .8
|
|
|
|
|
cmp #'*' Comment?
|
|
|
|
|
beq .8
|
|
|
|
|
cmp #';' Comment?
|
|
|
|
|
beq .8
|
|
|
|
|
>LDA.G ASM.DO.StackPtr
|
|
|
|
|
beq .1
|
|
|
|
|
clc
|
|
|
|
|
adc #ASM.DO.Stack-1
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .8
|
2018-04-06 15:10:02 +00:00
|
|
|
|
.1 >LDA.G ASM.MA.ON
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bmi SRC.ParseLine.MACRO
|
|
|
|
|
|
2019-03-22 16:47:33 +00:00
|
|
|
|
jmp SRC.ParseLine.LABEL
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.8 clc
|
2019-03-19 16:52:08 +00:00
|
|
|
|
.9 rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
*---------------------------------------
|
|
|
|
|
SRC.ParseLine.Macro
|
2019-03-18 16:48:16 +00:00
|
|
|
|
>STZ.G MAC.BufPtr
|
|
|
|
|
sta (ZPMacroBuf)
|
2018-03-28 15:23:32 +00:00
|
|
|
|
lda (ZPLinePtr)
|
|
|
|
|
cmp #' ' No label, scan to DIR/OP if any
|
|
|
|
|
bne .1
|
|
|
|
|
jsr SRC.GetNextCharNB
|
|
|
|
|
bcs .8
|
|
|
|
|
lda #' ' Store ONE blank
|
|
|
|
|
jsr MAC.AddChar
|
|
|
|
|
bcs .90
|
|
|
|
|
lda (ZPLinePtr) get back non blank char
|
|
|
|
|
bra .2
|
|
|
|
|
.1 jsr MAC.AddChar
|
|
|
|
|
bcs .99
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs .80
|
|
|
|
|
cmp #' '
|
|
|
|
|
bne .1
|
|
|
|
|
jsr MAC.AddChar
|
|
|
|
|
.90 bcs .99
|
|
|
|
|
jsr SRC.GetNextCharNB
|
|
|
|
|
bcs .80
|
|
|
|
|
.2 cmp #'.' Directive ?
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPLinePtr),y
|
|
|
|
|
beq .3
|
|
|
|
|
cmp #'E'
|
|
|
|
|
beq .21
|
|
|
|
|
cmp #'e'
|
|
|
|
|
bne .3
|
|
|
|
|
.21 iny
|
|
|
|
|
lda (ZPLinePtr),y
|
|
|
|
|
beq .3
|
|
|
|
|
cmp #'M'
|
|
|
|
|
beq .22
|
|
|
|
|
cmp #'m'
|
|
|
|
|
bne .3
|
2019-03-18 16:48:16 +00:00
|
|
|
|
.22 >STZ.G ASM.MA.ON
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
2019-04-01 06:07:56 +00:00
|
|
|
|
.80 lda #C.CR
|
2018-03-28 15:23:32 +00:00
|
|
|
|
jmp MAC.AddChar
|
|
|
|
|
.3 lda (ZPLinePtr)
|
|
|
|
|
.4 jsr MAC.AddChar
|
|
|
|
|
bcs .99
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs .80
|
|
|
|
|
cmp #' '
|
|
|
|
|
bne .4
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs .8
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq .80 Comments...
|
|
|
|
|
pha
|
|
|
|
|
lda #' '
|
|
|
|
|
jsr MAC.AddChar
|
|
|
|
|
pla
|
|
|
|
|
bcs .99
|
|
|
|
|
.5 jsr MAC.AddChar Store ARG....
|
|
|
|
|
bcs .99
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs .80
|
|
|
|
|
cmp #' '
|
|
|
|
|
bne .5
|
2019-03-18 16:48:16 +00:00
|
|
|
|
bra .80 End of Line
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.99 SRC.ParseLine.RTS
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2018-01-29 16:48:07 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.ParseLine.LABEL
|
|
|
|
|
jsr SRC.GetChar
|
|
|
|
|
cmp #' ' no label...go scan dir/opcode
|
|
|
|
|
beq SRC.ParseLine.DirOp
|
2019-04-01 06:07:56 +00:00
|
|
|
|
tax save char...
|
2018-03-28 15:23:32 +00:00
|
|
|
|
cmp #'.' local symbol?
|
2019-04-01 06:07:56 +00:00
|
|
|
|
beq .1
|
|
|
|
|
cmp #':' private symbol?
|
|
|
|
|
bne .8
|
|
|
|
|
>LDA.G MAC.StkPtr
|
|
|
|
|
beq SRC.ParseLine.InvLbl
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2019-04-01 06:07:56 +00:00
|
|
|
|
.1 >LDA.G SYM.bInGlobal Not relative to Global label...
|
2019-03-19 16:52:08 +00:00
|
|
|
|
bpl SRC.ParseLine.InvLbl
|
2018-03-28 15:23:32 +00:00
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs SRC.ParseLine.InvLbl
|
|
|
|
|
jsr SRC.GetDecimal
|
|
|
|
|
bcs SRC.ParseLine.InvLbl
|
|
|
|
|
lda SRC.ACC+1
|
|
|
|
|
ora SRC.ACC+2
|
|
|
|
|
ora SRC.ACC+3
|
|
|
|
|
bne SRC.ParseLine.InvLbl Max .255
|
|
|
|
|
lda SRC.ACC
|
|
|
|
|
beq SRC.ParseLine.InvLbl .0 is not allowed
|
|
|
|
|
|
2019-04-01 06:07:56 +00:00
|
|
|
|
cpx #':'
|
|
|
|
|
beq .2
|
|
|
|
|
jsr SYM.NewLocalA
|
|
|
|
|
bra .3
|
|
|
|
|
.2 jsr SYM.NewPrivateA
|
|
|
|
|
|
|
|
|
|
.3 bcs SRC.ParseLine.RTS
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bra SRC.ParseLine.DirOp
|
|
|
|
|
|
2019-04-01 06:07:56 +00:00
|
|
|
|
.8 jsr SYM.NewOrGetGlobal
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcs SRC.ParseLine.RTS
|
2019-10-03 06:25:27 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.ParseLine.DirOp
|
|
|
|
|
jsr SRC.GetNextCharNB Scan for an Opcode...
|
|
|
|
|
bcs SRC.ParseLine.Ok
|
|
|
|
|
cmp #'.'
|
|
|
|
|
bne .5
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs SRC.ParseLine.InvDir
|
|
|
|
|
jsr SRC.ParseLine.Dir
|
|
|
|
|
bcs SRC.ParseLine.Err
|
|
|
|
|
bra SRC.ParseLine.Ok
|
|
|
|
|
|
|
|
|
|
.5 cmp #'>'
|
|
|
|
|
bne SRC.ParseLine.OpCode
|
2019-04-01 06:07:56 +00:00
|
|
|
|
jsr MAC.Exec
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcs SRC.ParseLine.Err
|
|
|
|
|
bra SRC.ParseLine.Ok
|
|
|
|
|
SRC.ParseLine.Ok
|
|
|
|
|
clc
|
|
|
|
|
SRC.ParseLine.Err
|
|
|
|
|
rts
|
2015-12-17 16:57:35 +00:00
|
|
|
|
|
2018-01-23 16:52:22 +00:00
|
|
|
|
SRC.ParseLine.InvLbl
|
2019-03-25 07:04:40 +00:00
|
|
|
|
lda #E.INV.LABEL
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2018-01-23 16:52:22 +00:00
|
|
|
|
SRC.ParseLine.InvDir
|
2019-03-25 07:04:40 +00:00
|
|
|
|
lda #E.INV.DIR
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-10-09 15:53:30 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.ParseLine.Dir
|
|
|
|
|
>LDYA L.T.DIRECTIVES
|
|
|
|
|
jsr SRC.GetKeyword
|
2018-01-11 16:34:09 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcs SRC.ParseLine.InvDir
|
|
|
|
|
jmp (J.DIRECTIVES,x)
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2015-10-28 16:55:12 +00:00
|
|
|
|
SRC.ParseLine.OpCode
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>LDYA ZPOpsPtr
|
|
|
|
|
>STYA ZPOpDefPtr
|
2019-03-22 16:47:33 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.1 lda (ZPOpDefPtr) End Of OpCode List
|
|
|
|
|
ldy #1
|
|
|
|
|
ora (ZPOpDefPtr),y
|
|
|
|
|
beq .9
|
|
|
|
|
lda ZPOpDefPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #2
|
|
|
|
|
sta ZPPtr2
|
|
|
|
|
lda ZPOpDefPtr+1
|
|
|
|
|
adc #0
|
|
|
|
|
sta ZPPtr2+1
|
|
|
|
|
lda (ZPPtr2)
|
|
|
|
|
tax
|
|
|
|
|
ldy #0
|
|
|
|
|
.2 lda (ZPLinePtr),y
|
|
|
|
|
beq .7
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bcc .3
|
|
|
|
|
cmp #'z'+1
|
|
|
|
|
bcs .3
|
|
|
|
|
eor #$20
|
|
|
|
|
.3 iny
|
|
|
|
|
cmp (ZPPtr2),y
|
|
|
|
|
bne .7
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2019-03-25 07:04:40 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
lda (ZPLinePtr),y
|
|
|
|
|
beq .8 End of Line, no AM
|
2019-03-25 07:04:40 +00:00
|
|
|
|
cmp #C.SPACE A space after opcode ?
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bne .7
|
|
|
|
|
tya
|
|
|
|
|
sec skip OP + ' '
|
|
|
|
|
adc ZPLinePtr
|
|
|
|
|
sta ZPLinePtr
|
|
|
|
|
bcc .5
|
|
|
|
|
inc ZPLinePtr+1
|
2019-03-28 16:48:22 +00:00
|
|
|
|
.5 jsr SRC.GetChar
|
|
|
|
|
bcs .8 Nothing after OP ' '
|
|
|
|
|
cmp #C.SPACE OP ' ' ?
|
|
|
|
|
beq .8
|
|
|
|
|
bra SRC.ParseLine.AM
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.7 lda ZPOpDefPtr
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPOpDefPtr)
|
|
|
|
|
tax
|
|
|
|
|
lda ZPOpDefPtr+1
|
|
|
|
|
ldy #1
|
|
|
|
|
adc (ZPOpDefPtr),y
|
|
|
|
|
stx ZPOpDefPtr
|
|
|
|
|
sta ZPOpDefPtr+1
|
|
|
|
|
bra .1
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.8 lda #$ff
|
|
|
|
|
>STA.G SRC.AMID
|
|
|
|
|
jsr SRC.ParseLine.AMCheck4OP
|
|
|
|
|
bcs .99
|
|
|
|
|
jmp SRC.ParseLine.Emit
|
|
|
|
|
.9 lda #E.INV.OPCODE
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2015-10-30 16:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-25 07:04:40 +00:00
|
|
|
|
SRC.ParseLine.AM
|
|
|
|
|
stz SRC.AM.StrBuf
|
2019-03-28 16:48:22 +00:00
|
|
|
|
|
|
|
|
|
.1 jsr SRC.IsAMReserved
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcs .2
|
|
|
|
|
jsr SRC.AddToBuf
|
|
|
|
|
bra .7
|
|
|
|
|
.2 jsr SRC.IsLetter Any register?
|
|
|
|
|
bcs .6 no, try something else
|
|
|
|
|
>LDYA ZPRPtr Check in register table
|
|
|
|
|
jsr SRC.GetKeyword
|
|
|
|
|
bcs .6
|
|
|
|
|
lda (ZPPtr1) get register len
|
|
|
|
|
tax
|
|
|
|
|
.4 inc ZPPtr1
|
|
|
|
|
bne .5
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
.5 lda (ZPPtr1)
|
|
|
|
|
jsr SRC.AddToBuf
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
2019-03-29 16:21:30 +00:00
|
|
|
|
bra .74
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.6 jsr EXP.Eval
|
|
|
|
|
bcs .99
|
|
|
|
|
>LDA.G EXP.Prefix
|
|
|
|
|
beq .75
|
|
|
|
|
jsr SRC.AddToBuf
|
|
|
|
|
|
2019-03-28 16:48:22 +00:00
|
|
|
|
.75 ldx SRC.ACC.SIZE
|
|
|
|
|
bne .73
|
|
|
|
|
ldx #2 FWREF ...assume 2 bytes...
|
2019-03-22 07:41:35 +00:00
|
|
|
|
.73 lda SRC.ACC-1,x
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bne .72
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .73
|
|
|
|
|
inx
|
|
|
|
|
.72 lda #'a'
|
|
|
|
|
.71 jsr SRC.AddToBuf
|
|
|
|
|
dex
|
|
|
|
|
bne .71
|
2019-03-29 16:21:30 +00:00
|
|
|
|
|
|
|
|
|
.74 jsr SRC.GetChar
|
2019-03-28 16:48:22 +00:00
|
|
|
|
bcs .8
|
|
|
|
|
cmp #C.SPACE
|
|
|
|
|
bne .1
|
|
|
|
|
bra .8
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.7 jsr SRC.GetNextChar
|
2019-03-28 16:48:22 +00:00
|
|
|
|
bcs .8
|
|
|
|
|
cmp #C.SPACE
|
|
|
|
|
bne .1
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.8 jsr SRC.ParseLine.AMCheck
|
|
|
|
|
bcs .9
|
|
|
|
|
jsr SRC.ParseLine.AMCheck4OP
|
|
|
|
|
bcc .88
|
|
|
|
|
|
|
|
|
|
.80 jsr SRC.ExpandAddress
|
|
|
|
|
cpx #5
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
.9 lda #E.INV.AM
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
|
|
|
|
|
.88 jmp SRC.ParseLine.Emit
|
2015-10-28 16:55:12 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-16 16:33:11 +00:00
|
|
|
|
SRC.ParseLine.AMCheck
|
2019-03-25 07:04:40 +00:00
|
|
|
|
* ldx #5
|
|
|
|
|
|
|
|
|
|
*.10 lda SRC.ACC.F,x
|
|
|
|
|
* >PUSHA
|
|
|
|
|
* dex
|
|
|
|
|
* bpl .10
|
|
|
|
|
|
|
|
|
|
* >PUSHBI 6
|
|
|
|
|
* >LDYA L.MSG.ACC
|
|
|
|
|
* >SYSCALL printf
|
|
|
|
|
* >LDYA L.SRC.AM.StrBuf
|
|
|
|
|
* jsr DEBUG.PSTR
|
|
|
|
|
>LDYA ZPAMPtr Check if AM is valid for CPU
|
2018-03-28 15:23:32 +00:00
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
ldx #0
|
|
|
|
|
.1 inx
|
2019-03-25 07:04:40 +00:00
|
|
|
|
* phx
|
|
|
|
|
* lda #'?'
|
|
|
|
|
* >SYSCALL putchar
|
|
|
|
|
* >LDYA ZPPtr1
|
|
|
|
|
* jsr DEBUG.PSTR
|
|
|
|
|
* plx
|
2018-03-28 15:23:32 +00:00
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
beq .9
|
|
|
|
|
cmp SRC.AM.StrBuf
|
|
|
|
|
bne .7
|
|
|
|
|
tay
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.2 lda (ZPPtr1),y
|
2018-03-28 15:23:32 +00:00
|
|
|
|
cmp SRC.AM.StrBuf,y
|
|
|
|
|
bne .6
|
|
|
|
|
dey
|
|
|
|
|
bne .2
|
|
|
|
|
txa
|
|
|
|
|
>STA.G SRC.AMID
|
2019-03-25 07:04:40 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.6 lda (ZPPtr1)
|
|
|
|
|
.7 sec
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .1
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
bra .1
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.9 sec
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2018-03-21 16:22:05 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-25 07:04:40 +00:00
|
|
|
|
SRC.ParseLine.AMCheck4OP
|
|
|
|
|
lda ZPOpDefPtr Skip nextLoHi,L,"ADC"
|
|
|
|
|
ldx ZPOpDefPtr+1
|
|
|
|
|
clc
|
|
|
|
|
adc #2 Skip nextLoHi
|
|
|
|
|
bcc .11
|
|
|
|
|
inx
|
|
|
|
|
.11 sec skip LEN Byte
|
|
|
|
|
ldy #2 LEN Byte
|
|
|
|
|
adc (ZPOpDefPtr),y
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcc .10
|
2019-03-25 07:04:40 +00:00
|
|
|
|
inx
|
|
|
|
|
.10 sta ZPPtr1
|
|
|
|
|
stx ZPPtr1+1
|
|
|
|
|
lda (ZPPtr1) AMID...
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
.1 >CMP.G SRC.AMID
|
2019-03-25 07:04:40 +00:00
|
|
|
|
beq .8
|
|
|
|
|
lda ZPPtr1 Skip AMID,L,"39aa"
|
|
|
|
|
ldx ZPPtr1+1
|
|
|
|
|
inc AMID....
|
|
|
|
|
bne .12
|
|
|
|
|
inx
|
|
|
|
|
.12 sec LEN byte...
|
|
|
|
|
ldy #1 String...
|
|
|
|
|
adc (ZPPtr1),y
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bcc .2
|
2019-03-25 07:04:40 +00:00
|
|
|
|
inx
|
|
|
|
|
.2 sta ZPPtr1
|
|
|
|
|
stx ZPPtr1+1
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #E.INV.AM.4.OC
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.8 >LDYA ZPPtr1
|
|
|
|
|
>STYA ZPOpDefPtr
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-04-06 15:10:02 +00:00
|
|
|
|
*---------------------------------------
|
|
|
|
|
SRC.ParseLine.Emit
|
|
|
|
|
stz SRC.ACCTMP index in ACC
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPOpDefPtr),y
|
|
|
|
|
sta SRC.ACCTMP+1 Char Count in AM
|
|
|
|
|
iny
|
|
|
|
|
.4 lda (ZPOpDefPtr),y
|
|
|
|
|
cmp #'a
|
2018-04-06 15:10:02 +00:00
|
|
|
|
bcs .5 lowercase, go compute address
|
2018-03-28 15:23:32 +00:00
|
|
|
|
jsr SRC.IsDigit16
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
sta SRC.ACCTMP+2
|
|
|
|
|
iny
|
|
|
|
|
dec SRC.ACCTMP+1
|
|
|
|
|
lda (ZPOpDefPtr),y
|
|
|
|
|
jsr SRC.IsDigit16
|
|
|
|
|
ora SRC.ACCTMP+2
|
|
|
|
|
|
|
|
|
|
.50 jsr OUT.EmitByte
|
|
|
|
|
|
|
|
|
|
bcs .9
|
|
|
|
|
iny
|
|
|
|
|
dec SRC.ACCTMP+1
|
|
|
|
|
bne .4
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2018-03-28 15:23:32 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-04-06 15:10:02 +00:00
|
|
|
|
.5 bne .6 cmp #'a'....
|
2018-03-28 15:23:32 +00:00
|
|
|
|
ldx SRC.ACCTMP
|
|
|
|
|
inc SRC.ACCTMP
|
|
|
|
|
lda SRC.ACC,x
|
|
|
|
|
bra .50
|
|
|
|
|
|
|
|
|
|
.6 cmp #'r
|
2018-04-06 15:10:02 +00:00
|
|
|
|
bne .7
|
|
|
|
|
lda SRC.ACC.SIZE
|
|
|
|
|
beq .50 Emit 00 if pending symbol (pass #1)
|
|
|
|
|
jsr SRC.ComputeRel8
|
|
|
|
|
bcs .91
|
|
|
|
|
bra .50
|
|
|
|
|
.7 cmp #'l
|
|
|
|
|
bne .90
|
2018-03-28 15:23:32 +00:00
|
|
|
|
|
2018-04-06 15:10:02 +00:00
|
|
|
|
lda SRC.ACC.SIZE
|
|
|
|
|
bne .71
|
|
|
|
|
jsr OUT.EmitByte Emit 00 00 if pending symbol (pass #1)
|
|
|
|
|
bcs .9
|
|
|
|
|
lda #0
|
|
|
|
|
bra .50
|
|
|
|
|
.71 jsr SRC.ComputeRel16
|
|
|
|
|
bcs .91
|
|
|
|
|
lda SRC.ACC
|
|
|
|
|
jsr OUT.EmitByte
|
|
|
|
|
bcs .9
|
|
|
|
|
lda SRC.ACC+1
|
2018-03-28 15:23:32 +00:00
|
|
|
|
bra .50
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
2018-04-06 15:10:02 +00:00
|
|
|
|
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.90 lda #E.INV.T.FILE
|
2018-04-06 15:10:02 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.91 lda #E.RANGE
|
2018-04-06 15:10:02 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2018-03-16 16:33:11 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.AddToBuf inc SRC.AM.StrBuf
|
|
|
|
|
ldy SRC.AM.StrBuf
|
|
|
|
|
sta SRC.AM.StrBuf,y
|
|
|
|
|
rts
|
2015-10-28 16:55:12 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-25 07:04:40 +00:00
|
|
|
|
SRC.ExpandAddress
|
|
|
|
|
ldy SRC.AM.StrBuf
|
|
|
|
|
.1 lda SRC.AM.StrBuf,y
|
|
|
|
|
sta SRC.AM.StrBuf+1,y
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bne .1
|
|
|
|
|
ldx #2 "aa"
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
beq .8
|
|
|
|
|
.2 lda SRC.AM.StrBuf,y
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bne .8
|
|
|
|
|
inx "aaa"
|
|
|
|
|
.3 dey
|
|
|
|
|
bne .2
|
|
|
|
|
.8 inc SRC.AM.StrBuf
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2018-04-06 15:10:02 +00:00
|
|
|
|
SRC.ComputeRel8 jsr SRC.ComputeRel
|
|
|
|
|
bcc .1
|
|
|
|
|
* positive : check 0<r<0000007F
|
|
|
|
|
|
|
|
|
|
lda SRC.ACC+3
|
|
|
|
|
ora SRC.ACC+2
|
|
|
|
|
ora SRC.ACC+1
|
|
|
|
|
bne .9
|
|
|
|
|
lda SRC.ACC
|
|
|
|
|
bmi .9
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
* negative : check FFFFFF80<r<FFFFFFFF
|
|
|
|
|
|
|
|
|
|
.1 lda SRC.ACC+3
|
|
|
|
|
and SRC.ACC+2
|
|
|
|
|
and SRC.ACC+1
|
|
|
|
|
inc
|
|
|
|
|
bne .9
|
|
|
|
|
lda SRC.ACC
|
|
|
|
|
bpl .9
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SRC.ComputeRel16
|
|
|
|
|
jsr SRC.ComputeRel
|
|
|
|
|
|
|
|
|
|
bcc .1
|
|
|
|
|
* positive : check 0<r<00007FFF
|
|
|
|
|
|
|
|
|
|
lda SRC.ACC+3
|
|
|
|
|
ora SRC.ACC+2
|
|
|
|
|
bne .9
|
|
|
|
|
lda SRC.ACC+1
|
|
|
|
|
bmi .9
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
* negative : check FFFF8000<r<FFFFFFFF
|
|
|
|
|
|
|
|
|
|
.1 lda SRC.ACC+3
|
|
|
|
|
and SRC.ACC+2
|
|
|
|
|
inc
|
|
|
|
|
bne .9
|
|
|
|
|
lda SRC.ACC+1
|
|
|
|
|
bpl .9
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
|
|
|
|
SRC.ComputeRel phy
|
|
|
|
|
|
|
|
|
|
ldy #ASM.PC
|
|
|
|
|
clc
|
|
|
|
|
lda SRC.ACC
|
|
|
|
|
sbc (pData),y
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
iny
|
|
|
|
|
lda SRC.ACC+1
|
|
|
|
|
sbc (pData),y
|
|
|
|
|
sta SRC.ACC+1
|
|
|
|
|
iny
|
|
|
|
|
lda SRC.ACC+2
|
|
|
|
|
sbc (pData),y
|
|
|
|
|
sta SRC.ACC+2
|
|
|
|
|
iny
|
|
|
|
|
lda SRC.ACC+3
|
|
|
|
|
sbc (pData),y
|
|
|
|
|
sta SRC.ACC+3
|
|
|
|
|
ply
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetDecimal jsr SRC.GetChar
|
|
|
|
|
beq .99
|
|
|
|
|
stz SRC.ACC+1
|
|
|
|
|
stz SRC.ACC+2
|
|
|
|
|
stz SRC.ACC+3
|
|
|
|
|
jsr SRC.IsDigit10
|
|
|
|
|
bcs .99
|
|
|
|
|
and #$0F
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
.1 jsr SRC.GetNextChar
|
|
|
|
|
bcs .8
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq .8
|
|
|
|
|
jsr SRC.IsEXPReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsAMReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsDigit10
|
|
|
|
|
bcs .9
|
|
|
|
|
and #$0F
|
|
|
|
|
pha
|
|
|
|
|
jsr SRC.ACC10
|
|
|
|
|
pla
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
adc SRC.ACC
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
bcc .1
|
|
|
|
|
inc SRC.ACC+1
|
|
|
|
|
bne .1
|
|
|
|
|
inc SRC.ACC+2
|
|
|
|
|
bne .1
|
|
|
|
|
inc SRC.ACC+3
|
|
|
|
|
bne .1
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.9 lda #E.VAL.TOO.BIG
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.99 lda #E.SYNTAX.ERROR
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-10-30 16:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetHex jsr SRC.GetNextChar skip '$'
|
|
|
|
|
bcs .99
|
|
|
|
|
stz SRC.ACC+1
|
|
|
|
|
stz SRC.ACC+2
|
|
|
|
|
stz SRC.ACC+3
|
|
|
|
|
jsr SRC.IsDigit16
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
.1 jsr SRC.GetNextChar
|
|
|
|
|
bcs .8
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq .8
|
|
|
|
|
jsr SRC.IsEXPReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsAMReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsDigit16
|
|
|
|
|
bcs .99
|
|
|
|
|
ldx #4
|
|
|
|
|
.2 asl SRC.ACC
|
|
|
|
|
rol SRC.ACC+1
|
|
|
|
|
rol SRC.ACC+2
|
|
|
|
|
rol SRC.ACC+3
|
|
|
|
|
bcs .9
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
ora SRC.ACC
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
bra .1
|
2018-04-06 15:10:02 +00:00
|
|
|
|
.8 clc
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.9 lda #E.VAL.TOO.BIG
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.99 lda #E.SYNTAX.ERROR
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-10-28 16:55:12 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetOctal jsr SRC.GetNextChar skip '&'
|
|
|
|
|
bcs .99
|
|
|
|
|
stz SRC.ACC+1
|
|
|
|
|
stz SRC.ACC+2
|
|
|
|
|
stz SRC.ACC+3
|
|
|
|
|
jsr SRC.IsDigit8
|
|
|
|
|
bcs .99
|
|
|
|
|
and #$0F
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
.1 jsr SRC.GetNextChar
|
|
|
|
|
bcs .8
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq .8
|
|
|
|
|
jsr SRC.IsEXPReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsAMReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsDigit8
|
|
|
|
|
bcs .9
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
ldx #3
|
|
|
|
|
.2 asl
|
|
|
|
|
rol SRC.ACC
|
|
|
|
|
rol SRC.ACC+1
|
|
|
|
|
rol SRC.ACC+2
|
|
|
|
|
rol SRC.ACC+3
|
|
|
|
|
bcs .9
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
bra .1
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.9 lda #E.VAL.TOO.BIG
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.99 lda #E.SYNTAX.ERROR
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetBinary jsr SRC.GetNextChar skip '%'
|
|
|
|
|
bcs .99
|
|
|
|
|
stz SRC.ACC+1
|
|
|
|
|
stz SRC.ACC+2
|
|
|
|
|
stz SRC.ACC+3
|
|
|
|
|
cmp #'1'
|
|
|
|
|
beq .10
|
|
|
|
|
cmp #'0'
|
|
|
|
|
bne .99
|
|
|
|
|
.10 and #$01
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
.1 jsr SRC.GetNextChar
|
|
|
|
|
bcs .8
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq .8
|
|
|
|
|
jsr SRC.IsEXPReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
jsr SRC.IsAMReserved
|
|
|
|
|
bcc .8
|
|
|
|
|
cmp #'1'
|
|
|
|
|
beq .11
|
|
|
|
|
cmp #'0'
|
|
|
|
|
bne .8
|
|
|
|
|
.11 lsr
|
|
|
|
|
rol SRC.ACC
|
|
|
|
|
rol SRC.ACC+1
|
|
|
|
|
rol SRC.ACC+2
|
|
|
|
|
rol SRC.ACC+3
|
|
|
|
|
bcs .9
|
|
|
|
|
bra .1
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.9 lda #E.VAL.TOO.BIG
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.99 lda #E.SYNTAX.ERROR
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetKeyword >STYA ZPPtr1 KeyWord table
|
|
|
|
|
|
|
|
|
|
ldx #0 Keyword.ID
|
|
|
|
|
|
|
|
|
|
.1 phx
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
beq .9 End Of table
|
|
|
|
|
tax KW len
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.3 lda (ZPLinePtr),y
|
|
|
|
|
beq .6
|
|
|
|
|
jsr SRC.IsKeywordLetterUC
|
|
|
|
|
bcs .6
|
|
|
|
|
iny
|
|
|
|
|
cmp (ZPPtr1),y
|
2019-03-25 07:04:40 +00:00
|
|
|
|
bne .7
|
2018-03-28 15:23:32 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .3
|
|
|
|
|
lda (ZPLinePtr),y All chars match...
|
|
|
|
|
beq .4 End of Line ?
|
|
|
|
|
jsr SRC.IsKeywordLetterUC
|
2019-03-25 07:04:40 +00:00
|
|
|
|
bcc .7 Additional letters...
|
|
|
|
|
.4 lda ZPLinePtr found!
|
2018-03-28 15:23:32 +00:00
|
|
|
|
clc
|
2019-03-25 07:04:40 +00:00
|
|
|
|
adc (ZPPtr1) skip KW in source line
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sta ZPLinePtr
|
|
|
|
|
bcc .5
|
|
|
|
|
inc ZPLinePtr+1
|
|
|
|
|
.5 plx Keyword.ID
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.6
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.7 lda (ZPPtr1)
|
2018-03-28 15:23:32 +00:00
|
|
|
|
sec Add keyword Len+1
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
2019-03-25 07:04:40 +00:00
|
|
|
|
bcc .8
|
2018-03-28 15:23:32 +00:00
|
|
|
|
inc ZPPtr1+1
|
2019-03-25 07:04:40 +00:00
|
|
|
|
.8 plx Keyword.ID
|
2018-03-28 15:23:32 +00:00
|
|
|
|
inx
|
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
.9 plx
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2015-10-30 16:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsAMReserved
|
|
|
|
|
ldx SRC.AM.RESERVED
|
|
|
|
|
.1 cmp SRC.AM.RESERVED,x
|
|
|
|
|
beq .8
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
.8 clc
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
2015-12-17 16:57:35 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsMODReserved
|
|
|
|
|
ldx SRC.MOD.RESERVED
|
|
|
|
|
.1 cmp SRC.MOD.RESERVED,x
|
|
|
|
|
beq .8
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
.8 clc
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
2018-03-28 15:23:32 +00:00
|
|
|
|
*---------------------------------------
|
|
|
|
|
SRC.IsEXPReserved
|
|
|
|
|
ldx SRC.EXP.RESERVED
|
|
|
|
|
.1 cmp SRC.EXP.RESERVED,x
|
|
|
|
|
beq SRC.IsEXPReserved.8
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
SRC.IsEXPReserved.8
|
|
|
|
|
clc
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
2015-10-30 16:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2018-02-01 16:30:18 +00:00
|
|
|
|
SRC.IsKeywordLetterUC
|
2018-03-28 15:23:32 +00:00
|
|
|
|
cmp #'.'
|
|
|
|
|
beq SRC.IsEXPReserved.8
|
|
|
|
|
|
|
|
|
|
cmp #'_'
|
|
|
|
|
beq SRC.IsEXPReserved.8
|
|
|
|
|
|
|
|
|
|
cmp #'A'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'Z'+1
|
|
|
|
|
bcc .99
|
|
|
|
|
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'z'+1
|
|
|
|
|
eor #$20
|
|
|
|
|
rts CC if lowercase
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.9 sec
|
2018-03-28 15:23:32 +00:00
|
|
|
|
.99 rts
|
2018-01-26 16:19:17 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsLetterOrDigit
|
|
|
|
|
jsr SRC.IsDigit10
|
|
|
|
|
bcc SRC.IsLetterRTS
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsLetter cmp #'A'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'Z'+1
|
|
|
|
|
bcc SRC.IsLetterRTS
|
|
|
|
|
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'z'+1
|
|
|
|
|
rts CC if lowercase
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.9 sec
|
|
|
|
|
SRC.IsLetterRTS rts
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsDigit16 jsr SRC.IsDigit10
|
|
|
|
|
bcc .8
|
|
|
|
|
cmp #'A'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'F'+1
|
|
|
|
|
bcc .1
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'f'+1
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
eor #$20
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.1
|
2018-03-28 15:23:32 +00:00
|
|
|
|
* clc
|
|
|
|
|
sbc #'A'-11 cc so A->10 (11-CC)
|
|
|
|
|
clc
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.8 and #$0F
|
2018-03-28 15:23:32 +00:00
|
|
|
|
rts
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2015-10-28 16:55:12 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsDigit10 cmp #'0'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'9'+1
|
|
|
|
|
rts cc if ok, cs if not
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2015-10-30 16:34:59 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.IsDigit8 cmp #'0'
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'7'+1
|
|
|
|
|
rts cc if ok, cs if not
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2018-01-11 16:34:09 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetNextCharNB
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs .9
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq SRC.GetNextCharNB
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetNextCharUC
|
|
|
|
|
jsr SRC.GetNextChar
|
|
|
|
|
bcs .9
|
|
|
|
|
cmp #'a'
|
|
|
|
|
bcc .8
|
|
|
|
|
cmp #'z'+1
|
|
|
|
|
bcs .8
|
|
|
|
|
eor #$20 to Uppercase
|
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
2018-01-11 16:34:09 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.GetNextChar lda (ZPLinePtr)
|
|
|
|
|
beq SRC.GetChar.ERR
|
|
|
|
|
cmp #$0D
|
|
|
|
|
beq SRC.GetChar.ERR
|
|
|
|
|
inc ZPLinePtr
|
|
|
|
|
bne SRC.GetChar
|
|
|
|
|
inc ZPLinePtr+1
|
|
|
|
|
SRC.GetChar lda (ZPLinePtr)
|
|
|
|
|
beq SRC.GetChar.ERR
|
|
|
|
|
cmp #$0D
|
|
|
|
|
beq SRC.GetChar.ERR
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
SRC.GetChar.ERR sec
|
|
|
|
|
rts
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2018-03-28 15:23:32 +00:00
|
|
|
|
SRC.ACC10 lda SRC.ACC ACC*2-> ACC & ACCTMP
|
|
|
|
|
asl
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
sta SRC.ACCTMP
|
|
|
|
|
lda SRC.ACC+1
|
|
|
|
|
rol
|
|
|
|
|
sta SRC.ACC+1
|
|
|
|
|
sta SRC.ACCTMP+1
|
|
|
|
|
lda SRC.ACC+2
|
|
|
|
|
rol
|
|
|
|
|
sta SRC.ACC+2
|
|
|
|
|
sta SRC.ACCTMP+2
|
|
|
|
|
lda SRC.ACC+3
|
|
|
|
|
rol
|
|
|
|
|
sta SRC.ACC+3
|
|
|
|
|
sta SRC.ACCTMP+3
|
|
|
|
|
bcs .9
|
|
|
|
|
ldx #2
|
|
|
|
|
.1 asl SRC.ACC ACC=ACC*4
|
|
|
|
|
rol SRC.ACC+1
|
|
|
|
|
rol SRC.ACC+2
|
|
|
|
|
rol SRC.ACC+3
|
|
|
|
|
bcs .9
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
lda SRC.ACC CC from ROL SRC.ACC+3
|
|
|
|
|
adc SRC.ACCTMP
|
|
|
|
|
sta SRC.ACC
|
|
|
|
|
lda SRC.ACC+1
|
|
|
|
|
adc SRC.ACCTMP+1
|
|
|
|
|
sta SRC.ACC+1
|
|
|
|
|
lda SRC.ACC+2
|
|
|
|
|
adc SRC.ACCTMP+2
|
|
|
|
|
sta SRC.ACC+2
|
|
|
|
|
lda SRC.ACC+3
|
|
|
|
|
adc SRC.ACCTMP+3
|
|
|
|
|
sta SRC.ACC+3 CS if overflow
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.9 rts
|
2015-10-06 16:14:48 +00:00
|
|
|
|
*---------------------------------------
|
2019-03-25 07:04:40 +00:00
|
|
|
|
DEBUG.PSTR >PUSHYA
|
|
|
|
|
>PUSHBI 2
|
|
|
|
|
>LDYA L.MSG.PSTR
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
rts
|
|
|
|
|
*---------------------------------------
|
2015-10-06 16:14:48 +00:00
|
|
|
|
MAN
|
2019-01-28 07:44:37 +00:00
|
|
|
|
SAVE USR/SRC/BIN/ASM.S.SRC
|
|
|
|
|
LOAD USR/SRC/BIN/ASM.S
|
2015-10-06 16:14:48 +00:00
|
|
|
|
ASM
|