AIMS & PREPARATIONS of THIS EXPERIMENT:

1st point of this experiment:

realize the programme t1.asm in DOSBox (code as follow)

STEPS&SCREENSHOTS of THIS EXPERIMENT:

( 1 ). COMPILE, LINK, RUN and DEBUG the PROGRAM t1.exe

(I used the computer which installed Win7 in lab for the experment, the disks are not virtual)

1.Creating a txt file (23.txt) in d:\epr

2.Copy the code given above (t1.asm) into the file 23.txt

3.Compile the programto get the object file

compile under the Microsoft assembly compiler masm5.0

by using the original way showed in the book

I saved the compiled file (.OBJ file) at the folder epr in disk D (d:\epr\)

after the compilation finished, a new file 23.OBJ (Object File) appered in the folder epr

4.Link the object file (to get the run file)

link the object file by running the link.exe in masm folder

I also saved the run file (23.exe) in d:\epr\

after the linkage, the file 23.EXE appered in the folder epr in disk D

5.Run the exe file

we get the result: 36

6.Debug the run file 23.exe

① Using the command r to observe the numerical value saved in register cx and ds

we can easily view that a assosiation exists between the value in cx and dx : (cs)=(ds)+10H

② Checking the first two bytes of PSP,

because the PSP occupies  256bytes (100H) before the address of the program in the internal memory, and we can find the address of the first statement (MOV AH,02) is 15d9:0000, which is also the address of the program, so we set the address to 15c9:0000 (15d90H-100H=15c90H)

by using the command d, we can get the first two bytes of PSP, which is CD and 20 indeed

③ Disassembling the 23.exe by using the command u, observe the source code of 23.exe

④ Debug the program step by step, using the command t and r

r for command int to view the result

the program ends after (15D9:0014    INT 21)

at the 1st (15D9:0007    INT 21) the program gets a result---3

at the 2nd (15D9:0010    INT 21) the program gets a result---6

( 2 ). COMPILE, LINK and RUN the NEW PROGRAM

In this case, I use the DOXBox0.74-2 for Win10 to realize the compilation

1.Creating a txt file (23.txt) in d:\epr

2.Using masm.exe and link.exe to compile and link the 233.txt

after the compilation and linkage, 233.OBJ and 233.EXE appears in the folder E

then run the 233.exe in the dosbox

we find that nothing appears on the screen

then we use the command cls to clear the screen, and run the 233.exe again

now we can get the result of 233.exe ------- number 36, which color is red

3.Change the number in the file 233.txt, after compilation and linkage, check the chage of its result.

compared with the original 233.txt showed before,

we changed the hex number in line 6 and line 8

mov [bx], 0433h ==> mov [bx], 0432h

mov [bx], 0436h ==> mov [bx], 0439h

the new exe file also can't directly been showed on the screen

by using the command cls, and run the program again, number 29, which color is also red, appers on the top of the screen

4.Change the number in the file 233.txt again, after compilation and linkage, check the chage of its result.

in this case we change the following statement:

(compared with the original file, changes also impled at line 6 and line 8)

mov [bx], 0433h ==> mov [bx], 0333h

mov [bx], 0436h ==> mov [bx], 0336h

same way of compilation&linkage

as well as same invisible result

and same way to uncover it

now we can see number 36 appears on the screen, but, its color is cyan

SUMMARY & REVIEW of THIS EXPERIMENT :

In thisexperiment, I grasped the method of compiling, linking and running of the assembly program. Especially creating a txt file with statement in it, and turn the unexecutable file to executable file by using the tool masm.exe and link.exe: masm.exe to change the txt file to object file (.OBJ file) while link.exe to change the object file to executable file (.EXE file).

Hoever, there still confusions remained in this experiment:

First, why using statement ( mov bx, 0       mov [bx], 0433h) instead of (mov [0], 0433h) ?

one explanation to question1 is using the statement ( mov bx, 0      mov [bx], 0433h)  can

have a positive influence on the circulation later

Second, why the result of some exe file cannot been showed on the screen immediately after execute. Instead, we need to clear the screen and run the file again to get the answer.

one realiable explanation to question 2 is that bugs exists while running the program in

doxbox in some platforms which I think includes Windows 10

Third, why the answer we get after clearing the screen and running the executable file again showed on the top of the screen? Does it belong to the execution command we typed before clearing the screen or after clearing the screen?

I assume that the answer belongs to the command after clearing screen, but why the result

appers on the top of the window still bothers me

