For Programmers: Free Programming Magazines  


Home > Archive > A86 Assembler > July 2004 > GAS: defining assemble time costants in Intel syntax









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author GAS: defining assemble time costants in Intel syntax
Ermo

2004-07-29, 3:55 pm

I'd like to initialize a symbolic costant with the size of a piece of data,
when in "intel_syntax noprefix" mode. As far as I know, code should be:


..intel_syntax noprefix

..data
Data: .asciz "My data"
DATA_LEN = . - Data

..text
push DATA_LEN


GAS does compute the correct value for DATA_LEN, but when it comes to
assembling the push instruction, it does as if it is:


push dword ptr [DATA_LEN]


So, how do you get the wanted output when in the stated mode?

Thank you in advance.


--
Replace "fake" with "muchomail" for real address

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com