Microprocessor and Interfacing Notes Lab Reports
Microprocessor and Interfacing Notes Lab Reports
The instruction format of 8086 has one or more number of fields associated
with it.
The first filled is called operation code field or opcode field, which indicates
the type of operation.
The instruction format also contains other fields known as operand fields.
37 H
Adjust for addition AAA 00110111
Here the operand to this instruction is implicit and it take the contents of
register AL.
Register to Register : This format is 2 bytes long. The first byte of
the code specifies the operation code and the width of the operand
specifies by w bit. The second byte of the opcode shows the register
operands and RIM field
Register to/from memory with no displacement : This format is also 2
bytes long and similar to the register to register format except for the MOD
field.
d) Register to/from Memory with Displacement :
This type of instruction format contains one or two additional bytes for
displacement along with 2-byte the format of the register to/from memory
without displacement.
e) Immediate operand to register
ADDRESSING MODES OF 8086
The method of specifying data to be operated by an instruction is called as
addressing mode.
The different ways that a processor can access the data are referred to as
addressing modes.
1. Immediate addressing
2. Direct addressing
3. Register addressing
5. Register Relative
(a) Relative Based(b) Relative Indexed (c) Relative Based Indexed
6. Implicit addressing
7. Addressing modes for Control transfer / Branch Instructions
(a) Intra segment mode (b) Inter segment mode
8. I/O port addressing
1. Immediate addressing:
The operand (or) data is given in the instruction itself.
2. Direct addressing:
The Offset address of operand or data is given in the instruction
itself.
The Offset address is formed by adding 8-bit (or) 16-bit signed Displacement
to the content of Base / Index registers.
(a) RelativeBased addressing: The Offset address is the sum of the content of Base
register BX or BP and 8 bit or 16-bit signed Displacement
IN AL, 80H ; It reads one byte of data from I/O port address 80H to AL
OUT 82H, AL ; It sends one byte of data from AL to I/O port address 82H
JMP [3000H];
INSTRUCTION SET
The 8086 Instruction set is classified as
Arithmetic instructions
XLAT: Translate
This translate instruction is used for finding out codes in
code conversion problems, using lookup table technique.
Ex: XLAT: Translate byte to AL.
SBB:
NEG: Negate
It forms the 2’s complement of the specified destination in
the instruction.
AAA: ASCII Adjust after Addition
It is executed after an ADD instruction that adds two
ASCII operands to give byte result in AL.
AAA converts the result in AL into unpacked decimal
digits.
AAS : ASCII Adjust after Subtraction
NOT [5000H]
TEST [0500H],06H
SHL/SAL: Shift left/Shift Arithmetic left
These instructions shift the operand word or byte bit by
bit to the left and insert zeros in the newly introduced
least significant bits.
3. ECE DB 58H
DW-Define Word:
It is used to reserve word or words of memory location
in the available memory.
Ex: WORDS DW 1234H,4567H,78ABH
DATA DW 5 DUP (6666H)
EQU: Equate
It is used to assign a label with a value or symbol.
Ex:
N EQU 69
LABEL EQU 0500H
ADDITION EQU ADD
PUBLIC: Public
It informs the assembler that the names, procedures and
labels declared using this directive can be accessed from
anywhere.
EXTRN: External
It used to access the names, procedures and labels declared
using PUBLIC directive .
MODULE1 ENDS
MODULE2 SEGMENT
MODULE2 ENDS
GROUP: Group the related segments
It form a logical groups of segments with similar purpose
or type within 64KB. Thus all such segments and labels
can be addressed using the same segment base.
LABEL:
It is used to assign a name to the current contents of
program counter or location counter.
LENGTH: Byte length of a label
It is used to find byte length of a data array or a string.
LOCAL:
The lables,variables,constants or procedures declared
LOCAL in a module are to be used only by that particular
module.
Ex: LOCAL a,b,DATA
NEAR PTR:
It indicates that the label followed by NEAR PTR is in the
same segment.
Ex: JMP NEAR PTR LABEL
FAR PTR:
TYPE:
It is used to decide the data type of the specified label and
replaces TYPE label by the decided data type.
SHORT:
It indicates to the assembler that only one byte is
required to code the displacement for a jump.
The displacement is within -128 to +128 bytes.