News:

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

LOCAL declaration problem

Started by donkey, March 31, 2009, 01:30:13 AM

Previous topic - Next topic

donkey

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
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Edgar

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



[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

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 :)
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable