MASM

win7 64位系统下 安装debug.exe

六月ゝ 毕业季﹏ 提交于 2019-11-29 15:46:20
下实现Debug汇编的方法。 使用32位的Win7同志就不用看了 直接搜索C盘 debug就找到了 XP也一样 若要使用DOS下masm的更多功能,请下载emu 8086 v4.08或 Masm for windows 2012, win7 64位系统下 安装debug.exe 主要说一下64位Win7使用debug程序的方法 首先你要下载一个DOSBOX程序 这个程序是一个dos模拟器 这个程序的制作目的是运行经典的DOS游戏 -。- 下载地址: http://www.dosbox.com/download.php?main=1 其次下载一个Win732位的debug程序 下载地址: http://u.115.com/file/b3mmegwu Win7 64位的孩子你们伤不起啊,木有debug,汇编实验做得好痛苦。 好在现在寻到一个方法,不用装虚拟机,废话不多说,上教程。 第一步,下载要用到的工具, http://download.csdn.net/detail/hnjb5873/9165215 DOSbox 0.74。 第二步,双击DOSbox安装 第三步,把Debug.exe拷贝到D盘或者E盘或者F盘根目录下,记住,是根目录,这里我以放在D盘为例。 第四步,打开安装好的DOSBox, 然后输入 mount c d: 回车 c: 回车 debug 回车

A2004 Problem With MASM32

别说谁变了你拦得住时间么 提交于 2019-11-29 12:48:14
I have a problem with the MASM32 assembler The following code is a Hello World example that I copied from the MASM32 tutorial: .model small .stack .data message db "Hello world!", "$" .code _main proc mov ax,seg message mov ds,ax mov ah,09 lea dx,message int 21h mov ax,4c00h int 21h _main endp end _main On attempt to assemble, MASM32 throws A2004 error with the following comment: C:\masm32\console.asm(11) : error A2004: symbol type conflict Can anyone help me with that? This code worked perfectly fine with the TASM assembler, but now I have to use MASM32 and I am having this A2004 error for

Reverse byte order of EAX register

蹲街弑〆低调 提交于 2019-11-29 12:08:45
Example: 0xAABBCCDD will turn into 0xDDCCBBAA My program crashes, due to Access Violation exception right in the first XOR operation. It seems like there's a better naive solution, using shifting or rotating, but anyways, here's the code: ;; ######################################################################### .486 .model flat, stdcall option casemap :none ; case sensitive ;; ######################################################################### include \masm32\include\masm32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib

How are dw and dd different from db directives for strings?

谁都会走 提交于 2019-11-29 12:07:53
Let's say I want to define a initialized variable string before running my assembly program (in section .data ). The variable I chose to create is called Digits and it is a string that contains all the hexadecimal symbols. Digits: db "0123456789ABCDEF" I defined the variable with db , that means define byte . Does this mean that the Digits variable is of 8-bits long? This doesn't seem to have sense for me because: Each character in the string is an ASCII character, therefore I will need 2 bytes for each character. In total, I would need 32 bytes for the whole string! So what does it mean when

Getting string input and displaying input with DOS interrupts MASM

放肆的年华 提交于 2019-11-29 11:16:11
In MASM, I created a buffer variable to hold the user string input from keyboard. I am stuck on how to hold the string input into that buffer variable. I don't have any libraries linked like the irvine ones and want to do this with DOS interrupts. So far I have something along the lines of .model small .stack 100h .data buff db 25 dup(0), 10, 13 lbuff EQU ($ - buff) ; bytes in a string .code main: mov ax, @data mov ds, ax mov ah, 0Ah ; doesn't work mov buff, ah ; doesn't seem right int 21h mov ax, 4000h ; display to screen mov bx, 1 mov cx, lbuff mov dx, OFFSET buff int 21h mov ah, 4ch int 21h

汇编程序设计DOSBox模拟环境配置

