A2osX/BIN/ASM.S.EXP.txt

119 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-10-09 15:53:30 +00:00
PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*---------------------------------------
* U-Operators :
* B-Operators :
* Num Format : 0-9 -> decimal
2015-10-28 16:55:12 +00:00
* $ = Hex
2015-10-09 15:53:30 +00:00
* % = binary
* & = octal
2015-10-28 16:55:12 +00:00
* * = PC
2015-10-09 15:53:30 +00:00
*---------------------------------------
2015-11-20 16:31:14 +00:00
EXP.Eval stz EXP.Operator
jsr SRC.GetCharNB
2015-10-28 16:55:12 +00:00
beq .98
cmp #'*'
bne .10
2015-10-09 15:53:30 +00:00
2015-11-20 16:31:14 +00:00
ldy #ASM.PC+3
ldx #3
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.11 lda (pData),y
sta SRC.ACC,x
2015-11-20 16:31:14 +00:00
dey
dex
bpl .11
2015-10-09 15:53:30 +00:00
2015-11-20 16:31:14 +00:00
jsr SRC.GetCharNB
bne .97
clc
rts
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.10 jsr SRC.IsDigit10 Decimal constant ?
bcs .1
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
dec SRC.BufPtr
jsr SRC.GetDecimal
bcs .97
bra .8
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.1 cmp #'$' Hex?
bne .2
jsr SRC.GetHex
bcs .97
bra .8
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.2 cmp #'%' binary?
bne .3
jsr SRC.GetBinary
bcs .97
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
bra .8
2015-10-09 15:53:30 +00:00
2015-10-30 16:34:59 +00:00
.3 cmp #'&' octal?
bne .4
jsr SRC.GetOctal
bcs .97
bra .8
.4 jsr SRC.IsLetter Symbol ?
2015-10-28 16:55:12 +00:00
bcs .97
2015-11-20 16:31:14 +00:00
dec SRC.BufPtr
>LDYA L.SRC.ELabel.Len
jsr SRC.GetLabel
bcs .97
jsr SYM.FindGlobal
bcc .41
ldy #ASM.PASS
lda (pData),y pass#2?
bne .96 yes, undefined symbol
2015-10-09 15:53:30 +00:00
bra *
2015-11-20 16:31:14 +00:00
.41 ldx #3
.5 lda SRC.FLabel.Value,x
sta SRC.ACC,x
dex
bpl .5
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.8 clc
rts
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.97 lda #ERR.SYNTAX.ERROR
sec
rts
2015-10-09 15:53:30 +00:00
2015-10-28 16:55:12 +00:00
.98 lda #ERR.MISSING.EXP
2015-10-09 15:53:30 +00:00
sec
.99 rts
2015-11-20 16:31:14 +00:00
.96 lda #ERR.UNDEF.SYMBOL
sec
rts
2015-10-09 15:53:30 +00:00
*---------------------------------------
stz SRC.ACC
stz SRC.ACC+1
stz SRC.ACC+2
stz SRC.ACC+3
*---------------------------------------
2015-10-28 16:55:12 +00:00
2015-10-09 15:53:30 +00:00
*---------------------------------------
MAN
2015-10-28 16:55:12 +00:00
SAVE BIN/ASM.S.EXP
2015-10-09 15:53:30 +00:00
LOAD BIN/ASM.S
2015-10-28 16:55:12 +00:00
ASM