0% found this document useful (0 votes)
52 views

MIC Assginment 3 Solution

The document discusses microprocessor addressing modes and machine instructions. It provides examples of immediate, register indirect, indexed and based addressing modes. It also explains functions of XLAT, LEA and AAA instructions and compares AND and TEST instructions.

Uploaded by

seemakasture75
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

MIC Assginment 3 Solution

The document discusses microprocessor addressing modes and machine instructions. It provides examples of immediate, register indirect, indexed and based addressing modes. It also explains functions of XLAT, LEA and AAA instructions and compares AND and TEST instructions.

Uploaded by

seemakasture75
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

JAYAWANT SHIKSHAN PRASARAK MANDAL’s

Bhivrabai Sawant Polytechnic


(Approved by AICTE, New Delhi, Govt. of Maharashtra, Affiliated to
MSBTE Mumbai)
Gat No. 720 (1&2), Wagholi, Pune-Nagar Road, Pune-412207)
Phone: 020 – 65335100 Tele fax: - + 91-020-65335100
E-mail: [email protected] Website: www.jspm.edu.in

Assignment No. 3 Solution

Course: -Microprocessor (MIC) Course Code: 22415

Que. Bloom’s Assignment Questions Relevance


No. Level to
CO
1 1 State any four examples of addressing modes?

Marking 4 mark
Scheme
Addressing Modes– The term addressing modes refers to the way in which the operand
of an instruction is specified. The addressing mode specifies a rule for interpreting or
modifying the address field of the instruction before the operand is actually executed.
Addressing modes for 8086 instructions are divided into two categories:
COI404.3
1) Addressing modes for data
2) Addressing modes for branch
Answer
The 8086 memory addressing modes provide flexible access to memory, allowing you to
easily access variables, arrays, records, pointers, and other complex data types. The key
to good assembly language programming is the proper use of memory addressing
modes.
Microprocessor - 8086 Addressing Modes

Immediate addressing mode. ...


Register addressing mode. ...
Direct addressing mode. ...
Register indirect addressing mode. ...
Based addressing mode. ...
Indexed addressing mode. ...
Based-index addressing mode. ...
Based indexed with displacement mode.

2 1,2 State any four examples of immediate addressing modes

Marking 2 Mark
Scheme
Answer
Immediate addressing mode
The addressing mode in which the data operand is a part of the instruction itself is known as
immediate addressing mode.
Example
MOV CX, 4929 H, ADD AX, 2387 H, MOV AL, FFH
COI404.3

3 3,4 Explain functions of following pins i)XLAT ii)LEA iii)AAA COI404.3

Marking
Scheme
XLAT-: XLAT Locates a byte entry in a table in memory, using the contents of the AL register as a table index, then
Answer copies the contents of the table entry back into the AL register.
XLAT changes the AL register from the table index to the table entry. AL should be the unsigned index
into a table addressed by DS:BX (for an address-size attribute of 16 bits) or DS:EBX (for an address-size
attribute of 32 bits). The operand to XLAT allows for the possibility of a segment override.
LEA-: Load effective address. The lea instruction places the address specified by its first operand into the
register specified by its second operand. Note, the contents of the memory location are not loaded, only the
effective address is computed and placed into the register.
AAA-; The AAA instruction is only useful when it follows an ADD instruction that adds (binary addition) two
unpacked BCD values and stores a byte result in the AL register. The AAA instruction then adjusts the
contents of the AL register to contain the correct 1-digit unpacked BCD result.
4 3 Compare AND & TEST instructions
Marking 2M
Scheme
The TEST instruction works same as the AND operation, but unlike AND instruction, it does not
Answer change the first operand. So, if we need to check whether a number in a register is even or odd,
we can also do this using the TEST instruction without changing the original number. COI404.3

5 1 COI404.3
List any four Machine instructions

Marking 2M
Scheme
classification of instruction set of 8086
 Data Transfer Instructions
Answer
 Arithmetic Instructions
 Bit Manipulation Instructions
 String Instructions

6 1,2 Describe various string instructions in brief COI404.3

6 MARK
1] REP: REP is a prefix which is written before one of the string instructions. It will cause During length
counter CX to be decremented and the string instruction to be repeated until CX becomes 0.
Two more prefix.
REPE/REPZ: Repeat if Equal /Repeat if Zero.
It will cause string instructions to be repeated as long as the compared bytes
or words Are equal and CX≠0.
REPNE/REPNZ: Repeat if not equal/Repeat if not zero.
It repeats the strings instructions as long as compared bytes or words are not
equal
And CX≠0.
Example: REP MOVSB
2] MOVS/ MOVSB/ MOVSW - Move String byte or word.
Syntax:
MOVS destination, source
MOVSB destination, source
MOVSW destination, source
Operation: ES:[DI]<----- DS:[SI]
It copies a byte or word a location in data segment to a location in extra
segment. The offset of source is pointed by SI and offset of destination is
pointed by DI.CX register contain counter and direction flag (DE) will be set
or reset to auto increment or auto decrement pointers after one move
Example
LEA SI, Source
LEA DI, destination
CLD
MOV CX, 04H
REP MOVSB
3] CMPS /CMPSB/CMPSW: Compare string byte or Words.
Syntax: CMPS destination, source
CMPSB destination, source
CMPSW destination, source
Operation: Flags affected < ----- DS:[SI]- ES:[DI]
It compares a byte or word in one string with a byte or word in another string.
SI Holds the offset of source and DI holds offset of destination strings. CS
contains counter and DF=0 or 1 to auto increment or auto decrement pointer
after comparing one byte/word.

7 1,3 Write the difference between JNC &JMP COI404.3

2M
JMP: - (unconditionally jump) The program sequence is transferred to the
memory location specified by the16-bit address given in the operand.

The JNC instruction transfers program control to the specified address if the
carry flag is 0. Otherwise, execution continues with the next instruction. No flags
are affected by this instruction.
Subject Teacher Module Coordinator H.O.D.

You might also like