The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: shankle on June 16, 2014, 06:40:36 AM

Title: RR:RECT
Post by: shankle on June 16, 2014, 06:40:36 AM
To the best of my knowledge RR:RECT is 4  Double Word fields.
In my program holdright, holdleft, holdtop and holdbottom are defined
as Q words. How can I resolve this problem?
Thanks for any help.
Title: Re: RR:RECT
Post by: Yuri on June 16, 2014, 01:05:52 PM
Use the low dwords of them? :icon_rolleyes:
Title: Re: RR:RECT
Post by: jj2007 on June 16, 2014, 03:17:07 PM
Or define them as DWORDs? After all, it's your own code (http://masm32.com/board/index.php?topic=691.20).
Title: Re: RR:RECT
Post by: dedndave on June 17, 2014, 12:28:27 AM
i would think the 64-bit include files take care of that for you ?
Title: Re: RR:RECT
Post by: shankle on June 17, 2014, 02:49:30 AM
Being that I have no control over RECT, maybe it can be solved this way
in 64-bit GoAsm.

    holdleft   dq  0
    xor rax, rax
    mov eax, [RR,left]
    mov Q[holdleft], rax
Title: Re: RR:RECT
Post by: qWord on June 17, 2014, 03:18:16 AM
Being that I have no control over RECT
You should define holdright, holdleft, holdtop and holdbottom as DWORDs!

maybe it can be solved this way
in 64-bit GoAsm.

    holdleft   dq  0
    xor rax, rax
    mov eax, [RR,left]
    mov Q[holdleft], rax

The RECT members are signed and you may better use MOVSXD for conversion.
Title: Re: RR:RECT
Post by: shankle on June 17, 2014, 04:29:25 AM
Now I am really confused.
In the past I have been coding hard addresses in textout, rectangle, bitblt etc.
Now I am tying to put variable addresses in those fields.
That means I am trying to use 64-bit values.
That's why I felt I needed a 64-bit holdleft, holdright, holdtop and holdbottom.
From what you guys are saying this is not possible. BUT it's supposed to be
a 64-bit program. That means to me that 64-bit programs have a ton of
32-bit stuff in them....
Title: Re: RR:RECT
Post by: qWord on June 17, 2014, 05:37:34 AM
Only pointer types (handles are also pointer types!) need to be 64 bit width. If you are not sure about the size of a specific type, look up the definition in windows SDK headers (or msdn).
Generally, it is wise to use 32 bit instruction when possible, because these have a shorter encoding (with a few exceptions of course).