The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: donkey on March 31, 2009, 01:30:13 AM

Title: LOCAL declaration problem
Post by: donkey on March 31, 2009, 01:30:13 AM
Hi Jeremy,

There is a problem when declaring structures locally, the following code demonstrates it:

CHARSTRUCT STRUCT
i DB
ENDS

CODE SECTION

Start:
PrintDec(esp)
invoke TestLocals,0
ret

TestLocals FRAME jsd
LOCAL CharArray[1024] :CHARSTRUCT

invoke lstrcpy,offset CharArray,"Hello there how are you"

PrintDec(esp)

RET
ENDF


ESP has the following values:
Line 119: esp = 1245076
Line 130: esp = 1245060

They should be:
Line 119: esp = 1245076
Line 130: esp = 1244040

Edgar
Title: Re: LOCAL declaration problem
Post by: jorgon on March 31, 2009, 09:32:52 PM
Edgar

Here is the fix for this bug where local structures are not being repeated.



[attachment deleted by admin]
Title: Re: LOCAL declaration problem
Post by: donkey on March 31, 2009, 09:49:25 PM
Works perfectly, thanks Jeremy. This should hopefully be the last of the issues I'll find while implementing the complete Headers32/64 project, I think I have pushed the envelope to the max in what can be done with type defs so I think you're in for a long deserved break from my incessant bug reports :)