I have a routine with several labels in it.
Is it possible to get the address of a label ?
Can you give an example as well.
Rgs, striker.
This should work:
mov eax,offset label
My best guess without more details.
James,
There is a good technique in MASM if you want to hit those labels quickly, make a short table like this.
table dd lbl1,lbl2,lbl3,lbl4 etc ....
This must match labels in you code and preferrably local in the procedure.
.data
table dd lbl1,lbl2,lbl3,lbl4 etc ....
.code
lbl1:
lbl2:
lbl3:
lbl4:
The assembler resolves the label names to addresses.
Not sure if this is what you are after but is cute anyway.
Thanks Hutch and TC,
I should have tried Offet before asking.
Dang, addr vs offset.
Excellent. I have been looking for an easy way to make jump tables.
Hutch,
Do you have a way of this working outside of a local routine ???
Rgs, Striker.
Yes,
Make each label GLOBAL with the notation,
lbl1::
lbl2::
etc ....
The only catch with doing this is the labels must be unique for the entire module where if you use them in LOCAL scope with the table inboard, you don't.
Hutch,
Thanks that worked ! :bg
Rgs, striker.