1 / 17

MICROPROCESSOR BASED SYSTEM DESIGN

MICROPROCESSOR BASED SYSTEM DESIGN. Lecture # 11 - 12. BY PROF. DR. B. S. CHOWDHRY. BASED ADDRESSING MODE. In this addressing mode, the PA of the operand is obtained by adding a displacement to the contents of either Base Register BX or Base Pointer BP and the current value in DS or SS resp.

emilia
Download Presentation

MICROPROCESSOR BASED SYSTEM DESIGN

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. MICROPROCESSOR BASED SYSTEM DESIGN Lecture # 11 - 12 BY PROF. DR. B. S. CHOWDHRY

  2. BASED ADDRESSING MODE • In this addressing mode, the PA of the operand is obtained by adding a displacement to the contents of either Base Register BX or Base Pointer BP and the current value in DS or SS resp. Example: MOV [ BX ] + BETA, AL Or MOV [ BX ] + [1234], AL This instruction uses base register BX & direct displacement BETA to derive to EA of the destination operand.

  3. PA = 02000H + 1000H + 1234H DS = 0200(0)H BX = 100 0 H Displacement ETA= 1234 H ___________ 04234 H The contents of source operand AL are written into the storage location at 04234 H. Note: (1) The default segment register can be changed with segment override prefix (SEG). (2) If BP is used instead BX, the calculation of the physical address is performed using contents of SS register instead of DS

  4. INDEXED ADDRESSING MODE • Indexed addressing mode works in a similar way to the Based Addressing Mode except indexed addressing mode uses the value of the displacement as a pointer to the starting point of an array of data in memory and the contents of the specified index register as an index that selects the specific element in the array that is to be accessed.

  5. Example MOV AL, [ SI ] + ARRAY Notation ARRAY is the direct displacement The effective address is calculated as EA = (SI) + ARRAY And physical address is obtained by combining the contents of DS with EA. PA = DS = 0200 (0) SI = 0200 0 H ARRAY= 123 4 H ______________ 05234 PA = 05234 H Then the byte of data stored at this location, which is BEH, is moved to AL register.

  6. BASED – INDEXED ADDRESSING MODE • Combining the based addressing mode and the indexed addressing mode together results in a new, more powerful mode known as based – indexed addressing. • It can be used to access elements in mxn array of data

  7. Notice that displacement, which is fixed in value locates the array in memory. • The base register specifies m element of array and index register identifies the n element. • Any element in the array can be accessed by simply changing the values in the base & index registers.

  8. Example MOV AH, [ BX ] [ SI ] + BETA or MOV AH, [BX+SI) + BETA Source operand is accessed using based-indexed addressing mode, Therefore the EA of the source operand will be: EA = (BX) + (SI) + BETA and PA of the operand from the current DS and the calculated EA will be: DS = 0200 (0) BX = 0100 0 SI = 0200 0 Displacement Beta = 123 4 ____________ 06234 H PA =06234 H • Execution of the instruction causes the value stored at this location to be read into AH register.

More Related