613 questions
1
vote
1
answer
66
views
Bypassing A2041 in a VARARG macro
I have a pretty simple ENUM macro in MASM32 that uses VARARGs to assign incrementing values to symbols:
ENUM MACRO vargs:VARARG
LOCAL num_
num_=0
FOR varg,<vargs>
varg EQU ...
-2
votes
1
answer
90
views
How did `masm32` get to be hosted on a separate website? [closed]
Here is the masm website https://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
and here is that for masm32 : http://masm32.com/index.htm
When I run both ...
0
votes
0
answers
57
views
Is there a setting in Visual Studio 2022 Community that might cause strange MASM assembly results?
I use Visual Studio 2022 Community Edition to assemble and link MASM source code generally intended to create Win32 x86 executable programs. I am working on a program that manipulates data for a ...
1
vote
0
answers
110
views
Why are the EndDialog and ExitProcess instructions in this sample MASM32 code for x86 not being executed?
In the sample program, I used DialogBoxParam to create a dialog box (dialog box #1) with a 2 menu options (Help1 & Exit1) and 2 corresponding buttons (Help1 & Exit1).
The Help1 option executed ...
0
votes
1
answer
107
views
How do I fix error c101008e: Failed to create the manifest from the identity string:
In response to a question I asked a few days ago, I was advised that I needed to setup a Manifest to use cuebanners in the CueBannerDemo program I created for testing.
So, after reading about &...
0
votes
1
answer
154
views
What does setting a cuebanner do and how do I get it to work?
I asked a question a few days ago and someone suggested setting a cuebanner rather showing a messagebox using WM_MOUSEHOVER. So I wanted to try setting a cuebanner as suggested.
I wrote a demo program ...
1
vote
0
answers
228
views
How can I load symbolic information in Codeview 3.14 from an .exe built with MASM32, ml.exe and link16.exe?
I cannot use ml.exe (MASM32) to directly build an 8086 .asm source. But I was successful doing it separately: first ml /Zi /c ... and then link16 /codeview .obj,,,, (this is the linker for 16 bit. &...
0
votes
0
answers
61
views
Simulation of Virtual Memory Management with Swapping and Access Protection in assembly
these are my project requirements
Simulated RAM: A region of fixed size to simulate RAM (e.g., 4 MB).
Use VirtualAlloc to reserve two memory regions:
Virtual Memory: A larger region to simulate ...
0
votes
0
answers
63
views
MasmBasic assembly code to encrypt any file problem
I had problem with line 15
test.asm(15) : error A2008: syntax error : ,
the code
include \masm32\MasmBasic\MasmBasic.inc
.data
key db "AMU", 0
keyLength db 3,0
Init
Let esi = ...
0
votes
0
answers
63
views
MASM32, try to add two user's inputs, however I get letter from ADD [duplicate]
.386
.model flat, stdcall
option casemap: none
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
...
1
vote
0
answers
52
views
LNK2001 & LNK1120 when trying to include library
I'm trying to include a custom library in MASM32. The library in question is stb_vorbis, it's written in a single .c file and I compile it using the following:
gcc -c stb_vorbis.c -o stb_vorbis.obj
ar ...
0
votes
0
answers
96
views
RegOpenKeyExA returns error 998 ERROR_NOACCESS in MASM
I tried to write a MASM program that creates new registry key for my exe file:
; Set hKey with RegOpenKeyExA
Xor Ecx, Ecx
Lea Ebx, [Ebp - 52H]
Push Ebx ; phkResult
Push 2H ...
1
vote
1
answer
71
views
x86 MASM check for palindrome
I’m learning x86 MASM and stuck in a project. The code should be fairly simple but I have no idea what I did wrong, it's supposed to check for Palindrome from an array of characters, but the code ...
0
votes
0
answers
33
views
Convert binary to hexadecimal using MASM32
This is my MASM32 code:
include\masm32\include\masm32rt.inc
.data
n dd 0
.code
convertBH proc num:dword, output:dword
local temp:dword
local index:dword
local hex:dword
local ...
1
vote
0
answers
71
views
Cant understand why this code output in a result:ERROR
I think I'm using the right commands to do this task, but for some reason the result is wrong.
I have already tried to change this string _res1 db 14 DUP(0),10,13. I also tried to change dword on ...
1
vote
1
answer
85
views
In MASM what is array[4]
I have a code in MASM, which contains
mov bx, 4
mov ax, array[bx] + 4
So array[4] here is the fifth element of the array or 4 bytes and then we add 4 bytes ?
What will be the value of AX then?
0
votes
0
answers
157
views
Copy a register's content to an immediate memory address in assembly [duplicate]
In MASM 32 how can I copy the value of a register (for example AL) to an immediate fixed address in the memory (for example address 30h).
So like this
MOV [address], register
I tried this with MOV
...
0
votes
1
answer
116
views
x86 ASSEMBLY: Issues getting WriteConsole to work, returns 0
I'm a beginner to x86 assembly, I only just got my code to actually assemble for the first time.
I'm making a calculator program to learn and I need to print to the console to prompt the user for ...
0
votes
1
answer
252
views
MASM x64 Assembly printf float
.data
temp real4 ?
fmtStr byte 'Result is: %d', 10, 0
fmtStr2 byte 'Result is: %f', 10, 0
i real4 ?
.code
printFloat proc
sub rsp, 20h
movsd xmm1, [temp]
lea rcx, fmtStr2
call printf
...
0
votes
0
answers
41
views
problem with assembly code after rewriting with 16bit [duplicate]
I've had an assembly (MASM x86) code for doing this C++ equation
void main()
{
unsigned int i, B[10], A[10]={3,2,3,1,7,5,0,8,9,2};
for (i=0; i<10; i++){
B[i] = A[i] + 2 * (2*i + ( (3*i+1) / 5) );
}...
0
votes
0
answers
70
views
Trying to run MASM code for a few different operations to run, but Keep getting the error A2074 cannot access label through segment register
This is my assignment:
make sure you installed MASM correctly and that you can run/debug your simple assembly language.
Run the following calculations using MASM and assign the result to the same or ...
0
votes
1
answer
369
views
I am getting error A1000: cannot open file: Irvine32.inc however I included in the code and posted the right directory in the linker
I am writing a program in MASM that will clear the screen, prompt the user for two integers, and perform the arithmetic and then output it back. However, I can not call Clrscr because the compiler ...
4
votes
1
answer
92
views
uhex$ in masm assembly
I have this block of code here on Intel structure and I wonder why uhex$(ebx)+6 ? What is the +6 in there is for ? Can some one explain it to me ?
.code
start:
...
WinMain proc hInst:HINSTANCE,...
1
vote
1
answer
44
views
How to change one or more characters from a string entered into the keyboard in MASM32
movzx eax, byte ptr [a]
movzx ebx, byte ptr [m]
add al, bh
I used the above command but the program doesn't show anything
I want to change the characters according to the Caesar cipher, that is, the ...
0
votes
0
answers
344
views
How can I write self-modifying code on Windows?
When I was learning to program in assembler on a DOS system - the program could change its own code while the program was running and see it in the debugger. For some reason it doesn't work on Windows....
0
votes
0
answers
54
views
Problem with writing a file that is more than 512 bytes in assembly
My code implements the Caesar Cipher, it asks the user the name of the input file which contains the string i want to be encrypted/decrypted, the name of the output file and the key/cipher, my problem ...
2
votes
1
answer
151
views
How can I fix my Caesar Cipher implementation in assembly language to read multi-digit keys?
My code implements the Caesar Cipher, it asks the user the name of the input file which contains the string i want to be encrypted/decrypted, the name of the output file and the key/cipher, my problem ...
1
vote
0
answers
443
views
Trouble linking C program with assembly file in Visual Studio 2019; Invalid or Corrupt File Cannot Read
I need to run masm assembly code in a C program for a project, as a test I'm trying to make a simple function that adds two numbers together and use it in a C program. I created a new project in ...
-1
votes
1
answer
54
views
array or what is this?
I met a line of code like "LOCAL Path[1000]:BYTE".
As far as I understand, it allocates space on the stack for a local variable, but I cannot understand why there are square brackets here. ...
0
votes
0
answers
47
views
How to compare number with STRUCT Field?
I tried to output structs that less than entered value, but it either print all structs or print nothing. I initialize some structs (in my case 3 objects), then enter value from keyboard, convert it ...
0
votes
1
answer
70
views
Why did I get "too many initial values for structure" [duplicate]
I tried to create structure (you may see it in code below), but when I craete the structure item I get error "error A2036: too many initial values for structure". What wrong with it?
.686
....
1
vote
1
answer
67
views
Create a MASM program that converts the temperature from Celsius to Fahrenheit
I keep getting an "Integer overflow" on line idiv dword ptr [NINE]. Is there another way I can rewrite this to get my MASM to run properly and give me the answer 59°F in memory?
.386
.model ...
0
votes
0
answers
93
views
How to use LZMA SDK in MASM32 Assembly program?
I want to decompress data that is compressed by using LZMA SDK in MASM32 program.
I found some assembly files such as LzmaDecOpt.asm in the LZMA SDK.
https://github.com/kornelski/7z/blob/main/Asm/x86/...
0
votes
0
answers
85
views
Pointer to a IMAGE_NT_HEADERS(masm32)
I came across the following lines of code:
assume esi:ptr IMAGE_NT_HEADERS
lea esi,[esi].OptionalHeader
and for the second day I can’t figure it out:
1.why you don’t need to specify the data type ...
0
votes
1
answer
243
views
Decoding bas64 string in asm (masm32 ) by crypt32
I have been recently occupied in learning assembly and i'm now playing with masm32 and crypto API, but i need a little help to start.
How can i decode an input string base64 encoded using ...
-2
votes
1
answer
143
views
Convert Binary to Decimal in MASM32
Convert decial to binary in MASM32. Help me
include \masm32\include\masm32rt.inc
.code
start:
call main
exit
main proc
LOCAL var1: DWORD
LOCAL dem: DWORD
mov var1, sval(input("...
0
votes
0
answers
91
views
How to print all fields of structure in MASM32?
I am studying masm32 programming.
I am making a simple PE header reading program with masm32, I can print e_magic field's value(MZ) of IMAGE_DOS_HEADER structure.
invoke dw2hex,dosHeader.e_lfanew,...
0
votes
0
answers
211
views
Floating-point operations in MASM32
So, I have a code, in which I'm calculating a/b-d*c. Separately, it works just fine, but if I'm trying to put it into my project code, I'm getting "f" or "0.0e..." after ...
0
votes
1
answer
57
views
undefined symbol : crt__itow_s
I got a piece of code:
push 0Ah ; Radix
push 2 ; fSizeInWords
lea eax, [ebp+DstBuf]
and dword ptr [ebp+DstBuf], ...
-1
votes
1
answer
118
views
Sort the characters of a string in ascending order using masm32 programming language [duplicate]
I am trying to make a program that accepts user input and sorts the characters of a string input in ascending order.
-1
votes
1
answer
2k
views
MASM32 Assembly does not work in Visual Studio
I wanted to start learn Assembly but it did not run any way. First I tried with py il with python but it did not work. Now I have a Visual Studio 2022 and I installed the MASM32. The problem is Visual ...
0
votes
0
answers
266
views
How do you convert a string to an integer in MASM32 Assembly language?
I am having trouble showing if the number is odd or even. Is there a better way to get user input? It looks like I am getting a string from the user input.
.data
num1 dw 70 dup(?)
prompt db &...
0
votes
0
answers
49
views
MASM32 - set a string value on a single line, esi not correctly set, access violation
I am trying to use rep movsb to set a string to a variable. The rep movsb throws an access violation because my mov esi, offset ‘Dog’ is not pointing to the correct memory address. I am including ...
0
votes
0
answers
66
views
Iterate through array of pointers to custom struct and print individual values in struct MASM
So I’ve been writing this program that should take an array of pointers of a custom struct (DbRecord). My code is currently set up to hold 512 different pointers to DbRecord structs. I’ve been ...
1
vote
0
answers
163
views
Array of pointers, VirtualAlloc and RtlMoveMemory. MASM, some kind of problem
Does anybody know how to fix the addElement function so it ends up as another element in the array. The idea is a dynamic array, where arrayPtr is a pointer to the first element, then new elements ...
2
votes
1
answer
317
views
Array of custom Structs MASM Windows API
This is something I’ve been trying to figure out. I want to make a MASM program that has a custom struct and an array of those structs and then saves it to a file. I can not find any good ...
1
vote
0
answers
193
views
How to calculate factorial with masm32
I'm working on a compiler from C to masm32 code, the task is to calculate the factorial of some number (9 in this case), here is the code that I have:
.386
.model flat, stdcall
option casemap:none
...
0
votes
1
answer
85
views
masm32 addition subtraction division and multiplication
.data
msg_title db "Multiply"
A DB 4
B DB 2
C0 DB 4
C33 DB 24
C4 DB 2
C1 DB 4
buffer db 128 dup(?)
format db "(24 - A*C/4)/(2+C/A + B)= %d"
.code
start:
MOV AL, A
IMUL C0
...
1
vote
1
answer
315
views
Masm not assembling my win32 program in visual studio [duplicate]
Guys I been trying to asssemble my masm32 file in visual studio but the build fails each time. there isn't an issue with my program as it runs on other machines perfectly well it's only i think a ...
0
votes
1
answer
245
views
Assembly MASM32 push and pop
This is a basic win32 program that I found online. So far I get everything, but what I don't get are those two lines:
push hInstance
pop wc.hInstance
Can someone explain to me what they do and if ...