News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

RECT Structure

Started by frozen, August 05, 2020, 06:51:25 AM

Previous topic - Next topic

hutch--

 :thdn:

> Now yet again when a new member asks a question, the topic get flooded out with nonsense.

You are confusing a high level emulation with the function of assembler which in this case is 16 bytes of memory. As a structure its 16 bytes of STACK memory as a LOCAL or 16 bytes of either initialised or uninitialised memory. Likewise it can be 16 bytes of allocated memory. In MASM a 32 bit register is not sign specific and neither is an address in memory.

Try using the conditional jumps on the reverse data types. JG works fine on a bare DWORD just as JA works fine on an equated DWORD because the conditional testing is what decides whether the evaluation is either signed or unsigned.

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    include \masm32\include64\masm64rt.inc

    .code

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

entry_point proc

    USING r12,r13,r14,r15
    LOCAL pMem :QWORD

    SaveRegs

    mov pMem, alloc(64)             ; address in rax

    mov r12d, 1
    mov r13d, -2
    mov r14d, 3
    mov r15d, -4

    mov DWORD PTR [rax], r12d
    mov DWORD PTR [rax+4], r13d
    mov DWORD PTR [rax+8], r14d
    mov DWORD PTR [rax+12], r15d

    conout "Spot the difference",lf

    waitkey
    RestoreRegs
    .exit

entry_point endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    end

> Now yet again when a new member asks a question, the topic get flooded out with nonsense.