Академический Документы
Профессиональный Документы
Культура Документы
Assembly Machine
Assembler
Language Language
Program
Program Code
INTRODUCTION TO 8085
Takes in:
The data that the microprocessor manipulates must come from somewhere.
It comes from what is called “input devices”.
These are devices that bring data into the system from the outside
world.
These represent devices such as a keyboard, a mouse, switches, and the
like.
Definition (Contd.)
Numbers:
There are only 10 type of people in the world one can understand others don’t
The microprocessor has a very narrow view on life. It only understands binary
numbers.
A binary digit is called a bit
The microprocessor recognizes and processes a group of bits together. This
group of bits is called a “word”.
The number of bits in a Microprocessor’s word, is a measure of its “abilities”.
Definition (Contd.)
Stored in memory :
First, what is memory?
Memory is the location where information is kept while not in current use.
Memory is a collection of storage devices. Usually, each storage device
holds one bit. Also, in most kinds of memory, these storage devices are
grouped into groups of 8. These 8 storage locations can only be accessed
together. So, one can only read or write in terms of bytes to form memory.
Memory is usually measured by the number of bytes it can hold. It is
measured in Kilos, Megas and lately Gigas. A Kilo in computer language is
=1024. So, a KB (KiloByte) is 1024 bytes. Mega is 1024 Kilos and Giga is
1024 Mega.
Definition (Contd.)
Stored in memory:
When a program is entered into a computer, it is stored in memory. Then as
the microprocessor starts to execute the instructions, it brings the instructions
from memory one at a time.
Memory is also used to hold the data. The microprocessor reads (brings in)
the data from memory when it needs it and writes (stores) the results into
memory when it is done.
Definition (Contd.)
Produces:
For the user to see the result of the execution of the program, the results must be
presented in a human readable form.
The results must be presented on an output device.
This can be the monitor, a paper from the printer, a simple LED or many
other forms.
8085 Architecture
8085 Architecture
The features of INTEL 8085 are :
• It is an 8 bit processor.
• It is a single chip N-MOS device with 40 pins.
• It has multiplexed address and data bus.(AD0-AD7).
• It works on 5 Volt dc power supply.
• The maximum clock frequency is 3 MHz while
minimum frequency is 500kHz.
• It provides 74 instructions with 5 different addressing
modes.
Contd..
Accumulator:
It is 8 bit general purpose register.
It is connected to ALU.
So most of the operations are done in Acc.
Temporary register: It is not available for user
All the arithmetic and logical operations are done in the
temporary register but user can’t access it.
Flag: It is a group of 5 flip flops used to know status of
various operations done.
The Flag Register along with Accumulator is called PSW
or Program Status Word.
Arithmetic and Logical group Contd..
S Z X AC X P X CY
Ac : Auxiliary carry flag is set when there is a carry out of lower nibble or
lower four bits of the operation.
• General purpose:
There are six general purpose registers in 8085 namely B,C,D,E,H,L.These are
used for various data manipulations.
• There are two special purpose registers in 8085:
SP :Stack Pointer.
PC:Program Counter.
Register Group Contd..
Instruction register:
When an instruction is fetched , it is executed in instruction
register. This register takes the Opcode value only.
Instruction decoder:
It decodes the instruction from instruction register and then
to control block.
Timing and control:
This is the control section of µP. It accepts clock input .
Interrupt Control
READY: This an output signal used to check the status of output device. If
it is low, µP will WAIT until it is high.
TRAP: It is an Edge triggered highest priority , non mask able interrupt.
After TRAP, restart occurs and execution starts from address 0024H.
RST5.5,6.5,7.5:These are maskable interrupts and have low priority than
TRAP.
INTR¯&INTA:INTR is a interrupt request signal after which µP generates
INTA or interrupt acknowledge signal.
IO/M¯:This is output pin or signal used to indicate whether 8085 is
working in I/O mode(IO/M¯=1) or Memory mode(IO/M¯=0 ).
Contd..
Memory Pointer
Flags Registers 8-bit Data
Bus
Instruction
Decoder
Control Bus
Timing and Control Unit
Accumulator (8-bit) Flag Register (8-bit)
S Z AC P CY
B (8-bit) C (8-bit)
D (8-bit) E (8-bit)
H (8-bit) L (8-bit)
Stack Pointer (SP) (16-bit)
Program Counter (PC) (16-bit)
The µP operates with reference to clock signal.The rise and fall of the pulse of
the clock gives one clock cycle.
Each clock cycle is called a T state and a collection of several T states gives a
machine cycle.
Important machine cycles are :
1.Op-code fetch.
2.Memory read.
3.Memory write.
4.I/Op-read.
5.I/O write.
MACHINE CYCLES OF 8085
The 8085 microprocessor has 5 basic machine cycles.
Opcode fetch cycle (4T)
Memory read cycle (3 T)
Memory write cycle (3 T)
I/O read cycle (3 T)
I/O write cycle (3 T)
Timing and State Diagram Cont..
Op-code Fetch:
In this mode, the address of the operand is given in the instruction itself.
LDA 2500 H //Load the contents of memory location 2500 H in
accumulator is the address of source.
LDA is the operation.
2500 H is the address of source
Accumulator is the destination.
Example: Direct Addressing
16-bit Address of the memory location is specified in the
instruction directly
Examples-
LDA 2050H ;load A with contents of memory
location with address 2050H
STA 3050H ;store A with contents of memory
location with address 3050H
Register Addressing Mode
H L
A 30H 20H 50H 2050H 30H
Immediate Addressing Mode
Note:
Assembly language is specific to a given processor
For e.g. assembly language of 8085 is different than
that of Motorola 6800 microprocessor
3.Instruction Set of 8085
Consists of
74 operation codes, e.g. MOV
246 Instructions, e.g. MOV A,B
8085 instructions can be classified as
1. Data Transfer (Copy)
2. Arithmetic
3. Logical and Bit manipulation
4. Branch
5. Machine Control
1. Data Transfer (Copy) Operations
1. Load a 8-bit number in a Register
2. Copy from Register to Register
3. Copy between Register and Memory
4. Copy between Input/Output Port and Accumulator
5. Load a 16-bit number in a Register pair
6. Copy between Register pair and Stack memory
Example Data Transfer (Copy)
Operations / Instructions
Copy A to C
• Copy A to register C
• Stop processing
Stop
5. Assembly Language Program
10011001 99H A
+
10011001 99H B
0
1 10011001
00110010 32H
99H A
C
Storing result in Register memory
C A
Y
1 10011001 32H
Register B Register C
Step-1 Copy A to C
Step-2
a) Clear register B
b) Increment B by 1
2. Program Logic
Copy A to C
Stop
5. Assembly Language Program