Assembly Experiment3的更多相关文章

  1. 为C# as 类型转换及Assembly.LoadFrom埋坑!

    背景: 不久前,我发布了一个调试工具:发布:.NET开发人员必备的可视化调试工具(你值的拥有) 效果是这样的: 之后,有小部分用户反映,工具用不了(没反应或有异常)~~~ 然后,建议小部分用户换个电脑 ...

  2. ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0

    ASP.NET Core 引用外部程序包的时候,有时会出现下面的错误: The type 'Object' is defined in an assembly that is not referenc ...

  3. An error occurred during the installation of assembly 'Microsoft.VC90.CRT……的问题

    有一段时间没有用到AnkhSvn了,今天工作需要安装了一下.结果安装到一半就无法继续了,提示An error occurred during the installation of assembly ...

  4. Beennan的内嵌汇编指导(译)Brennan's Guide to Inline Assembly

    注:写在前面,这是一篇翻译文章,本人的英文水平很有限,但内嵌汇编是学习操作系统不可少的知识,本人也常去查看这方面的内容,本文是在做mit的jos实验中的一篇关于内嵌汇编的介绍.关于常用的内嵌汇编(AT ...

  5. MAC上安装 HLA(High Level Assembly)

    1.安装HLA 最新版的hla汇编器可在这里下载,支持MacOs,Linux,Windows平台 2.安装步骤 将下载好的hla程序包放在Mac根目录下 最重要的一步是设置好环境变量,打开Mac根目录 ...

  6. .NET 程序集Assembly使用

    概述 一直以来,我们都在用C#编写程序,编写程序的时候,我们用到继承.多态.接口以及泛型,我们也都明白子类可以继承抽象类,并能够重写父类的抽象方法,可是大家是否想过,如下几个问题: 1.凡树必有根和叶 ...

  7. configuration error-could not load file or assembly crystaldecisions.reportappserver.clientdoc

    IIS启动网站后报错: configuration error Could not load file or assembly 'crystaldecisions.reportappserver.cl ...

  8. Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its de

    页面加载时出现这个错误: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Cul ...

  9. How to make your assembly more secure from referencing by unauthorized bits

    Now the security has a trend to become more and more important in our daily work, hence I did some r ...

随机推荐

  1. 关于WCF服务 http://XXXXXX/XXX/xxx.svc不支持内容类型 application/sop+xml;charset=utf-8 错误解决方法

    有时候用IIS部署一个WCF服务时,无论是在客户端还是在服务端通过地址都能正常访问. 但是当你在客户端添加服务引用时, 怎么也添加不上, 会碰到了如下错误: 好啦. 现在说说怎么解决吧. 其实很简单. ...

  2. 使用idea启动springMVC+Hibernate其他项目

    打开项目后打开Project Structure 点开左边的Libraries 加入依赖包 点开左边的Moudules 选中项目 新建Web,Spring,Hibernate三项 Hibernate添 ...

  3. HTML5 Canvas绚丽的小球详解

    实例说明: 实例使用HTML5+CSS+JavaScript实现小球的运动效果 掌握Canvas的基本用法 技术要点: 从需求出发 分析Demo要实现的功能 擅于使用HTML5 Canvas 参考手册 ...

  4. linux驱动由浅入深系列:PBL-SBL1-(bootloader)LK-Android启动过程详解之一(高通MSM8953启动实例)

    转自:http://blog.csdn.net/radianceblau/article/details/73229005 http://www.aiuxian.com/article/p-14142 ...

  5. 5 第一个Django第4部分(表单和通用视图)

    上一节完成了视图编写,这一节为应用添加投票功能,也就是表单提交. 5.1编写一个简单的表单 5.2使用通用视图 5.3改良视图 5.1编写一个简单的表单 在网页设计中添加Form元素 polls/te ...

  6. lsof 命令用法详解

    lsof 命令用法详解 作用 用于查看你进程开打的文件,打开文件的进程,进程打开的端口(TCP.UDP).找回/恢复删除的文件.是十分方便的系统监视工具,因为lsof命令需要访问核心内存和各种文件,所 ...

  7. 反射Dll注入分析

    (源码作者:(HarmanySecurity)Stephen Fewer) 0x01  反射Dll注入的优点  1.反射Dll注入的主要优点是它没有以主机系统的任何方式(例如LoadLibrary和L ...

  8. php 跨域请求

    执行要在跨域请求的服务器端对应的代码上增加下面的代码 <?php namespace Admin\Controller; // 指定允许跨域访问 header('Access-Control-A ...

  9. 不会点git真不行啊.

    基本使用: // 进入项目根目录, git init // 接管你的项目文件夹, git status // 查看状态. 绿色已接管,红色未管理 git add . // 添加管理当前目录所有文件及子 ...

  10. html css+div+jquery实现图片轮播

    一直想自己动手做一个图片轮播的控件,查查网上的资料大多引用已经做好的组件,其原理算法不是很清楚,于是自己用jquery写了一个.先看下效果图: 主要界面实现思路如下: 1.新建一个div宽度为100% ...