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
0
votes
0 answers
A2022 Operands must be the same size - putting address of a DB into register
I wrote a simple Hello World program and when I run that, I have this error: "error A2022:instruction operands must be the same size".
.DATA
msg DB "Hello World", 10
len EQU $ - msg
.CODE
Main PROC
Print PROC
MOV RAX, 4
MOV RBX,…
0
votes
0 answers
How to adjust 32-bit MMX MASM code embedded with C to compile in 64-bit?
I'm trying to convert an inherited 32-bit Windows app to 64-bit. I'm hung up on this bit which was embedded in the 32-bit C file:
__asm {
pxor mm0,mm0
punpcklbw mm0, dword ptr[x]
... }
'x' is a structure in C.
As required by MASM…

Randy Jay Yarger
- 141
- 1
- 7
0
votes
0 answers
Changing endianess of a large chunk of memory
I've got 64 bytes of continuous memory organized into big-endian DWORDs. I'd like to copy this data and and organize as little-endian elsewhere. I could do that DWORD after DWORD, e. g.:
mov eax, [rsi + rcx]
bswap eax ; setting proper…

mdx
- 534
- 3
- 16
0
votes
0 answers
X64 ASM: a 256-bit MOV to register possible?
I have a 256-bit data structure (a 4 int64 array) that I need to load and perform (integer) addition on in X64 assembler. Instead of doing 4 MOVs, I'm trying to load all 4 with a single instruction. Is this possible? I thought I could do it with…

Endymio
- 35
- 6
0
votes
1 answer
How are registers designated in Intel machine language?
I've been looking at Intel machine language, both in the generated code that's shown in an assembly listing, and in a dump of the executable file itself, as generated from a program written in MASM. I can't figure out how the registers are referred…

Robert Watson
- 39
- 4
0
votes
1 answer
Trying to learn x86 Assembly, getting odd results in simple test program
I'm attempting to learn the basics of x64 assembly language from the 2nd Edition of Modern x86 Assembly Language Programming.
The fifth example program in chapter 2 introduces how to perform simple integer division using various width parameters,…

Mark Edwards
- 108
- 7
0
votes
0 answers
Calling FormatMessageA from a 64 bit assembler program
I've been working for days on an assembler subroutine to call Windows API function FormatMessageA, and I think I must have some systematic misunderstanding. My routine is shown below. I have traced it in debug mode, and I know that at the time the…

Robert Watson
- 39
- 4
0
votes
0 answers
Size of shadow area on the stack in assembler language
I found the sample program below somewhere on the Web. Various copies of it abound, usually with small differences. But my question concerns the size of the shadow area at the top of the stack when calling a function from the Windows API. This…

Robert Watson
- 39
- 4
0
votes
1 answer
Why WriteConsoleW breaks After call CoInitialize using ml64
I am trying to do some Office automation via 64-bit assembly using ml64.exe from Visual Studio 2019. Before I can call the Office COM interfaces I need to call CoInitialize. I am currently just testing initializing COM and writing to the console (I…

Malcolm McCaffery
- 2,468
- 1
- 22
- 43
0
votes
0 answers
Cannot open input file Resources.res
Please help me on this problem i have searched a lot and found no answer when i build any project in MASM64 i get this error
LINK : fatal error LNK1181: cannot open input file 'C:\Users\emad\Desktop\EmadMASM\Win64App\Release\Resource.res'
I have…

algeb geo
- 1
- 1
-1
votes
1 answer
Why does + act differently for constants vs the rest of data types in x64 assembly language?
If I have a quad word named "a", this instruction: MOV RAX, a + 3 will offset the address of a by 3.
When i do the same thing with a constant (a EQU 10), MOV RAX, a + 3 will move into rax in binary the number 13.
Why does the cpu do that if it is…

mateiway
- 1
-1
votes
1 answer
WM_DESTROY message not being received by WndProc in x64 Windows Assembly Program
I'm trying to recreate using MASM /w Visual Studio 2019 something similar to the following C++ code which works. Essentially at this stage just want the window to be movable and the close button to work.
#include
#include…

Malcolm McCaffery
- 2,468
- 1
- 22
- 43
-2
votes
2 answers
source not found initsect.cpp
I am trying to learn Assembly(MASM x64) and wrote a simple code.
.code
main proc
mov rax, 1
mov rcx, 2
mov rdx, 0
div rcx
ret 0
main endp
end
Now I started a debugging process to see that it works(as there is no other way to check if something…

Tarelenion
- 1
- 4
-3
votes
1 answer
X64 assembler with visual studio 2022 integration
I am learning Intel X64 assembly language under Windows 11.
Currently I'm using the latest Visual Studio 2022 preview with its built-in MASM64.
I have looked everywhere for a good assembler and/or a good assembly IDE.
I tried all of those:…

Danny Cohen
- 77
- 10