News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

assume struct probblem

Started by korte, August 02, 2009, 09:36:47 AM

Previous topic - Next topic

korte



mys struc
_apple   dd ?
_grappe dd?
mys ends

  assume ebx: ptr mys

  mov [ebx._apple],0  <- symbol not found

  mov [ebx.mys._apple],0  <-work




MichaelW

eschew obfuscation

Slugsnack

ps. just in case you didn't know, for single line 'assume's i personally prefer to do it like this :

(mys PTR [ebx])._apple

MichaelW

This syntax is shorter, and it also does not require an ASSUME statement:
[ebx].mys._apple
eschew obfuscation

Slugsnack

also bear in mind after assuming a register is a pointer to a structure you should assume it is 'nothing' again once you're done using it as such with :

assume ebx:nothing

korte

mov [ebx]._apple, 0  work.

thx.   :U :clap: :clap: :U

ecube

the assume ebx:nothing is important, I got the most annoying/confusing errors 1 time in my 20,000+ line project and I couldn't figure out wat is was. It happened to be I forgot to assume ecx:nothing hehe.

dedndave

i had a similar bit of fun the prologue/epilogue - lol
those kind of mistakes are hard to find because the instruction-generating code looks good