mirror of
https://github.com/marketideas/qasm.git
synced 2024-06-02 08:41:27 +00:00
link script ext support
"label ext" should import label (an absolute ent from a .L file) into the local symbol table. handled by setting the linkgeqbit.
This commit is contained in:
parent
ba7a68c1bc
commit
8d65e4c290
|
@ -1181,29 +1181,15 @@ posop bit passnum
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
* label ext
|
||||||
|
* import an absolute label into the local symbol table.
|
||||||
extop bit passnum
|
extop bit passnum
|
||||||
bpl :equ
|
bpl :equ
|
||||||
clc
|
:rts clc
|
||||||
rts
|
rts
|
||||||
:equ lda newlable
|
:equ lda newlable
|
||||||
and #$ff
|
and #$ff
|
||||||
bne :equ1
|
beq :rts
|
||||||
clc
|
|
||||||
rts
|
|
||||||
:equ1 clc
|
|
||||||
rts
|
|
||||||
do 0
|
|
||||||
ldx #$00
|
|
||||||
jsr eval
|
|
||||||
bcc :ok
|
|
||||||
rts
|
|
||||||
:ok lda lvalue
|
|
||||||
sta labval
|
|
||||||
lda lvalue+2
|
|
||||||
sta labval+2
|
|
||||||
lda newlable
|
|
||||||
and #$ff
|
|
||||||
beq :badlable
|
|
||||||
cmp #lab_size
|
cmp #lab_size
|
||||||
blt :tx1
|
blt :tx1
|
||||||
lda #lab_size
|
lda #lab_size
|
||||||
|
@ -1222,14 +1208,29 @@ extop bit passnum
|
||||||
cmp #']'
|
cmp #']'
|
||||||
beq :badlable
|
beq :badlable
|
||||||
rep $20
|
rep $20
|
||||||
lda #linkgeqbit
|
|
||||||
jsr insertlable
|
jsr findlable
|
||||||
rts
|
bcs :found
|
||||||
:badlable rep $30
|
|
||||||
|
:badlable rep #$30
|
||||||
lda #badlable.$80
|
lda #badlable.$80
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
fin
|
:found
|
||||||
|
lda foundlable+o_labtype
|
||||||
|
and #linkentrybit.linkabsbit
|
||||||
|
cmp #linkentrybit.linkabsbit
|
||||||
|
bne :badlable
|
||||||
|
|
||||||
|
ldy #o_labtype
|
||||||
|
lda [lableptr],y
|
||||||
|
ora #linkgeqbit
|
||||||
|
sta [lableptr],y
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
geqop bit passnum
|
geqop bit passnum
|
||||||
bpl :equ
|
bpl :equ
|
||||||
|
|
9
testdata/3014-ext-link.S
vendored
Normal file
9
testdata/3014-ext-link.S
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
*
|
||||||
|
* verify ext imports an absolute ent label and can use it in expressions.
|
||||||
|
*
|
||||||
|
ovr all
|
||||||
|
asm 3014-ext.S
|
||||||
|
lnk 3014-ext.L
|
||||||
|
extra ext
|
||||||
|
ds extra ; 128 byte reserved space
|
||||||
|
sav 3014-ext
|
11
testdata/3014-ext.S
vendored
Normal file
11
testdata/3014-ext.S
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
rel
|
||||||
|
|
||||||
|
dum 0
|
||||||
|
ds 128
|
||||||
|
extra equ *
|
||||||
|
dend
|
||||||
|
|
||||||
|
ent extra
|
||||||
|
rts
|
||||||
|
|
||||||
|
sav 3014-ext.L
|
Loading…
Reference in New Issue
Block a user