1 / 8

Assembly Language – Lab 6

Assembly Language – Lab 6. Register Indirect Mode, Based and Indexed Addressing Modes. Register Indirect Mode. Transfer a byte or word between a register and a memory location addressed by an index or base register. Example MOV AL, [SI] SI – index register

kobe
Download Presentation

Assembly Language – Lab 6

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. Assembly Language – Lab6 Register Indirect Mode, Based and Indexed Addressing Modes

  2. Register Indirect Mode • Transfer a byte or word between a register and a memory location addressed by an index or base register. • Example MOV AL, [SI] • SI – index register • The symbol [] always refer to an indirect addressing. • The register must be one of the following: BX, SI, DI, BP.

  3. Example 1 • Program that display the array elements.

  4. Example 2 • Program calculate sum in AX of 10 elements in the array. Use Indirect Mode.

  5. Based and Indexed Addressing Modes • The operand’s offset address is obtained by adding a number called a displacement to the contents of a register. • Displacement may be offset address of a variable, constant, offset address of a variable + or - a constant. • Syntax of the based-indexed addressing mode: • The register must be one of the following: Based: BX, BP– Indexed: SI, DI. • [register + displacement] • [displacement + register] • [register] + displacement • displacement + [register] • displacement[register]

  6. Example 3 • Replace each lower case letter in string by it’s upper case equivalence.

  7. Based and Indexed Addressing Modes • Suppose that LIST is declared as LIST DW 0542H,0126H,0953H,0DEFH BX contains 2 offset 0002 contains 1043H SI contains 4offset 0004 contains 0ABDH DI contains 1 • The result of following instructions:

  8. Example 4 • Program calculate the sum in AX of 10 elements in the array. Use Based and IndexedMode.

More Related