Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FASM $ keyword

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?

Name: Anonymous 2011-06-02 21:46

LOL LACK OF NULL TERMINATION

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List