存储器间接寻址方式
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:
程序存储器寻址模式中还包含另外三种寻址模式。 他们是:
Direct Program memory Addressing
直接程序存储器寻址
Indirect Program memory Addressing
间接程序存储器寻址
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
存储器间接寻址方式