Name: Anonymous 2011-06-02 21:42
It is my understanding that the $ keyword in FASM is equal to the current location during assembling, and in fact on http://en.wikibooks.org/wiki/X86_Assembly/FASM_Syntax the following example is given:
mystring db "This is my string", 0
mystring.length equ $-mystring
However, when placing two of these blocks back to back, I get wildly unexpected results:
a db 'Hello, world! A'
alength equ $ - a
b db 'Hello, world! B'
blength equ $ - b
alength now equals 30, whiles blength equals 20. Expected result is 15 for both.
Anybody know what could be happening?
mystring db "This is my string", 0
mystring.length equ $-mystring
However, when placing two of these blocks back to back, I get wildly unexpected results:
a db 'Hello, world! A'
alength equ $ - a
b db 'Hello, world! B'
blength equ $ - b
alength now equals 30, whiles blength equals 20. Expected result is 15 for both.
Anybody know what could be happening?