A2osX/BIN/ASM.S.EXP.txt
2015-11-22 23:30:06 +01:00

119 lines
1.9 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.

PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
*---------------------------------------
* U-Operators :
* B-Operators :
* Num Format : 0-9 -> decimal
* $ = Hex
* % = binary
* & = octal
* * = PC
*---------------------------------------
EXP.Eval stz EXP.Operator
jsr SRC.GetCharNB
beq .98
cmp #'*'
bne .10
ldy #ASM.PC+3
ldx #3
.11 lda (pData),y
sta SRC.ACC,x
dey
dex
bpl .11
jsr SRC.GetCharNB
bne .97
clc
rts
.10 jsr SRC.IsDigit10 Decimal constant ?
bcs .1
dec SRC.BufPtr
jsr SRC.GetDecimal
bcs .97
bra .8
.1 cmp #'$' Hex?
bne .2
jsr SRC.GetHex
bcs .97
bra .8
.2 cmp #'%' binary?
bne .3
jsr SRC.GetBinary
bcs .97
bra .8
.3 cmp #'&' octal?
bne .4
jsr SRC.GetOctal
bcs .97
bra .8
.4 jsr SRC.IsLetter Symbol ?
bcs .97
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
bra *
.41 ldx #3
.5 lda SRC.FLabel.Value,x
sta SRC.ACC,x
dex
bpl .5
.8 clc
rts
.97 lda #ERR.SYNTAX.ERROR
sec
rts
.98 lda #ERR.MISSING.EXP
sec
.99 rts
.96 lda #ERR.UNDEF.SYMBOL
sec
rts
*---------------------------------------
stz SRC.ACC
stz SRC.ACC+1
stz SRC.ACC+2
stz SRC.ACC+3
*---------------------------------------
*---------------------------------------
MAN
SAVE BIN/ASM.S.EXP
LOAD BIN/ASM.S
ASM