masm32

x86 assembly (MASM) - Square root of a 64-bit integer?

只谈情不闲聊 提交于 2019-12-09 01:54:14
问题 I'm coding a simple primality tester program for Windows in x86 assembly language (MASM32), which involves calculating a square root of a (64-bit) integer. My question is: Is there any simple way for obtaining the square root? Should I use some combination of ADD/SUB/DIV/MUL instructions? I found some information on how this could be achieved in C language, but I'm just wondering if I'm missing something here? 回答1: I think the simplest way is to use the FPU instruction fsqrt like this: .data?

How to run a MS-DOS .asm file using VS2013 or MASM32?

北城余情 提交于 2019-12-08 09:18:05
问题 Here is my test.asm code. Basically 'nothing' inside because just want to get it to build and run without errors first. .model small .stack 64 .data .code main proc mov ax,@data mov ds,ax mov ax,4c00h int 21h main endp end main I have tried using visual studio 2013 include the lib, add the linkers and all those guides from websites but no luck. Always getting this error message "error A2006: undefined symbol : DGROUP" for both MASM32 and visual studio 2013. Please guide me step by step on the

crt_printf and ExitProcess in MASM32 with lib

和自甴很熟 提交于 2019-12-08 07:51:47
问题 crt_printf, crt_scanf, ExitProcess Windows 7 with masm32v11r for Environment Path in .asm file, I'd like to call crt_printf to print (or call ExitProcess to end main procedure). However my code goes with: .386 .model flat,stdcall option casemap:none includelib D:\masm32\lib\msvcrt.lib printf proto C:dword,:vararg scanf proto C:dword,:vararg .DATA print_int DB "%d",0 print_char DB "%c",0 and my call procedure goes with: PUSH offset __temp13@_cal@main PUSH offset print_string CALL crt_printf

mov ax, bx vs. mov ax, [bx]

女生的网名这么多〃 提交于 2019-12-05 12:31:44
What is the difference between the following two lines? mov ax, bx mov ax, [bx] If bx contains the value 100h and the value at memory address 100h is 23, does the second one copy 23 to ax ? Also, what is the difference between the two following lines? mov ax, 102h ; moves value of 102h into register ax mov ax, [102h] ; Actual address is DS:0 + 102h Yes. The operand between the brackets is treated as an address and the value at that memory address if fetched. 来源: https://stackoverflow.com/questions/7291915/mov-ax-bx-vs-mov-ax-bx

Detecting architecture at compile time from MASM/MASM64

不想你离开。 提交于 2019-12-05 06:14:17
How can I detect at compile time from an ASM source file if the target architecture is I386 or AMD64? I am using masm(ml.exe)/masm64(ml64.exe) to assemble file32.asm and file64.asm. It would be nice to create a single file, file.asm, which should include either file32.asm, or file64.asm, depending on the architecture. Ideally, I would like to be able to write something like: IFDEF amd64 include file64.asm ELSE include file32.asm ENDIF Also, if needed, I can run ml.exe and ml64.exe with different command line options. Thanks! If I understand you correctly, you're looking for some sort of built

Compile Assembly Output generated by VC++?

偶尔善良 提交于 2019-12-04 08:58:21
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_test.obj indicating that the C-runtime functions were not linked to the object files produced earlier:

Assembly - .data, .code, and registers…?

让人想犯罪 __ 提交于 2019-12-03 02:20:18
问题 So this morning I posted a confused question about assembly and I received some great genuine help, which I really appreciate. And now I'm starting to get into assembly and am beginning to understand how it works. Things I feel I understand alright include the stack, interrupts, binary/hex, and in general what most of the basic operations do (jmp, push, mov, etc). Concepts that I'm struggling to understand and would like help with are below - it would be a huge help if you could address any

Assembly - .data, .code, and registers…?

北城以北 提交于 2019-12-02 15:50:48
So this morning I posted a confused question about assembly and I received some great genuine help, which I really appreciate. And now I'm starting to get into assembly and am beginning to understand how it works. Things I feel I understand alright include the stack, interrupts, binary/hex, and in general what most of the basic operations do (jmp, push, mov, etc). Concepts that I'm struggling to understand and would like help with are below - it would be a huge help if you could address any of the following: What exactly is happening in the .data section? Are those variables we're declaring?

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

masm32 invoking stdout gives no output

为君一笑 提交于 2019-12-02 10:39:58
问题 I am using masm32 to compile and link on windows 7, which works just fine with below code. However invoking stdOut isn't simply printing anything on my command prompt. what am i doing wrong? .386 .model flat, stdcall option casemap:none include C:\masm32\include\windows.inc include C:\masm32\include\kernel32.inc include C:\masm32\include\user32.inc include C:\masm32\include\masm32.inc includelib C:\masm32\lib\kernel32.lib includelib C:\masm32\lib\user32.lib includelib C:\masm32\lib\masm32.lib