MASM

Assembly Segments in opcodes

强颜欢笑 提交于 2020-08-21 05:29:31
问题 I noticed that in Assembly segments are used in opcodes. Example: MOV DWORD PTR SS:[EBP-30],30 I think that "PTR SS:" is used to specify that EBP-30 comes from the stack? (SS: stack segment) Am I right or am I completely wrong? :) And, could you please tell me the difference between the example above and MOV DWORD PTR[EBP-30],30 And what about DS (data segment) used in opcodes? 回答1: MOV DWORD PTR SS:[EBP-30],30 There are two separate modifiers here, DWORD PTR and SS: . The first one tells us

Assembly Segments in opcodes

偶尔善良 提交于 2020-08-21 05:28:59
问题 I noticed that in Assembly segments are used in opcodes. Example: MOV DWORD PTR SS:[EBP-30],30 I think that "PTR SS:" is used to specify that EBP-30 comes from the stack? (SS: stack segment) Am I right or am I completely wrong? :) And, could you please tell me the difference between the example above and MOV DWORD PTR[EBP-30],30 And what about DS (data segment) used in opcodes? 回答1: MOV DWORD PTR SS:[EBP-30],30 There are two separate modifiers here, DWORD PTR and SS: . The first one tells us

source not found (initsect.cpp)

喜欢而已 提交于 2020-08-10 20:13:08
问题 I am trying to learn Assembly(MASM x64), and I am currently learning conditional jumps. So I wrote such a code .data .code main proc mov rax, 1 begin: cmp eax, 10 add rax, 1 jl begin main endp end Now I started a debugging process to see that it works(as there is no other way to check if something works) and at the line jl begin the debugger started to drag me the whole way through some files called exe_common.inl, file_mode.cpp, back to exe_common.inl, matherr.cpp, again back to exe_common

王爽汇编语言(第三版)环境搭建(附PDF及工具下载)

扶醉桌前 提交于 2020-08-07 05:03:50
一、前言 最近在学习汇编语言,使用的是读者评价非常高的王爽老师写的《汇编语言》(第三版),为了适应现在各个版本的windows操作系统,所以采用VMWare虚拟机来搭建纯DOS环境。 二、需要的工具 VMware-workstation-12、DOS系统镜像文件、汇编编译器masm和连接器link 2020-02-17 更新百度云链接 链接:https://pan.baidu.com/s/1Ic3J8zZ8h0CctoWS-xFflg 提取码:ggww 三、安装VMware-workstation-12 傻瓜式安装,一直点击下一步就可以(虽然网上也可以搜到注册码,请支持正版)。 四、搭建DOS编译环境 (1)启动虚拟机,选择“创建新的虚拟机”; (2)选择“典型”,下一步;“稍后安装操作系统”,下一步; (3)在客户机操作系统中选择“其他”,在版本中选择“MS-DOS”,下一步; (4)选择虚拟机名和安装位置,下一步; (5)使用默认设置,下一步。完成; (6)右键刚刚新建的虚拟机,选择“设置”。 (7)在“硬件”中点击CD/DVD,在右侧选择“使用ISO镜像文件”,点击浏览找到下载的dos71scd解压后的文件夹,里面有DOS的安装镜像,选择,点击打开,然后确定。 (8)开启虚拟机 (9)说一下VMWare的基本操作,鼠标在虚拟机中操作时,如果想切换到本身的操作系统

王爽汇编语言(第三版)环境搭建(附PDF及工具下载)

为君一笑 提交于 2020-08-04 22:25:33
一、前言 最近在学习汇编语言,使用的是读者评价非常高的王爽老师写的《汇编语言》(第三版),为了适应现在各个版本的windows操作系统,所以采用VMWare虚拟机来搭建纯DOS环境。 二、需要的工具 VMware-workstation-12、DOS系统镜像文件、汇编编译器masm和连接器link 2020-02-17 更新百度云链接 链接:https://pan.baidu.com/s/1Ic3J8zZ8h0CctoWS-xFflg 提取码:ggww 三、安装VMware-workstation-12 傻瓜式安装,一直点击下一步就可以(虽然网上也可以搜到注册码,请支持正版)。 四、搭建DOS编译环境 (1)启动虚拟机,选择“创建新的虚拟机”; (2)选择“典型”,下一步;“稍后安装操作系统”,下一步; (3)在客户机操作系统中选择“其他”,在版本中选择“MS-DOS”,下一步; (4)选择虚拟机名和安装位置,下一步; (5)使用默认设置,下一步。完成; (6)右键刚刚新建的虚拟机,选择“设置”。 (7)在“硬件”中点击CD/DVD,在右侧选择“使用ISO镜像文件”,点击浏览找到下载的dos71scd解压后的文件夹,里面有DOS的安装镜像,选择,点击打开,然后确定。 (8)开启虚拟机 (9)说一下VMWare的基本操作,鼠标在虚拟机中操作时,如果想切换到本身的操作系统

