The MASM Forum

General => The Campus => Topic started by: yrendy on November 04, 2019, 11:09:08 PM

Title: INVOKE error when compile x64 with VS2019
Post by: yrendy on November 04, 2019, 11:09:08 PM
Hi guys, Im new with masm. Tried to compile simple program that calling
Quote
ExitProcess proto
but when I tried to compile it says
Quote
error A2008:syntax error : invoke
I tried the normal call with manual registry assign to RCX and its working.

My ml64 version: 
Quote
Macro Assembler (x64) Version 14.23.28106.4
I also tried example from Mikl__'s ml64 examples and it works whenever no INVOKE syntax.
Is this ml64 specific problem with vs2019?
Title: Re: INVOKE error when compile x64 with VS2019
Post by: hutch-- on November 04, 2019, 11:37:45 PM
ML64 does not have a default "invoke", it can only be done with the pre-processor. The 64 bit version of MASM64 has this capacity.
Title: Re: INVOKE error when compile x64 with VS2019
Post by: yrendy on November 04, 2019, 11:49:56 PM
Oh okay thanks hutch. Been searching for an hour why the invoke doesnt work  :biggrin:
Title: Re: INVOKE error when compile x64 with VS2019
Post by: Mikl__ on November 26, 2019, 03:33:22 PM
Hi, yrendy!
for use "invoke" I connect the file win64a.inc
File win64a.inc contents:
Code: [Select]
OPTION DOTNAME
OPTION PROLOGUE:rbpFramePrologue
OPTION EPILOGUE:none
;--------------------------------------
include win64.inc
include temphls.inc <---
include kernel32.inc
includelib kernel32.lib
include ntdll.inc
includelib ntdll.lib
include user32.inc
includelib user32.lib
include msvcrt.inc
includelib msvcrt.lib
include ole32.inc
includelib ole32.lib
include gdi32.inc
includelib gdi32.lib
include comctl32.inc
includelib comctl32.lib
include comdlg32.inc
includelib comdlg32.lib
include shell32.inc
includelib shell32.lib
;---------------------------
pushaddr macro x
db 68h
dd x
endm
;----------------------------------
IMAGE_BASE equ 400000h
;---------------------------------
du macro string
local bslash
bslash = 0
irpc c,<string>
if bslash eq 0
if '&c' eq "/"
        bslash = 1
elseif '&c'gt 127
db ('&c'- 0B0h),4
else
dw '&c'
endif
else
           bslash = 0
           if '&c' eq "n"
           DW 0Dh,0Ah
           elseif '&c' eq "/"
           dw '/'
           elseif '&c' eq "r"
           dw 0Dh
           elseif '&c' eq "l"
           dw 0Ah
           elseif '&c' eq "s"
           dw 20h
           elseif '&c' eq "c"
           dw 3Bh
           elseif '&c' eq "t"
           dw 9
   endif
endif
endm
dw 0
endm
There are macros "invoke" and conditional constructions (.if, .while, .for and etc.) in file temphls.inc
In beginning of any asm-file
Code: [Select]
; GUI # <-- subsystem for bat-file
include win64a.inc <---- macros, inc- and lib-files
.code
 . . . .