1.

Special functions of general-purpose registers:

Answer»

Special functions of general-purpose registers:

AX & DX registers:

In 8 bit multiplication, one of the operands must be in AL. The other operand can be a byte in memory location or in another 8 bit register. The resulting 16 bit product is stored in AX, with AH storing the MS byte. 

In 16 bit multiplication, one of the operands must be in AX. The other operand can be a word in memory location or in another 16 bit register. The resulting 32 bit product is stored in DX and AX, with DX storing the MS word and AX storing the LS word. 

BX register :

In instructions where we need to specify in a general purpose register the 16 bit effective address of a memory location, the register BX is used (register indirect). 

CX register :

In Loop Instructions, CX register will be always used as the implied counter.

In I/O instructions, the 8086 receives into or sends out data from AX or AL depending as a word or byte operation. In these instructions the port address, if greater than FFH has to be given as the contents of DX register.

Ex :IN AL, DX 

DX register will have 16 bit address of the I/P device 

Physical Address (PA) generation :

Generally Physical Address (20 Bit) = Segment Base Address (SBA) + Effective Address (EA) 

Code Segment :

Physical Address (PA) = CS Base Address + Instruction Pointer (IP)

Data Segment (DS)

PA = DS Base Address + EA can be in BX or SI or DI Stack Segment (SS) 

PA + SS Base Address + EA can be SP or BP 

Extra Segment (ES)

PA = ES Base Address + EA in DI 

Instruction Format :

The 8086 instruction sizes vary from one to six bytes. The OP code occupies six bytes and it defines the operation to be carried out by the instruction. 

Register Direct bit (D) occupies one bit. It defines whether the register operand in byte 2 is the source or destination operand. 

23 

Byte 3 Byte 4 

D=1 Specifies that the register operand is the destination operand. 

D=0 indicates that the register is a source operand. 

Data size bit (W) defines whether the operation to be performed is an 8 bit or 16 bit data 

W=0 indicates 8 bit operation 

W=1 indicates 16 bit operation 

7 2 1 0 7 6 5 4 3 2 1 0 

Opcode D W MOD REG R/M 

Low Disp/ 

DATA 

High Disp/ 

DATA

The second byte of the instruction usually identifies whether one of the operands is in memory or whether both are registers. 

This byte contains 3 fields. These are the mode (MOD) field, the register (REG) field and the Register/Memory (R/M) field.



Discussion

No Comment Found

Related InterviewSolutions