News:

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

Main Menu

Migrating from 32-bit to 64-bit assembly. Things You should know

Started by coder, January 20, 2017, 02:25:51 AM

Previous topic - Next topic

coder

Please correct me if I am wrong. I have prepared a short list of these things as far as my noobish experience is concerned. Could be useful to new migrators.

1. [DELETED]

2. [DELETED].


[End of the 'short' list. Please continue to number 2 and beyond]  :greenclp:


hutch--

ML64 does not support invoke but MASM64 does. Test piece below works fine.

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

    include \masm32\include64\masm64rt.inc

    .code

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

entry_point proc


    mov rcx,0FFFFFFFFFFFFFFFEh   ;ok
    xor rcx,0FFFFFFFFFFFFFFFEh      ; not in your dream buddy
    ;; push 0fffffffffffffffeh      ; leave the stack alone

    invoke MessageBox,0,"MASM64 does support 'invoke' notation","Correct",MB_OK

    ;; pop 0fffffffffffffffeh       ; leave the stack alone

    waitkey

    invoke ExitProcess,0

    ret

entry_point endp

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

    end

coder

Good! I know that :D

But I was referring to the instruction set. Don't understand why ML64 skips "invoke". It's a valid x86 instruction anyway. Seems like ML64 is not in complete agreement with the ISA.


hutch--

"invoke" is not an Intel mnemonic, its originally in the 16 and 32 bit versions of MASM a method to automate procedure calls. The invoke in the example is a macro as 64 bit MASM is an unconfigured low level assembler but it is a MACRO assembler which makes these macros possible.


coder

So I deleted number 1 or 2. Must have read it wrong somewhere  :eusa_boohoo:

So the list is opened from point #1 then  :lol:

jj2007

Quote from: hutch-- on January 20, 2017, 02:36:13 AM
ML64 does not support invoke but MASM64 does. Test piece below works fine.

Even this one assembles without errors:
invoke MessageBox, 0, "MASM64 does support 'invoke' notation", "Correct", MB_OK, 123, "that's great"

Here you can find a beautiful .if macro that improves on ugly obsolete MASM syntax like .if eax<=ecx 8)

;)

Vortex

Quote from: coder on January 20, 2017, 02:39:27 AM
Don't understand why ML64 skips "invoke"

Probably, MS is "trying" to discourage the coders from using ml.exe

ragdog

QuoteHere you can find a beautiful .if macro that improves on ugly obsolete MASM syntax like .if eax<=ecx

:lol: :icon_rolleyes:

hutch--

 :biggrin:


invoke MessageBox, 0, "MASM64 does support 'invoke' notation", "Correct", MB_OK, 123, "that's great"


If your grasp of 64 bit assembler is so poor, perhaps you should stick to Visual Garbage generators.

> Here you can find a beautiful .if macro that improves on ugly obsolete MASM syntax like .if eax<=ecx

Well, real men[TM] code the serious stuff in mnemonics where it matters, not everyone is rusted onto 1990 Microsoft code, especially Microsoft.  :badgrin: