Answer to the experiment(1),(2),(3),(4)

Experiment(5):

Screenshots&Results:

from the command u

we can know that

a : 076A

b :076B

c1 :076C

elements in c1 before adding a and b

after adding a and b

076C:0000~076C:0007: 02 04 06 08 0A 0C 0E 10

just double the elements in a (also a+b)

Experiment(6):

Screenshots&Results:

disassemblig:

we can know that

a:076A

b:076C

elements in b before push elements into stack b

the last two elements: 6c 70 is the address of the stack b (076C)

elements instack b after pushing elements into b

obviouly, the answer is right

Review of this experiment:

From this experiment, we get the method to design the program by ourselves, especially under the circuma=stance that the several segments are given.

Also, we need to know which way to add a number into a register is more fast, for example, when expressing (bx)+=1 in assembly language, we use ( inc bx  ) instead of ( add bx,1), because when you disassemblying the code, you will find that the former statement cost 2 words, but the latter cost 3 words. But, it doesn't work when the number getting bigger, for example, if you want to express (bx)+=2 or more, using ( add bx,2 ) is faster.

Another important method is that we need to focus on the changes of the elements in the segments during executing step by step, only by dong this dull work, you can easily find your protential mistakes.

However , the most important recipe I get during this experiment is that, because there are only 4 special segments in 8086CPU (DS, ES, SS, CS) , which means that you should use them properly after thinking. And, if you need to reuse one of these segments, you should protect the former data in the segments by using (push segment) and (pop segment) to preserve and recover the data in the segment before.

Assembly Experiment5的更多相关文章

  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. 所有不同的序列串-----LCS算法的变种

    今天遇到LEETCODE的第115题: Distinct Subsequences Given a string S and a string T, count the number of disti ...

  2. 说一说js中的闭包

    不说官方给的定义,感觉自己刚开始看也不是很理解. 闭包 : 其实就是 该函数能使用函数外定义的变量. 为什么要使用闭包? 首先来说一下局部变量和全局变量的危害: 全局变量容易全局污染,局部变量又无法共 ...

  3. 12月4日学习爬虫007.使用Urllib模块进行简单网页爬取

    笔记如下: 1.https是http加强版协议(安全协议)http(普通网络通信协议) 爬数据 如果爬https发现和理想中的数据不同,可以改为http 直接去掉s即可 2.使用Urllib爬取简单网 ...

  4. python笔记20-装饰器、作用域

    函数的作用域是就近原则,从里往外找,如果自己函数里有,就拿过来如果自己的函数里面没有的话,就去它父级函数里面找,父亲用不了儿子的,儿子可以用父亲的函数只有被调用才会执行# name = 'python ...

  5. LeetCode 547 朋友圈

    题目: 班上有 N 名学生.其中有些人是朋友,有些则不是.他们的友谊具有是传递性.如果已知 A 是 B 的朋友,B 是 C 的朋友,那么我们可以认为 A 也是 C 的朋友.所谓的朋友圈,是指所有朋友的 ...

  6. 用less编写百度搜索静态效果

    效果图 html页面 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...

  7. DevExpress v18.2新版亮点——Reporting篇(二)

    行业领先的.NET界面控件——DevExpress v18.2日前正式发布,本站将以连载的形式为大家介绍新版本新功能.本文将介绍了DevExpress Reporting v18.2 的新功能,新版3 ...

  8. css flex布局,小程序flex布局,垂直居中完美解决

    flex弹性布局,很好的解决了垂直居中的问题,上代码: wxml: <view class='container'> <view class='item item1'>item ...

  9. Problem 9: Special Pythagorean triplet

    flag = 0 for a in range(1,1000): for b in range(a+1,1000): if a*a + b*b == (1000-a-b)**2: print(a,b) ...

  10. Hadoop学习------Hadoop安装方式之(三):分布式部署

    这里为了方便直接将单机部署过的虚拟机直接克隆,当然也可以不这样做,一个个手工部署. 创建完整克隆——>下一步——>安装位置.等待一段时间即可. 我这边用了三台虚拟机,分别起名master, ...