Vous êtes sur la page 1sur 23

ECE 010 506

MODULE 2 DEC

MICROPROCESSORS AND APPLICATIONS

13

MODULE 2

EC010 506 MICROPROCESSORS AND APPLICATIONS


Course Notes

Module II (12 hours)


Intel 8085 instruction set - instruction and data format simple programs - programs in looping,
counting and indexing 16 bit arithmetic operations - stack and subroutines - basic concepts in serial I/O
8085 serial I/O lines

Instruction Set
8085 instruction set consists of the following instructions:

MODULE 2
Data moving instructions.

Arithmetic - add, subtract, increment and decrement.

Logic - AND, OR, XOR and rotate.

Control transfer - conditional, unconditional, call subroutine, return from subroutine and restarts.

Input/Output instructions.

Other - setting/clearing flag bits, enabling/disabling interrupts, stack operations, etc.

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.

Instruction word size


The 8085 instruction set is classified into the following three groups according to
word size:
1. One-word or 1-byte instructions
2. Two-word or 2-byte instructions
3. Three-word or 3-byte instructions
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.
3

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.)

Basic Input/Output Interfacing


The process of reading input signals and sending output signals is called input/output (I/O). The
subsystems are known as I/O subsystems which are sometimes called an interface. Input and output
are similar to memory accesses. The processor can transfer data to and from the peripherals in the
same way that it transfers data to and from memory. In fact, memory is simply another peripheral.
I/O
direction is relative to the MCU. Input is data read by the MCU. Output is data sent out by the MCU.
A simple I/O section in a microcomputer system may include a temperature sensor that provides
data
every 5 minutes, a modem device that transfers 56K bits every second and a floppy disk that
transfers
bits in the order of megabits per second.
Simple Input Interface
An input operation is similar to a memory read cycle.
1. P generates address and control signals to select the input device.
2. Input device generates data and loads data lines.
3. P reads data from the data bus and places it in a register.
Most Ps accept data from an input device through the data bus connections and therefore require
some form of switch to connect this data to the bus at the appropriate time. One effective digital

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

Vous aimerez peut-être aussi