存储器间接寻址方式_8086微处理器的程序存储器寻址模式

存储器间接寻址方式

The Program Memory Addressing mode is used in branch instructions. These branch instructions are instructions which are responsible for changing the regular flow of the instruction execution and shifting the control to some other location. In 8086 microprocessor, these instructions are usually JMP and CALL instructions.

在分支指令中使用程序存储器寻址模式 。 这些分支指令是负责更改指令执行的常规流程并将控件移至其他位置的指令。 在8086微处理器中,这些指令通常是JMP和CALL指令。

The Program memory Addressing Mode contains further three addressing modes within it. They are:

程序存储器寻址模式中还包含另外三种寻址模式。 他们是:

  1. Direct Program memory Addressing

    直接程序存储器寻址

  2. Indirect Program memory Addressing

    间接程序存储器寻址

  3. Relative Program memory Addressing

    相对程序存储器寻址

Let us study each of them in detail about their instructions and the way of processing by the microprocessor while executing them.

让我们详细研究它们中的每一个,以了解它们的指令以及在执行它们时微处理器的处理方式。

1)直接程序存储器寻址 (1) Direct Program Memory Addressing)

In this addressing mode, the offset address where the control is to be shifted is defined within the instruction. This mode is called direct addressing mode because the required address is directly present in the instruction rather than being stored in some register.

在该寻址模式下,将在指令内定义要在其中移动控件的偏移地址。 这种模式称为直接寻址模式,因为所需的地址直接存在于指令中,而不是存储在某个寄存器中。

Example:

例:

    JMP 4032H

Here, the working of the above instruction will be as follows:

在这里,以上指令的工作方式如下:

The current value of IP which holds the address of next instruction to be executed will be stored in the TOP OF THE STACK. Now, the IP will be replaced by the mentioned value, i.e. IP

持有下一条要执行指令地址的IP的当前值将存储在堆栈顶部 。 现在,IP将被上述值替换,即IP

Now, the Memory address is calculated as: (Contents of CS) X 10H + (contents of IP)

现在,内存地址的计算公式为: (CS的内容)X 10H +(IP的内容)

2)间接程序寻址模式 (2) Indirect Program Addressing mode)

As the name suggests, in this addressing mode, the offset address is not present directly in the instruction. It is rather stored in any of the CPU registers (Internal Register). So, the contents of the Instruction Pointer (IP) will be replaced by the contents of that register.

顾名思义,在这种寻址模式下,偏移地址不直接存在于指令中。 而是存储在任何CPU寄存器(内部寄存器)中。 因此,指令指针(IP)的内容将被该寄存器的内容替换。

Example:

例:

    JMP BX

Working:

加工:

Suppose that the content of the BX register is 0003H. So, the working of the microprocessor for executing the above instruction will be as follows:

假设BX寄存器的内容为0003H 。 因此,微处理器用于执行以上指令的工作如下:

            IP 

And the required memory address is calculated in a similar way as in Direct Addressing mode: (Contents of CS) X 10H + (contents of IP)

3) Relative Program Memory Addressing

In this Addressing mode, the offset address is equal to the content of the Instruction Pointer (IP) plus the 8 or 16-bit displacement. For the 8 bit displacement, SHORT is used and for 16-bit displacement, LONG is used. This type of displacement will only be intra-segment, i.e. within the segment.

Example:

Here, SHORT is used to represent the 8-bit displacement and OVER is the Label defined for any particular memory location.



TOP Interview Coding Problems/Challenges

  • Run-length encoding (find/print frequency of letters in a string)

  • Sort an array of 0's, 1's and 2's in linear time complexity

  • Checking Anagrams (check whether two string is anagrams or not)

  • Relative sorting algorithm

  • Finding subarray with given sum

  • Find the level in a binary tree with given sum K

  • Check whether a Binary Tree is BST (Binary Search Tree) or not

  • 1[0]1 Pattern Count

  • Capitalize first and last letter of each word in a line

  • Print vertical sum of a binary tree

  • Print Boundary Sum of a Binary Tree

  • Reverse a single linked list

  • Greedy Strategy to solve major algorithm problems

  • Job sequencing problem

  • Root to leaf Path Sum

  • Exit Point in a Matrix

  • Find length of loop in a linked list

  • Toppers of Class

  • Print All Nodes that don't have Sibling

  • Transform to Sum Tree

  • Shortest Source to Destination Path



Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.


            IP 

And the required memory address is calculated in a similar way as in Direct Addressing mode: (Contents of CS) X 10H + (contents of IP)

3) Relative Program Memory Addressing

In this Addressing mode, the offset address is equal to the content of the Instruction Pointer (IP) plus the 8 or 16-bit displacement. For the 8 bit displacement, SHORT is used and for 16-bit displacement, LONG is used. This type of displacement will only be intra-segment, i.e. within the segment.

Example:

Here, SHORT is used to represent the 8-bit displacement and OVER is the Label defined for any particular memory location.



TOP Interview Coding Problems/Challenges

  • Run-length encoding (find/print frequency of letters in a string)

  • Sort an array of 0's, 1's and 2's in linear time complexity

  • Checking Anagrams (check whether two string is anagrams or not)

  • Relative sorting algorithm

  • Finding subarray with given sum

  • Find the level in a binary tree with given sum K

  • Check whether a Binary Tree is BST (Binary Search Tree) or not

  • 1[0]1 Pattern Count

  • Capitalize first and last letter of each word in a line

  • Print vertical sum of a binary tree

  • Print Boundary Sum of a Binary Tree

  • Reverse a single linked list

  • Greedy Strategy to solve major algorithm problems

  • Job sequencing problem

  • Root to leaf Path Sum

  • Exit Point in a Matrix

  • Find length of loop in a linked list

  • Toppers of Class

  • Print All Nodes that don't have Sibling

  • Transform to Sum Tree

  • Shortest Source to Destination Path



评论和讨论

广告:您是博主吗? 加入我们的Blogging论坛 。


翻译自: https://www.includehelp.com/embedded-system/program-memory-addressing-mode-of-8086.aspx

存储器间接寻址方式

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.pswp.cn/news/379695.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Servlet的配置

1&#xff0c;基本配置 <!-- Servlet类的配置 --><servlet><servlet-name>sq</servlet-name><servlet-class>beyond.servlet.QuickStartServlet</servlet-class></servlet><!-- Servlet的虚拟路径的配置 --> <servlet-mapp…

Asp.net页面生存周期

# 事件或方法 功能 描述   1 Init 事件 页面初始化 初始化设置。   2 LoadViewState 方法 加载视图状态 填充ViewState属性。   3 LoadPostData 方法 处理回发数据 处理传入窗体数据。   4 Load 事件 加载页面 页面控件初始化完成并反映了客户端的数据。   5 RaisePo…

你正确关闭WCF链接了吗?

通常情况下我们关闭一个WCF链接都是简单地写把ICommunicationObject.Close()方法&#xff0c;但是这个方法有个问题就是当调用发生异常时&#xff0c;Close()会发生次生的异常&#xff0c;导致链接不能正常关闭。如果当这种异常很多时&#xff0c;必然对系统的稳定性有很大的影…

Visual Studio进行linux远程开发

目录准备工作创建一个项目配置远程项目准备工作 查看linux IP地址 安装了工具 sudo apt-get install openssh-server g gdb make ninja-build rsync zip开启ssh服务&#xff1a; sudo service ssh startVS2019按装了linux功能&#xff0c;如果没有&#xff0c;找到Visual S…

在给定总和K的二叉树中找到级别

Description: 描述&#xff1a; The article describes how to find the level in a binary tree with given sum K? This is an interview coding problem came in Samsung, Microsoft. 本文介绍了如何在给定总和K下在二叉树中找到级别 &#xff1f; 这是一个面试编码问题&a…

PostgreSQL学习手册(数据库维护) 转

原文&#xff1a; PostgreSQL学习手册(数据库维护)一、恢复磁盘空间&#xff1a;在PostgreSQL中&#xff0c;使用delete和update语句删除或更新的数据行并没有被实际删除&#xff0c;而只是在旧版本数据行的物理地址上将该行的状态置为已删除或已过期。因此当数据表中的数据变化…

++i与i++的根本性区别(两个代码对比搞定)

首先来看i 代码如下&#xff1a; #include <stdio.h> #include <stdlib.h> int main() {int i0;int ai;printf("%d\n",a);printf("%d\n\n\n",i);return 0; }输出结果如下&#xff1a; 解释&#xff1a;i其实是两行代码的简写形式&#xff0c…

国企和外企的比较

由于本人在外企&#xff0c;而很多朋友在国企&#xff0c;因此我个人的说法应该还是有一定的权威性。 首先&#xff0c;国企和外企不能一概而论。正如任何事物都有三六九等&#xff0c;这个&#xff0c;只能在同等级别上进行比较。 国企分类&#xff1a; 一等国企&#xff1…

Python | 使用matplotlib.pyplot创建线图

Problem statement: Write a program in python (using matplotlib.pyplot) to create a line plot. 问题陈述&#xff1a;用python编写程序(使用matplotlib.pyplot)以创建线图。 Program: 程序&#xff1a; import matplotlib.pyplot as pltx [1,2,3,4,5,6,7,8,9,10]y [3,…

QI(接口查询)

接触AE一段时间了&#xff0c;总的来说收获不少&#xff0c;今天仔细分析了一下AE开发中经常会用到的QI即接口查询&#xff0c;有了自己的一些理解。 COM类至少有一个接口。事实上一般它们有好几个接口。即一个类经常会实现多个接口&#xff08;一个类无法继承多个类&#xff0…

linux内核设计与实现---从内核出发

获取、编译、安装内核1 获取内核源码安装内核源代码何处安装源码使用补丁2 内核源码树3 编译内核减少编译的垃圾信息衍生多个编译作业安装内核启用指定内核作为引导4 内核开发的特点没有libc库头文件没有内存保护机制容积小而固定的栈1 获取内核源码 在linux内核官方网站http:…

MySQL在DOS下的基本命令操作

启动net start mysql 重置root密码 方法一:在my.ini的[mysqld]字段加入&#xff1a; skip-grant-tables 重启mysql服务&#xff0c;这时的mysql不需要密码即可登录数据库然后进入mysql mysql>use mysql;mysql>更新 user set passwordpassword(新密码) WHERE Userroot; …

strlen的神奇实现

https://blog.delphij.net/2012/04/freebsd-strlen3.html 与 Pascal 等语言不同&#xff0c;C 的字符串并不保存串的长度&#xff0c;而是在字符串末尾以 nul 字符&#xff08;\0&#xff09;来表示字符串结束。这个设计决策是上世纪 60 年代作出的&#xff0c;有都市传说是为了…

python求和_Python程序查找特殊求和系列的解决方案

python求和We are going to design a special sum series function which has following characteristics: 我们将设计一个特殊的求和系列函数&#xff0c;该函数具有以下特征&#xff1a; f(0) 0f(1) 1f(2) 1f(3) 0f(x) f(x-1) f(x-3)Python solution of the above sum…

linux内核设计与实现---进程管理

进程管理1 进程描述符及任务结构分配进程描述符进程描述符的存放进程状态设置当前进程状态进程上下文进程家族树2 进程创建写时拷贝fork()vfork()3 线程在Linux中的实现内核线程4 进程终结删除进程描述符孤儿进程造成的进退微谷5 小结进程的另一个名字叫做任务&#xff08;task…

JS错误代码解释大全+VBS错误代码解释大全

JScript 运行时错误 JScript 运行时错误是指当 JScript 脚本试图执行一个系统不能运行的动作时导致的错误。当正在运行脚本、计算变量表达式、或者正在动态分配内存时出现 JScript 运行时错误时。 错误号 描述 5029 数组长度必须为一有限正整数 5030 必须赋给数组长度一个有…

生日蜡烛(蓝桥杯)

某君从某年开始每年都举办一次生日party&#xff0c;并且每次都要吹熄与年龄相同根数的蜡烛。 现在算起来&#xff0c;他一共吹熄了236根蜡烛。 请问&#xff0c;他从多少岁开始过生日party的&#xff1f; 请填写他开始过生日party的年龄数。 注意&#xff1a;你提交的应该是…

python日历模块_Python日历模块| firstweekday()方法与示例

python日历模块Python calendar.firstweekday()方法 (Python calendar.firstweekday() Method) firstweekday() method is an inbuilt method of the calendar module in Python. It works on simple text calendars and returns the current setting for the weekday to start…

php 处理 mysql to json, 前台js处理

public function GetJson(){$query"select * from table";$result mysql_query($query);$rows array();while($row mysql_fetch_array($result)){$rows [] $row;}echo json_encode($rows); } js处理 $.get( "./bll.php", option,function(data ) {var j…

Linux内核设计与实现---进程调度

进程调度1 策略I/O消耗型和处理器消耗型的进程进程优先级时间片进程抢占2 Linux调度算法可执行队列优先级数组重新计算时间片schedule()计算优先级和时间片睡眠和唤醒负载平衡程序3 抢占和上下文切换用户抢占内核抢占4 实时5 与调度相关的系统调用与调度策略和优先级相关的系统…