masm32

Compile Assembly Output generated by VC++?

流过昼夜 提交于 2020-01-12 20:38:12
问题 I have a simple hello world C program and compile it with /FA. As a consequence, the compiler also generates the corresponding assembly listing. Now I want to use masm/link to assemble an executable from the generated .asm listing. The following command line yields 3 linker errors: \masm32\bin\ml /I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" /c /coff asm_test.asm \masm32\bin\link /SUBSYSTEM:CONSOLE /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib" asm

Disabling desktop composition causes flickering on Tab Control

对着背影说爱祢 提交于 2020-01-11 13:36:26
问题 When i disable desktop composition i get flickering/blinking whenever i hover the mouse over the tabs. This only happens when desktop composition is disabled. I have tried to cancel WM_ERASEBKGND message but it doesn't fix the problem. What is the solution to this problem? This is the example that i tried to use for MASM tab control. http://www.dreamincode.net/forums/index.php?app=core&module=attach&section=attach&attach_id=28600 The bin is already compiled. EDIT: After enabling the WS_EX

How to clear stack in masm32 coprocessor (FPU)?

风格不统一 提交于 2020-01-06 19:55:22
问题 Doing some operations in masm32 FPU . But I'm not able to clear the stack of FPU e.g. ST(0)-ST(7) afterwards. Is there any instruction for stack clearing. Can you suggest anything? P.S. Suppose to clear stack for further calculation. 回答1: You can use FINIT which initializes the FPU and tags the data registers ST(0)-ST(7) as empty (it does not clear their contents though) 来源: https://stackoverflow.com/questions/34840658/how-to-clear-stack-in-masm32-coprocessor-fpu

power of in x86 assembly

不羁的心 提交于 2020-01-06 08:11:12
问题 as a starter in ASM programming i am need to get the result of 2 to the power of 38 in Assembly , and i need your help in understanding why is my program doesn't produce the result i am need (it prints 4 decimal): .386 .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\msvcrt.inc includelib \masm32\lib\msvcrt.lib .data formatstr db "%d",0 .code start: mov eax , 2 mov ecx , 38 mov esi , eax mov edx , 0 .while TRUE mul esi mov esi, edx add esi,

Reading disassembled code

故事扮演 提交于 2020-01-04 09:26:09
问题 I wrote simple Hello word program with masm32. But then when I try to disassemble it with IDA and I am getting much bigger output (I won't write it there because it would take to much space). And I don't get it why it's different. How to run the disasembled code? 回答1: This is normal. Compilation is a "lossy" process, which means that if you compile code and then decompile it, you're not guaranteed to get exactly the same thing out that you originally put in. The same thing applies to assembly

How do I remove everything after a certain character in a string?

烂漫一生 提交于 2020-01-03 03:28:14
问题 How do I remove everything in the string after the '?' ? The code I have so far searches for the '?'. How do I proceed from there? This is my code. INCLUDE Irvine32.inc .data source BYTE "Is this a string? Enter y for yes, and n for no",0 .code main PROC mov edi, OFFSET source mov al, '?' ; search for ? mov ecx, LENGTHOF source cld repne scasb ; repeat while not equal jnz quit dec edi ; edi points to ? end main 回答1: You can replace everything after the "?" by zeroes, so all the characters

x86 assembly (masm32) - how to split multi-digit data into individual characters

对着背影说爱祢 提交于 2019-12-25 04:09:33
问题 I am still getting my head around x86 assembly, and so I have made this little program that multiplies 6 and 7, moves the data to EAX and then prints the result. It compiles fine, and runs fine, but instead of printing 42, it prints the fourty-second ASCII character. I have on this forum how to print a single-character number, but now I need to figure out how to print multi-digit numbers. Here is my code: .386 .model flat, stdcall option casemap :none include \masm32\include\windows.inc

How are the SCAS and MOVS instructions affected by the value of the direction EFLAG?

折月煮酒 提交于 2019-12-24 10:49:32
问题 I want to know how setting or clearing the direction EFLAG changes how the SCAS and MOV instructions decrement or increment registers. I read some webpages and made the following assumptions I will list below. I am using the MASM 32 SDK - no idea what version, I installed via Visual MASM's download and installation wizard - with Visual MASM to wright and MASM32 Editor to link and build them into objects and executables. I use a Windows 7 Pro 64 bit OS. SCAS The SCAS instruction "compares a

When using the MOV mnemonic to load/copy a string to a memory register in MASM, are the characters stored in reverse order?

心已入冬 提交于 2019-12-24 03:49:17
问题 I want to know if using the MOV instruction to copy a string into a register causes the string to be stored in reverse order. I learned that when MASM stores a string into a variable defined as a word or higher (dw and larger sizes) the string is stored in reverse order. Does the same thing happen when I copy a string to a register? Based on this questions (about the SCAS instruction and about assigning strings and characters to variables in MASM 32) I assumed the following: When MASM loads a

MASM32 error A2006, error A2074 and warning A4023

北慕城南 提交于 2019-12-22 00:19:04
问题 I am new to assmebly. I have the following piece of code from the book I am learning form. I downloaded MASM32. My computer is Win7 64bit. I tried to build the following code: .model small .stack 100h .data a dw 2 b dw 5 sum dw ? .code main proc mov ax, @data mov ds, ax mov ax, a add ax, b mov sum, ax mov ax, 4c00h int 21h main endp end main Unfortunately, I get the following errors: Microsoft (R) Macro Assembler Version 6.14.8444 Copyright (C) Microsoft Corp 1981-1997. All rights reserved.