守給你的承諾、 提交于 2019-11-29 08:27:13
# 汇编程序设计DOSBox模拟环境配置 ##### 最近在学习汇编语言设计,然后上网找关于汇编程序的编译软件。不负有心人,终于找到了我需要的软件,值得庆幸。 ##### 关于配置方法以及步骤,以下详情。 --- 首先,我们需要一个环境,该环境称为:DOSBox环境,该环境是一个仿真器环境,仿真真实的DOS环境,可重新创建 MS-DOS 兼容环境(包括声音、输入、图形甚至基本网络)。然后我们在这个环境下面进行汇编语言设计。有能力者可以直接网上下载真实的DOS环境,从而从实体机上运行并编写调试汇编程序。 DOSBox下载连接为: ---->这是下载链接<----- 当然要是不嫌弃,也可以到我的百度云盘中下载: ----->这是我的百度网盘链接<----- (提取码:tlow) --- 下载了之后,便是以下安装。习惯安装在 D 盘,所以我设置成了 D:\Program..... 如下图: 经过一系列的努力,你终于把环境配好了,好棒(๑•̀ㅂ•́)و✧ 然后,我们首先在D盘中新建一个文件夹,称作 "MASM" 为什么呢? 因为待会要使用,笨蛋( ╯□╰ ) >哦~(●ˇ∀ˇ●) 接下来,我们进行masm配置,首先,你得把那几个程序找到 edit.exe, edit.com ( 编辑软件 ) debug.exe ( 是一种计算机程序,用于测试和调试MS-DOS可执行文件 ) masm

Making assembly function inline in x64 Visual Studio

寵の児 提交于 2019-11-29 07:22:45
I know that MSVC compiler in x64 mode does not support inline assembly snippets of code, and in order to use assembly code you have to define your function in some external my_asm_funcs.asm file like that: my_asm_func PROC mov rax, rcx ret my_asm_func ENDP And then in your .c or .h file you define a header for the function like that: int my_asm_func(int x); Although that solution answers many concerns, but I am still interested in making that assembly code function to be inline, in other words - after compilation I don't want any "calls" to my_asm_func , I just want this piece of assembly to

__cdecl, __stdcall and __fastcall are all called the exact same way?

北慕城南 提交于 2019-11-29 07:03:15
I am using Visual C++ 2010, and MASM as my x64-Assembler. This is my C++ code: // include directive #include "stdafx.h" // functions extern "C" int Asm(); extern "C" int (convention) sum(int x, int y) { return x + y; } // main function int main() { // print asm printf("Asm returned %d.\n", Asm()); // get char, return _getch(); return EXIT_SUCCESS; } And my assembly code: ; external functions extern sum : proc ; code segment .code Asm proc ; create shadow space sub rsp, 20o ; setup parameters mov ecx, 10 mov edx, 15 ; call call sum ; clean-up shadow space add rsp, 20o ; return ret Asm endp end

Why doesn't MS-DOS initialize the DS and ES registers?

六眼飞鱼酱① 提交于 2019-11-29 06:52:15
Why does the initialization of the DS and ES registers has to be done manually by the programmer? For example: MOV AX, DTSEG MOV DS, AX On the other hand, the CS and SS registers are initialized by the operating system (in MS-DOS ). Why is this so? Because CS and SS registers are essential for program execution in contrast to DS and ES registers which point to user-defined data segments. By default no data is present in the executing program this nothing to initialize the DS and ES with. As a program writer you can specify where your data is by setting the data segments registers. Edit : as

Execute RDMSR and WRMSR instructions from C/C++ code

こ雲淡風輕ζ 提交于 2019-11-29 00:45:10
I need to control C-State configuration. Specifically, I'd probably like to execute the following asm code: __asm { rdmsr and eax, 0x00 or eax, 0x01 wrmsr } Currently, I got this exception on rdmsr line: Unhandled exception at 0x00e3139e in MessWithCStates.exe: 0xC0000096: Privileged instruction. How can I (permanently) elevate priviliges of my app so it could execute the code above? I use VS 2010. NOTE: It is possible without writing a kernel-mode driver. See R/W Everything . Chances are, you are running this code on an x86 processor within Ring 3. You do not have the privileges to execute