The MASM Forum

General => The Laboratory => Topic started by: hutch-- on April 12, 2017, 06:14:44 PM

Title: Obscure test piece result.
Post by: hutch-- on April 12, 2017, 06:14:44 PM
Tried to use the current location counter "$" in a 64 bit test piece with /LARGEADDRESSAWARE and got this result.

    mov rax, QWORD PTR [rcx][$+64]

    ; POLINK: error: Relocation type ADDR32 is invalid without /LARGEADDRESSAWARE:NO, for symbol '$$00000C'

So much for that theory.  :P
Title: Re: Obscure test piece result.
Post by: TWell on April 12, 2017, 07:33:55 PM
is this same for that purbose?
Code: [Select]
mov rdx, $+64 ;48BA4400000000000000
mov rax,qword ptr [rdx+rcx] ;488B040A
Title: Re: Obscure test piece result.
Post by: hutch-- on April 12, 2017, 10:39:38 PM
Thanks Tim,

I don't know if this is useful but at lest it builds OK.

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

    include \masm32\include64\masm64rt.inc

    .code

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

entry_point proc

    LOCAL .rsp  :QWORD
    LOCAL hInstance :QWORD

    invoke GetModuleHandle,0
    mov hInstance, rax

    mov rdx, $
    sub rdx, hInstance

    add rdx, 127
    and rdx, -128       ; align rdx by 128 bytes relative to hInstance

    conout str$(rdx),lf,lf

    waitkey
    invoke ExitProcess,0

    ret

entry_point endp

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

    end