MASM

Disabling desktop composition causes flickering on Tab Control

ε祈祈猫儿з 提交于 2019-12-02 11:19:16
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_COMPOSITED flag and added a listview control the frames of listview is not drawn. This only happens if

Assembly program crashes on call or exit

烈酒焚心 提交于 2019-12-02 11:15:56
Debugging my code in VS2015, I get to the end of the program. The registers are as they should be, however, on call ExitProcess , or any variation of that, causes an "Access violation writing location 0x00000004." I am utilizing Irvine32.inc from Kip Irvine's book. I have tried using call DumpRegs , but that too throws the error. I have tried using other variations of call ExitProcess , such as exit and invoke ExitProcess,0 which did not work either, throwing the same error. Before, when I used the same format, the code worked fine. The only difference between this code and the last one is

My program won't sort arrays that are larger than 130

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 11:02:29
So my program is supposed to take in user input (an integer between 10 and 200) and print out an array of random numbers and print out a sorted version of that array. However, this only works when I enter in 130 or less. I don't know what else I can do. It works but only half way. Is there any way to optimize this code? I have placed lines to help show which procedure I am having problems with. ****I ran debugger and I have left a comment where the program throws an exception error.***** TITLE Program5 (Program5.asm) INCLUDE Irvine32.inc ; (insert constant definitions here) MIN_INPUT = 10 MAX

Assign values to registers and add and subtract them

≡放荡痞女 提交于 2019-12-02 10:17:01
I am completely lost with this. I need to program that calculates the following expression, using registers: varA = (varA + varB) − (varC + varD), where varA, varB, etc., are variables. Assign integer values to the EAX, EBX, ECX, and EDX registers for the aforementioned variables. (Meaning, you may hardcode the inputs) My Code: ; AddTwo.asm - adds two 32-bit integers. ; Chapter 3 example .386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword .data varA dword 5 varB dword 3 varC dword 4 varD dword 1 .code main proc mov eax,varA add eax,varB mov ecx,varC add ecx,varD mov ebx

There is an assembly code written for Windows API, how to compile it on Linux and run with Wine

倾然丶 夕夏残阳落幕 提交于 2019-12-02 10:07:58
问题 There is an example code in this introduction, like below: ; Sample x64 Assembly Program ; Chris Lomont 2009 www.lomont.org extrn ExitProcess: PROC ; external functions in system libraries extrn MessageBoxA: PROC .data caption db '64-bit hello!', 0 message db 'Hello World!', 0 .code Start PROC sub rsp,28h ; shadow space, aligns stack mov rcx, 0 ; hWnd = HWND_DESKTOP lea rdx, message ; LPCSTR lpText lea r8, caption ; LPCSTR lpCaption mov r9d, 0 ; uType = MB_OK call MessageBoxA ; call

Program to get user's details, calculate age and display all information

只谈情不闲聊 提交于 2019-12-02 09:15:50
问题 I have some code started but I am having problems saving the users string input into a variable. Using ReadString I can get prompt the user to input a string, but after saving the users input into a variable named AskName1, and then displaying the information saved in AskName1, I have found that it save the number of characters that the user input and not the actual string. So what I need to figure out is how to save the string that the user input into a variable instead of the number of

ReadConsoleInputA throws an Access Violation

你。 提交于 2019-12-02 08:16:42
问题 I am trying to learn how to use the windows api (instead of just using C calls, irvine32 or masm32) And are running into issues with ReadConsoleInputA (WriteConsoleA works fine). Also, I don't get why in the PROC prototype for the function, most examples append either an A or a W at the end of ReadConsoleInput/WriteConsole, can you explain why? .data consoleOutHandle dd ? consoleInHandle dd ? bufferlen dd ? buffer db ? bufferSize DWORD ? message db "Enter a number:", 0 lmessage equ $-message

Moving from DX:AX register to single 32 bit register

纵饮孤独 提交于 2019-12-02 08:02:47
I'm having a problem adding to a product of a 16 bit multiplication. I want to multiply a year such as 2015, by 365 to do so I mov dx, 0 ; to clear the register mov ax, cx ; cx holds the year such as 2015 mov dx, 365 ; to use as multiplier mul dx ; multiply dx by ax into dx:ax After checking the registers, I am getting the correct solution but is there a way so that I can store this product into a single register. I want to add separate values to the product and so I would like to move this product into a single 32 bit register. Thanks for the help! The usual method is to use a 32 bit multiply

source BYTE “This is the source string”,0 target BYTE SIZEOF source DUP(0),0

微笑、不失礼 提交于 2019-12-02 07:17:48
What is SIZEOF referring to? Is it referring to the size of the source (lengthOf * TYPE which is equal to number of elements in the array * the size of each element)? Also, can someone explain DUP(0),0? This is referring to Assembly x86 MASM. Thank you SIZEOF simply denotes the size of a type or structure . It refers to whatever you put after the SIZEOF keyword. SIZEOF element ; refers to a single element in the array. SIZEOF wholearray ; sizeof(element) * number_of_elements_in_array. Because it is resolved at compile-time it will only work if the size of an array is static. The syntax for DUP

mul and memory allocation in registers edx::eax with masm

冷暖自知 提交于 2019-12-02 07:08:33
I am trying to understand the logic of using the "mul" operand in the assembler(i am using Visual Studio Community and MASM). Why, after "mul ebx" the result is changing also edx, and not only the eax? "The result(of MUL) is stored in register AX, register pair DX:AX, or register pair EDX:EAX (depending on the operand size), with the high-order bits of the product contained in register AH, DX, or EDX". So is the location depending on the size of the operand?In which case? .586 .model flat,c .stack 100h .data .code doit proc ;EAX = 0062EEF0 EBX = 7EFDE000 ECX = 0029FD00 EDX = 00000000 mov eax,8