Académique Documents
Professionnel Documents
Culture Documents
MODULE 2 DEC
13
MODULE 2
Instruction Set
8085 instruction set consists of the following instructions:
MODULE 2
Data moving instructions.
Control transfer - conditional, unconditional, call subroutine, return from subroutine and restarts.
Input/Output instructions.
Instruction Format
An instruction is a command to the microprocessor to perform a given task on a
specified data. Each instruction has two parts: one is task to be performed, called the
operation code (opcode), and the second is the data to be operated on, called the
operand. The operand (or data) can be specified in various ways. It may include 8-bit
(or 16-bit ) data, an internal register, a memory location, or 8-bit (or 16-bit) address.
In some instructions, the operand is implicit.
MODULE 2
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.
MODULE 2
MODULE 2
MODULE 2
MODULE 2
MODULE 2
MODULE 2
10
MODULE 2
11
MODULE 2
12
MODULE 2
13
MODULE 2
14
MODULE 2
15
MODULE 2
16
MODULE 2
17
MODULE 2
18
MODULE 2
Sample Programs
Write an assembly program to add two numbers
19
MODULE 2
Program
MVI D, 8BH
MVI C, 6FH
MOV A, C
1100 0011
1000 0101
0010 0000
ADD D
OUT PORT1
HLT
Write an assembly program to multiply a number by 8
Program
MVI A, 30H
RRC
RRC
RRC
OUT PORT1
HLT
Write an assembly program to find greatest between two numbers
Program
MVI B, 30H
MVI C, 40H
MOV A, B
CMP C
JZ EQU
JC GRT
OUT PORT1
20
MODULE 2
HLT
EQU: MVI A, 01H
OUT PORT1
HLT
GRT: MOV A, C
OUT PORT1
HLT
Basic concept of serial IO
Interfacing is the process of connecting devices together so that they can exchange information. A
special interface must translate between the signal that the computer uses and those that the
peripheral
uses. An interface includes the physical connection, the hardware and a set of rules or procedures,
i.e.,
the software. The interface must provide the proper timing and control. Formally, an interface is a
device and/or set of rules to match the output of one device to the input of another device for
sending
information from one to the other. For example, the connection between a microprocessor and
external memory is an interface. There are physical connections for addressing, data flow and
control
signals. The software consists of instructions that read from and/or write to an addressed location.
The major problems with interfacing are:
- wide variety of peripheral devices
- enormous range of peripheral speeds
- variety in signal types and signal levels in peripheral devices
- complexity of the signaling structure (strobes, handshaking, etc.)
21
MODULE 2
switch available is the three-state buffer.
Example: Eight On/Off switches can be connected to the CPU by the use of a three-state buffer as
follows:
Serial I/O
Uses a single line to transmit bits one after the other. This reduces the number of lines but
slows down the rate of data transfer.
May be synchronous or asynchronous.
SID and SOD pins are used for serial I/O
22
MODULE 2
23