Author Topic: Obscure test piece result.  (Read 112 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4335
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Obscure test piece result.
« 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
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

TWell

  • Member
  • ****
  • Posts: 672
Re: Obscure test piece result.
« Reply #1 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
-- Tim

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4335
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Obscure test piece result.
« Reply #2 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
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: