The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: korte on August 02, 2009, 09:36:47 AM

Title: assume struct probblem
Post by: korte on August 02, 2009, 09:36:47 AM


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



Title: Re: assume struct probblem
Post by: MichaelW on August 02, 2009, 09:50:05 AM
Try:

mov [ebx]._apple, 0
Title: Re: assume struct probblem
Post by: Slugsnack on August 02, 2009, 09:53:18 AM
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
Title: Re: assume struct probblem
Post by: MichaelW on August 02, 2009, 10:00:42 AM
This syntax is shorter, and it also does not require an ASSUME statement:
[ebx].mys._apple
Title: Re: assume struct probblem
Post by: Slugsnack on August 02, 2009, 10:06:06 AM
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
Title: Re: assume struct probblem
Post by: korte on August 02, 2009, 10:43:12 AM
mov [ebx]._apple, 0  work.

thx.   :U :clap: :clap: :U
Title: Re: assume struct probblem
Post by: ecube on August 02, 2009, 12:04:58 PM
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.
Title: Re: assume struct probblem
Post by: dedndave on August 02, 2009, 12:11:46 PM
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