MPMC Lecture 3
MPMC Lecture 3
UPCIE501
By
Ananya Dastidar
Assistant Professor
Department of Instrumentation and Electronics Engineering
For
As per
CET, Bhubaneswar (Autonomous) Syllabus
The instruction set of 8085 microprocessor is classified into the following types.
Data Transfer Instruction
Arithmetic Instructions
Logical Instructions
Branching Instructions
Control Instructions
Accumulator
CY D7 D6 D5 D4 D3 D2 D1 D0
Before Execution
D7 D6 D5 D4 D3 D2 D1 D0 D7
After Execution
If A=44H, CY=1 before execution what will be the value of A and carry bit of flag register after
execution.
Rotate accumulator right Each binary bit of the accumulator is rotated right by
RRC none one position. Bit D0 is placed in the position of D7 as
well as in the Carry flag. CY is modified according to
bit D0. S, Z, P, AC are not affected.
Example: RRC
Before Execution
23| UPCIE501 Microprocessor & Microcontroller Module I
D0 D7 D6 D5 D4 D3 D2 D1 D0
After Execution
If A=44H, CY=1 before execution what will be the value of A and carry bit of flag register after
execution.
Before Execution
D7 D6 D5 D4 D3 D2 D1 D0 CY
After Execution
If A=44H, CY=1 before execution what will be the value of A and carry bit of flag register after
execution.
Each binary bit of the accumulator is rotated right by
one position through the Carry flag. Bit D0 is placed
Rotate accumulator right through carry in the Carry flag, and the Carry flag is placed in the
RAR none most significant position D7. CY is modified
according to bit D0. S, Z, P, AC are not affected.
Example: RAR
Accumulator
D7 D6 D5 D4 D3 D2 D1 D0 CY
Before Execution
After Execution
If A=44H, CY=1 before execution what will be the value of A and carry bit of flag register after
execution.
The contents of the accumulator are
Complement accumulator
Complemented. No flags are
CMA none
affected. Example: CMA
The Carry flag is complemented. No other flags are
Complement carry
Affected.
CMC none
Example: CMC
Set Carry The Carry flag is set to 1. No other flags are affected.
STC none Example: STC
Branching Instructions
These instructions are used to access subroutines or do implement loop.
Opcode Operand Description
Jump unconditionally The program sequence is transferred to the memory location
JMP 16-bit address specified by the 16-bit address given in the operand.
Example: JMP 76ADH
Jump conditionally
Jump Opcode XXXXH
XXXX16-bit Address
Opcode Description Flag Status
JC XXXXH Jump on Carry CY = 1 The program sequence is transferred to the memory location
JNC XXXXH Jump on no Carry CY = 0 specified by the 16-bit address given in the operand based on
JP XXXXH Jump on positive S = 0 the specified flag of the PSW as described below.
JM XXXXH Jump on minus S = 1 Example: JZ DEDB H
JZ XXXXH Jump on zero Z=1
JNZ XXXXH Jump on no zero Z=0
JPE XXXXH Jump on parity even P=1
JPO XXXXH Jump on parity odd P=0
The program sequence is transferred to the memory location
specified by the 16-bit address given in the operand. Before
Unconditional subroutine call
the transfer, the address of the next instruction after CALL
CALL opcode 16-bit address
(the contents of the program counter) is pushed onto the stack.
Example: CALL 4522H
Conditional subroutine call
XXXX16-bit address The program sequence is transferred to the memory location
Opcode Description Flag Status specified by the 16-bit address given in the operand based on
CC XXXXH Call on Carry CY = 1 the specified flag of the PSW as described below. Before the
CNC XXXXH Call on no Carry CY = 0 transfer, the address of the next instruction after the call (the
CP XXXXH Call on positive S = 0 contents of the program counter) is pushed onto the stack.
CM XXXXH Call on minus S = 1 Example: CZ 5566H
CZ XXXXH Call on zero Z=1
Source:https://viaefiraz9.weebly.com/blog/download-opcode-sheet-for-8085-microprocessor-
programming
In the 8085, "byte" and "word" are synonymous because it is an 8-bit microprocessor. However,
instructions are commonly referred to in terms of bytes rather than words.
One-Byte Instructions
A 1-byte instruction includes the opcode and operand in the same byte. Operand(s) are internal
register and are coded into the instruction. These instructions are stored in 8- bit binary format in
memory; each requires one memory location. The assembly language instruction is written as
opcode
Examples- MOV A, B
SUB B
CMA
These instructions are 1-byte instructions performing three different tasks.
In the first instruction, both operand registers are specified.
In the second instruction, the operand B is specified and the accumulator is assumed.
In the third instruction, the accumulator is assumed to be the implicit operand.
Two-Byte Instructions
In a two-byte instruction, the first byte specifies the operation code and the second byte specifies
the operand. The instruction would require two memory locations for storage in memory. The
assembly language instruction is written as opcode+data byte
Examples
MVI A, 45H coded as 3EH, 45H as two contiguous bytes. This is an example of immediate
addressing.
ADI 33H
OUT 80H
The first instruction moves the immediate data (45H) into the destination register, Accumulator
The second instruction adds the immediate data (33H) to the contents of the Accumulator
Three-Byte
Instructions
In a three-byte instruction, the first byte specifies the opcode, and the following two
bytes specify the 16-bit address. Note that the second byte is the low-order address and the third
byte is the high-order address. This instruction would require three memory locations to
store in memory. The assembly language instruction is written as opcode + data byte + data
byte
For example:
LXI rp,
4500H
rp is one of the pairs of registers BC, DE, HL used as 16-bit registers. The two data bytes are
16- bit data in L H order of significance.
LXI H,4500H (21H, 00H, 45H in three bytes). This is also immediate
addressing. LDA 2500H
A <-- (addr) Addr is a 16-bit address in L H order. Example: LDA 2134H coded as 3AH
34H
21
H.
This is also an example of direct
addressing.
Tas
k