[go: up one dir, main page]

0% found this document useful (0 votes)
34 views3 pages

Question Bank From Unit-I and Unit-II Microprocessor and Microcontroller Addressing Modes

The document explains the six different addressing modes used in microprocessors and microcontrollers: register, register indirect, immediate, direct, base index, and relative base index addressing modes. Examples are provided for each addressing mode along with notes on default segments and valid instructions.

Uploaded by

Dr. Yogesh Misra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

Question Bank From Unit-I and Unit-II Microprocessor and Microcontroller Addressing Modes

The document explains the six different addressing modes used in microprocessors and microcontrollers: register, register indirect, immediate, direct, base index, and relative base index addressing modes. Examples are provided for each addressing mode along with notes on default segments and valid instructions.

Uploaded by

Dr. Yogesh Misra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question Bank from Unit-I and Unit-II

Microprocessor and Microcontroller

Addressing Modes

Q. 1 Explain the following address modes with example:


(i) Register addressing mode (ii) Register indirect addressing mode
(iii) Immediate addressing mode (iv) Direct addressing mode
(v) Base Index Addressing Mode (vi) Relative Base Index Addressing Mode
(i) Register addressing mode: In this address mode the data is stored in a register and it is
referred using the particular register. All registers except IP may be used in this mode.
Examples
(a) MOV BX, AX
(b) MOV DL, AL
(c) MOV SI, DX
Restrictions on the use of segment registers:
(a) We may not specify CS as destination operand. For example, MOV CS, AX is not an valid
instruction
(b) Only one operand can be segment register. We can not move data from one segment
register to another segment register directly. For example, MOV DS, SS is an invalid instruction.

(ii) Register indirect addressing mode: In this addressing mode the offset address of the data is
in any one of the register (base register or index register) BX, BP, SI OR DI.
Four forms of this addressing mode are:
(a) MOV AL, [BX]
(b) MOV AL, [BP]
(c) MOV AL, [SI]
(d) MOV AL, [DI]
Please note:
 If the offset address is in [BP] then default segment of data is SS.
 If the offset address is in [BX], [SI] and [DI] then the default segment of data is DS.
 We can use segment override prefix symbol if we wish to access data in different segment.
For example:

©Prepared By: Dr. Yogesh Misra, Professor in ECE, GMRIT, Rajam


1
MOV AL, SS: [BX].
In above example data will be accessed from SS segment instead of default segment of [BX].

(iii) Immediate addressing mode: In this the immediate data is a part of instruction and appear
in the form of successive byte or bytes.
For examples:
(a) MOV AX, 3456H
(b) MOV BL, 56H
Please note:
Segement registers can not be used as destination in immediate addressing mode.

(iv) Direct addressing mode: In this offset address of the data is given in the instruction.
For example:
(a) MOV AL, [4568H]
In above instruction offset address of 8 bit data will be stored in AL is [4568H]. The default segment
of data is DS.
(b) MOV AX, [4000H]
In above instruction 8 bit data of offset address [4000H] will be stored in AL and 8 bit data at offset
address [4001H] will be stored in AH. The default segment of data is DS.

Please note:
 We can use segment override prefix symbol if we wish to access data in different segment.
For example:
MOV AL, SS: [4000].
In above example data will be accessed from SS segment instead of default segment DS.

(v) Base Index Addressing Mode: In this addressing mode the offset address of the data is calculated
using base register (BX and BP) and index register (SI and DI).
Four forms of this addressing mode are:

(a) MOV AL, [BX][[SI] ; offset address of data is [BX + SI]


(b) MOV AL, [BX][DI] ; offset address of data is [BX + DI]
(c) MOV AL, [BP][SI] ; offset address of data is [BP + SI]
(d) MOV AL,[BP][DI] ; offset address of data is [BP + DI]
Please note:

©Prepared By: Dr. Yogesh Misra, Professor in ECE, GMRIT, Rajam


2
 If the base register BX is involved in an instruction then the default segment of data is DS.
 If the base register BP is involved in an instruction then the default segment of data is SS.
For example:
MOV AL, [BX][SI].
In above example data will be accessed from DS segment and offset address of data is [BX + SI].

(vi) Relative Base Index Addressing Mode: In this addressing mode the offset address of the data is
calculated using 8-bit/16-bit relative value, base register (BX and BP) and index register (SI and DI).
Four forms of this addressing mode are:

(a) MOV AL, 8-bit/16-bit relative value [BX][[SI] ; offset address of data is [8-bit/16-bit relative value
+ BX + SI]
(b) MOV AL, 8-bit/16-bit relative value [BX][DI] ; offset address of data is [8-bit/16-bit relative value
+ BX + DI]
(c) MOV AL, 8-bit/16-bit relative value [BP][SI] ; offset address of data is [8-bit/16-bit relative value +
BP + SI]
(d) MOV AL, 8-bit/16-bit relative value [BP][DI] ; offset address of data is [8-bit/16-bit relative value
+ BP + DI]
Please note:
• If the base register BX is involved in an instruction then the default segment of data
is DS.
• If the base register BP is involved in an instruction then the default segment of data
is SS.
For example:
MOV AL, 34H[BX][SI].
In above example data will be accessed from DS segment and offset address of data is [34H + BX +
SI].

©Prepared By: Dr. Yogesh Misra, Professor in ECE, GMRIT, Rajam


3

You might also like