Question: Explain with suitable examples the following instructions of 8086. i). MOVSB ii). LEA iii). ROL iv). CLC v). CBW
0
ADD COMMENTlink
modified 5 weeks ago by gravatar for Abhishek Tiwari Abhishek Tiwari ♦♦ 50 written 13 months ago by gravatar for Mohd Farhan Mohd Farhan0
0

i). MOVSB

It is used to transfer a byte from data segment to extra segment. The offset address of the source in data segment is in SI. The offset address of the destination in extra segment is in DI. SI and DI are incremented/decremented depending upon the direction flag.

Example:

MOVSB ; ES:[DI] = DS:[SI] … byte transfer
SI = SI ± 1 … depending upon DF
DI = DI ± 1 … depending upon DF

ii). LEA LEA Register, Source

This instruction Loads Effective Address (offset address) of the source into the given register.

Example:

LEA BX, Source-1 ; BX = offset address of Source-1 in Data Segment.

iii). ROL

ROL Destination, count
Left-Shifts the bits of destination. MSB shifted into the CARRY. MSB also goes to LSB. Bits are shifted 'count' number of times.

If count = 1, it is directly specified in the instruction.

If count > 1, it has to be loaded in the CL register, and CL gives the count in the instruction.

Destination: Register, Memory Location

Example:

ROL BL, 01H ; Left-Shift BL bits once.
MOV CL, 0AH ; Load number of shifts in CL register.

ROL BL, CL ; Left-Shift BL bits CL (10) number of times

iv). CLC

This instructions is processor or machine control instruction. CLC is used to clears the Carry Flag. No other flags are affected.

v). CBW

This instruction convert signed BYTE to signed WORD. It copies sign of the byte in AL into all the bits of AH. AH is then called sign extension of AL. No Flags affected.

Example: Assume

AX = XXXX XXXX 1001 0001
Then CBW gives AX = 1111 1111 1001 0001

ADD COMMENTlink
written 12 months ago by gravatar for Mohd Farhan Mohd Farhan0
Please log in to add an answer.