1 / 15

Memory Addressing

Memory Addressing. Computer Studies (Advanced Level). Content. Introduction to addressing mode 8088 addressing mode. Addressing mode categorization. Register mode: The data stored in registers are used by the instruction

akiko
Télécharger la présentation

Memory Addressing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Memory Addressing Computer Studies (Advanced Level)

  2. Content • Introduction to addressing mode • 8088 addressing mode

  3. Addressing mode categorization • Register mode: The data stored in registers are used by the instruction • Memory mode: These instructions permits the usage of data directly form memory. The effective address can be specified by the operand directly or may be stored in an address register. The effective address means the actual address pointed by the an addressing mode.

  4. 8088 addressing mode • 1. Immediate Addressing mode • The required data by the operation is directly included in the instruction. It can be used as the assignment function to initialize the register. • MOV AX, 1MOV BX, 2

  5. 8088 addressing mode • 2. Direct Addressing Mode • The data is stored in the memory. But the effective address for data’s memory location is contained the instruction. The object of the addressing mode is generally label much like a variable such as AA or TABLE, etc. • MOV SUM, 1 • MOV AH, TABLE

  6. 8088 Addressing mode • 3. Register Addressing Mode • The operand is fetched from or loaded into a register. Usually the result is stored in AX, because in this way, the execution time is shorter cooperatively. • ADD AX, BX • SUB AX, AX

  7. 8088 Addressing mode • 4. Register Indirect Addressing Mode • The effective address of operand is contained in BX, BP, SI or DI. These registers must be placed in square brackets to avoids confusion with normal register addressing mode. • MOV [SI], 0 • MOV AX, [BX]

  8. 8088 Addressing Mode • 5. Base Relative Addressing Mode • The effective address for the operand is obtained by adding a displacement to either the BX or BP register. These registers are assumed to contain an offset address. • MOV AX, [BX] +4

  9. Remark • In Some assembler, the following three formats are equivalent: • MOV AX, [BX]+4 • MOV AX, 4[BX] • MOV AX, [BX+4] • You may put the displacement first, or within the brackets

  10. 8088 Addressing modes • 6. Direct Indexed Addressing Mode • The effective address of the required is the sum of an index register (SI or DI) and an offset. A typical sequence of instructions would be to load the index register with an address and then combine this with a memory location. • MOV DI, 4 • MOV AX, TABLE[DI]

  11. 8088 Addressing Mode • 7. Base Indexed Addressing Mode • The effective address is the sum of a base register (BX), and index register (SI or DI) and an offset (optional) • MOV BX, 100MOV DI, 10MOV AX, TABLE[BX][DI]

  12. Remark • The following descriptions are all correct: • MOV AX, [BX+TABLE+DI]MOV AX, [DI+BX+TABLE]MOV AX, [BX+TABLE][DI]MOV AX, [BX][DI+TABLE]

  13. 8088 Implicit (暗示的) Operand • RET • When a subroutine is called, the instruction pointer is saved on the stack and the new address of the branch is get into PC. When the program returns, the instruction returns control to the address pushed by a previous call pointed by the SP. • PUSH AX • The instruction decrements SP by 2, and then transfers a word (16-bit) form the source to the stack. At the position address by SP.

  14. Effective Address • Effective address = Segment address + offset address Offset Address (Where does it come from?) Please refer to 9-1-2 ppt

  15. Question • How to obtain effective address? • Segment + offset • Binary vs hexadecimal • How many bits do the result has?

More Related