Re: Unable to use a variable in instruction

Frank Kotler <[email protected]>
Newsgroups gmane.linux.assembly
Organization N
Message-ID <[email protected]>
A D wrote:
> I'm having strange problem accessing a variable in a gnu assembly language program.
> When i write a code:
> 
> .section .data
>    x = 4
> mm:
>    .int 1, 2
> 
> .section .text
> .globl _start
> _start:
>    nop
>    movl x, %ecx   #can't do this 

You're trying to access memory at address 4, not move the immediate 
value 4. Try "movl $x, %ecx".

Best,
Frank

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.