Author Topic: RR:RECT  (Read 3844 times)

shankle

  • Member
  • ****
  • Posts: 857
RR:RECT
« 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.

Yuri

  • Member
  • **
  • Posts: 175
Re: RR:RECT
« Reply #1 on: June 16, 2014, 01:05:52 PM »
Use the low dwords of them? :icon_rolleyes:

jj2007

  • Member
  • *****
  • Posts: 10634
  • Assembler is fun ;-)
    • MasmBasic
Re: RR:RECT
« Reply #2 on: June 16, 2014, 03:17:07 PM »
Or define them as DWORDs? After all, it's your own code.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: RR:RECT
« Reply #3 on: June 17, 2014, 12:28:27 AM »
i would think the 64-bit include files take care of that for you ?

shankle

  • Member
  • ****
  • Posts: 857
Re: RR:RECT
« Reply #4 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

qWord

  • Member
  • *****
  • Posts: 1476
  • The base type of a type is the type itself
    • SmplMath macros
Re: RR:RECT
« Reply #5 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.
MREAL macros - when you need floating point arithmetic while assembling!

shankle

  • Member
  • ****
  • Posts: 857
Re: RR:RECT
« Reply #6 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....

qWord

  • Member
  • *****
  • Posts: 1476
  • The base type of a type is the type itself
    • SmplMath macros
Re: RR:RECT
« Reply #7 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).
MREAL macros - when you need floating point arithmetic while assembling!