汇编实验九(王爽)

瘦欲@ 提交于 2020-07-28 13:30:43
编程:在屏幕中间分别显示绿色,绿色红底,白底蓝色的字符串 'welcome to masm!'. assume cs: code, ds: data, ss: stack data segment db ' welcome to masm! ' db 00000010b , 00100100b , 01110001b #分别代表绿色、绿色红底、白底蓝色 data ends stack segment dw 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 #定义一个栈段,来用于临时储存值 stack ends code segment start: mov ax,data mov ds,ax mov ax,0b800h #在汇编源程序中,数据不能以字母开头! mov es,ax mov ax,stack mov ss,ax mov sp, 16 mov bx,0a0h #好像我的电脑,如果在0处写入第一行数据,那么最后的话第一行会被吃掉,因此在内存第二行开始处写入 mov di, 16 #用于表示表示颜色属性字节数据的偏移地址 mov cx, 3 #循环三次,分别向每行中写入数据 s: push cx push bx #保存此时要写入内存的首地址,方便后面跳行 mov si, 0 mov dl, ds: [di] #获取data段内表示字符属性的字节 mov cx, 16

win10 64 使用 visual studio 2017 搭建汇编开发环境

时光总嘲笑我的痴心妄想 提交于 2020-07-28 08:31:40
转自http://blog.csdn.net/sinat_27382047/article/details/70339455 插件 vs2015的汇编语法高亮插件(安装就行)这玩意找了我很久= = http://download.csdn.net/detail/fhw_bin_dl/9724391 过程【这是小事,vs这一系列都可以照葫芦】 一、建项目 1.建一个空项目,必须先建空项目,改现成的C++项目为assembler项目可能会造成编译不过. 2.选中项目右键 “生成自定义”,选择MASM生成规则. 二、添加及设定源文件 3.选中源文件右键-》添加-》新建项 此处后缀名是汇编的.asm 4.选中项目右键-》属性-》链接器-》系统-》 子系统选 “控制台(SUBSYSTEM:CONSOLE)” 5.选中项目右键-》属性-》链接器-》高级-》 入口点 填 "main" 三、 测试 代码编译运行: (可以看到,如果安装了高亮插件, 不仅注释可以用了,代码也有高亮提示了 ) 最后,输出, 调试时 选择菜单 调试-》窗口-》寄存器 就能看到寄存器值。(这样,就不至于苦逼地用指令-ip一步步看了吧~) 代码【这事儿可深了……】 先上那位大神可以过的代码 TITLE Add and Subtract (AddSub.asm) ; This program adds and

MASM string reversal

不想你离开。 提交于 2020-07-09 11:31:08
问题 Alright, Im going about this, with what is probably a really complicated solution, but its the first thing that popped into my head. I need to write an assembly language program that reverses a "source" string, without using a "target" string ( a temp variable ) .. this is my attempt at it. INCLUDE Irvine32.inc .data source BYTE "This is the source string", 0 count DWORD ? .code main PROC mov ecx, LENGTHOF source L1: mov count, ecx ; save our outer loop count mov al,[source+0] ; get the first

MASM string reversal

你说的曾经没有我的故事 提交于 2020-07-09 11:29:54
问题 Alright, Im going about this, with what is probably a really complicated solution, but its the first thing that popped into my head. I need to write an assembly language program that reverses a "source" string, without using a "target" string ( a temp variable ) .. this is my attempt at it. INCLUDE Irvine32.inc .data source BYTE "This is the source string", 0 count DWORD ? .code main PROC mov ecx, LENGTHOF source L1: mov count, ecx ; save our outer loop count mov al,[source+0] ; get the first

MASM string reversal

懵懂的女人 提交于 2020-07-09 11:27:26
问题 Alright, Im going about this, with what is probably a really complicated solution, but its the first thing that popped into my head. I need to write an assembly language program that reverses a "source" string, without using a "target" string ( a temp variable ) .. this is my attempt at it. INCLUDE Irvine32.inc .data source BYTE "This is the source string", 0 count DWORD ? .code main PROC mov ecx, LENGTHOF source L1: mov count, ecx ; save our outer loop count mov al,[source+0] ; get the first