MASM64 is a 64-bit version of the MASM32 software development environment (SDK) for programmers using Microsoft's Assembler (MASM) to target 64-bit Windows. DO NOT USE THIS TAG FOR REGULAR 64-BIT ASSEMBLY PROGRAMMING (instead use [x86-64] and [assembly]).
Questions tagged [masm64]
60 questions
3
votes
2 answers
How do you differentiate "MOV r/m64, imm32" vs "MOV r/m32, imm32" in MASM64?
The Intel manual says mov has two variants involving both memory and 32-bit immediate operands:
MOV r/m32, imm32
MOV r/m64, imm32
The first one copies four bytes, the second copies eight, taking the given 32-bit immediate and sign-extending it to…

Ian Hickson
- 8,174
- 1
- 29
- 22
3
votes
1 answer
Accessing a variable that crosses a MMU page boundary
I am learning X64 assembly language under Windows and MASM64 from the latest edition of the book "The art of 64 bit assembly language".
I have a question regarding that quote from the book:
You do have to worry about MMU page organization in memory…

Danny Cohen
- 77
- 10
3
votes
1 answer
masm directive option prologue:none has no effect
I'm learning how to use masm using MS's official docs, but there's almost nothing written on the option directive (https://learn.microsoft.com/en-us/cpp/assembler/masm/option-masm?view=msvc-170). It was used in the standard library implementation of…

Badasahog
- 579
- 2
- 19
2
votes
1 answer
RET x versus ADD RSP, x in x86-64 assembly
I am writing a program in MASM64.
I use WinAPI a lot.
I don't use the push and pop instructions, I use mov [rsp + x] instead.
I don't use local variables.
I don't use prolog/epilog.
I don't use RBP at all.
I do use sub rsp, x to preserve a shadow…

Danny Cohen
- 77
- 10
2
votes
1 answer
Algorithm to convert binary big integer to scientific notation with truncation to a 1-digit mantissa
I have a very big unsigned binary big integer in the scale of 6*10^120.
Assume the big integer is stored in a struct of many QWORD (8 bytes) unsigned integers or several YMM registers.
I want to display it in decimal (not binary) scientific notation…

Danny Cohen
- 77
- 10
2
votes
1 answer
RIP corrupt after I call WinApi function
I have a wrong RIP after I call CreateWindowExA, but it's corrupt after NtUserCreateWindowEx which I find out via x64dbg, maybe I do something wrong with the stack allocation.
There are my code:
include win64a.inc
.code
WinMain proc
push rbp …

mantissa
- 132
- 7
2
votes
1 answer
x64 fastcall caller stack management
MSDN says
Integer valued arguments in the leftmost four positions are passed in left-to-right order in RCX, RDX, R8, and R9, respectively.
Space is allocated on the call stack as a shadow store for callees to save those registers.
Remaining…

mantissa
- 132
- 7
2
votes
1 answer
Would like to view Intel opcodes from assembly code
Would there be any other method on how to go about doing this without having to use the Intel manuals? Would it be possible to simply compile small and short ASM program using MASM64 and then using a hex editor to view the machine code thereafter ?

Jkf1298
- 31
- 2
2
votes
1 answer
How to assemble and link with ml64 in true 64-bit mode (with LARGEADDRESSAWARE)?
I am working on reworking an old masm program to true 64-bit x64 mode using Microsoft's ml64 and link on Windows 10. The linker gives an error in code that has a REX.W prefix.
The linker's /LARGEADDRESSAWARE option sounds like the right thing for…

Vikors
- 21
- 1
1
vote
0 answers
Error Code:A2206 missing operator in expression visual studio 2022 masm64
hello how can i fix error A2206 missing operator in expression every line have rel
Severity Code Description Project File Line Suppression State
Error A2206 missing operator in expression OpenParrot …

คุณเม่น KhunMenn
- 11
- 2
1
vote
0 answers
I want to call MASM functions with Inline or macro
I would like to be able to Inline MASM Functions in C code like this:
myfunction macro
...
myfunction endm
int main()
{
myfunction;
}
can call it using extern "C"
but then MyFunction will be called in many places…

i like cat
- 135
- 8
1
vote
0 answers
Why does the MASM symbol RAX return true for both IFDEF and IFNDEF?
Recently was working on a project to include 64-bit code when assembled under ML64.exe. However, this code actually included the 32-bit MASM directives, so the build failed.
IFNDEF RAX
.686P
.MODEL FLAT,STDCALL
OPTION CASEMAP:NONE
OPTION…

vengy
- 1,548
- 10
- 18
1
vote
1 answer
Define procs whose name is from a macro parameter using MASM 64
Is it possible to define procs where the name is derived from the inputs in a macro, using MASM 64? (ml64.exe)
Eg, something similar to below, where @(value) just places the 'value' in to the source.
proc_creator macro name, value
foo_@(name)…

BJury
- 2,526
- 3
- 16
- 27
1
vote
1 answer
MASM not assembling all files
I have a C++ project in Visual Studio 2022, which creates a .dll which calls a function created by the MASM assembler. The assembler - ml64 - however does not consider a single .inc file, and so fails with a error LNK2019: unresolved external symbol…

BJury
- 2,526
- 3
- 16
- 27
1
vote
1 answer
Error LNK2019 unresolved external symbol A referenced in function ARoutine
I've been grappling with this for about a day now and have yet to find the solution. I'm trying to access a global variable, declared in main.cpp, from an Testing.asm file with both files in the same project using Visual Studio 2019. But I'm getting…

Jkf1298
- 31
- 2