flat assembler
Message board for the users of flat assembler.

Index > Main > Label effective address.

Author
Thread Post new topic Reply to topic
peixe



Joined: 18 Oct 2004
Posts: 2
peixe 18 Oct 2004, 16:53
I´m trying to get the effective address of a label, but this instruction gives me error:

Code:
...
lea cx,label
...
label:
...
    


Gives this error:

lea cx,label
error: invalid operand.

Should I use offset (mov cx,offset label)? In this case gives the same error... How can I get the address of a label?

[Matrix_Spell_Checking=adjust,reason="For Better searching"]Matrix[/Matrix_Spell_Checking]
Post 18 Oct 2004, 16:53
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 18 Oct 2004, 17:12
use
Code:
lea cx,[my_label]
my_label:    


Remember that you can't give a name "label" - it is a reserved word.
Post 18 Oct 2004, 17:12
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 27 Oct 2004, 06:31
peixe wrote:
Should I use offset (mov cx,offset label)? In this case gives the same error... How can I get the address of a label?


hy peixe,

if you wanna use the offset word you can use this code
otherwise you don't need it in fasm
Code:
org 256
offset equ
mov cx,offset flat_label

int 20h
flat_label: db 'akármi$'
    
Post 27 Oct 2004, 06:31
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.