News:

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

Problems with a dword ptr

Started by ragdog, September 12, 2009, 10:20:49 PM

Previous topic - Next topic

ragdog

Hi

I have a problem with store a 3 signs to a dword pointer and gives this to a subroutine



AddItem PROTO :DWORD,:DWORD,:DWORD

             .if eax==0
                     mov DWORD PTR [eax],    "(-;"
                     push eax
              .else
                   push offset hBuffer

             .endif
   
                  push offset hName2
          push offset hName1
          call AddItem


Thanks for your help

qWord

you are accessing an invalid address:

.if eax==0
mov DWORD PTR [eax],"(-;" ; DWORD located at 0 ???
...


regards, qWord
FPU in a trice: SmplMath
It's that simple!

ragdog

Thanks

Must i set a buffer variable in the data section

can i this not make with register?

qWord

not sure what you want to make, but what is about using an local string buffer:


xyz proc .....
LOCAL szBuffer[4]:BYTE

mov DWORD ptr szBuffer,";-("
...
.if eax == 0
lea eax,szBuffer
push eax
...

xyz endp
FPU in a trice: SmplMath
It's that simple!

ragdog

Ok

Yes this works



My Question is can i make this without use a szString in the data section or buffer variable in the data? section  ????


qWord

if you want to pass a string pointer, you have to use an buffer containing your string.
FPU in a trice: SmplMath
It's that simple!

ragdog

Ahh ok thanks

this was my question

greets,
ragdog