com
Single + 5V Supply
On Chip System Controller; Advanced Cycle Status Information Available for Large System Control
The Intel 8085A is a new generation, complete 8 bit parallel central processing unit (CPU). Its instruction set is 100% software compatible with the 8080A
microprocessor, and it is designed to improve the present 8080's performance by higher system speed. Its high level of system integration allows a minimum
system of 3 IC's: 8085A (CPU), 8156 (RAM), and 8355/ 8755A (ROM/PROM).
The 8085A incorporates all of the features that the 8224 (clock generator) and 8228 (system controller) provided for the 8080, thereby offering a high level of
system integration.
The 8085A uses a multiplexed data bus. The address is split between the 8bit address bus and the 8bit data bus. The on chip address latches of
8155/8156/8355/8755A memory products allows a direct interface with the 8085A.
www.vidyarthiplus.com
The 8085A uses a multiplexed Data Bus. The address is split between the higher 8bit Address Bus and the lower 8bit Address/Data Bus. During the first cycle
the address is sent out. The lower 8bits are latched into the peripherals by the Address Latch Enable (ALE). During the rest of the machine cycle the Data Bus
is used for memory or l/O data.
The 8085A provides RD, WR, and lO/Memory signals for bus control. An Interrupt Acknowledge signal (INTA) is also provided. Hold, Ready, and all
Interrupts are synchronized. The 8085A also provides serial input data (SID) and serial output data (SOD) lines for simple serial interface.
In addition to these features, the 8085A has three maskable, restart interrupts and one nonmaskable trap
interrupt.
Clock output
www.vidyarthiplus.com
The internal clock generator requires an external crystal or RC network. It will oscillate at twice the basic CPU operating frequency. A 50% duty cycle, two
phase, nonoverlapping clock is generated from this oscillator internally and one phase of the clock (2) is available as an external clock. The 8085A directly
provides the external RDY synchronization previously provided by the 8224. The RESET IN input is provided with a Schmitt action input so that power on
reset only requires a resistor and capacitor. RESET OUT is provided for System RESET.
The 8085A provides RD, WR and IO/M signals for Bus control. An INTA which was previously provided by the 8228 in 8080 system is also included in
8085A.
Status Information
Status information is directly available from the 8085A. ALE serves as a status strobe. The status is partially encoded, and provides the user with advanced
timing of the type of bus transfer being done. IO/M cycle status signal is provided directly also. Decoded So ,S carries the following status information:
HALT
WRITE
READ
FETCH
S1 can be interpreted as R/W in all bus transfers.
In the 8085A the 8 LSB of address are multiplexed with the data instead of status. The ALE line is used as a strobe to enter the lower half of the address into
the memory or peripheral address latch. This also frees extra pins for expanded interrupt capability.
Interrupt and Serial l/O
The8085A has5 interrupt inputs: INTR, RST5.5, RST6.5, RST 7.5, and TRAP. INTR is identical in function to the 8080 INT Each of three RESTART inputs,
5.5, 6.5. 7.5, has a programmable mask. TRAP is also a RESTART interrupt except it is nonmaskable.
The three RESTART interrupts cause the internal execution of RST (saving the program counter in the stack and branching to the RESTART address) if the
interrupts are enabled and if the interrupt mask is not set. The nonmaskable TRAP causes the internal execution of a RST independent of the state of the
interrupt enable or masks.
_________ _________
_|
--> X1 |_|1
_|
--> X2 |_|2
_|
\__/
|_
_|
_|
|_
|
39|_| HOLD <--
|_
|
|
|
|
|
|
www.vidyarthiplus.com
|
_|
_|
|
|
|
|
|
_|
_|
_|
_|
_|
_|
_|
_|
_|
32|_| RD -->
|_ __
8085A
____ _|
<-- INTA |_|11
|_ __
33|_| S1 -->
_|
|_
_|
_|
|_
|
|
31|_| WR -->
|_
|
30|_| ALE -->
|_
|
29|_| S0 -->
|_
|
28|_| A15 -->
|_
|
27|_| A14 -->
|_
|
26|_| A13 -->
|_
|
25|_| A12 -->
|_
|
24|_| A11 -->
|_
|
23|_| A10 -->
|_
|
22|_| A9 -->
|_
|
|
21|_| A8 -->
|______________________|
|
|
|
The following describes the function of each pin :
A6 A1s (Output 3 State)
Address Bus; The most significant 8 bits of the memory address or the 8 bits of the I/0 address,3 stated during Hold and Halt modes.
ADo 7 (Input/Output 3state)
Multiplexed Address/Data Bus; Lower 8 bits of the memory address (or I/0 address) appear on the bus during the first clock cycle of a machine state. It then
becomes the data bus during the second and third clock cycles.3 stated during Hold and Halt modes.
www.vidyarthiplus.com
ALE (Output)
Address Latch Enable: It occurs during the first clock cycle of a machine state and enables the address to get latched into the on chiplatch of peripherals. The
falling edge of ALE isset to guarantee setup and hold times for the address information . ALE can also be used to strobe the status information. ALE is never 3
stated.
SO, S1 (Output)
Data Bus Status. Encoded status of the bus cycle:
S1 So
O O HALT
0 1 WRITE
1 0 READ
1 1 FETCH
S1 can be used as an advanced R/W status.
RD (Output 3state)
READ; indicates the selected memory or 1/0 device is to be read and that the Data Bus is available for the data transfer. 3stated during Hold and Halt.
WR (Output 3state)
WRITE; indicates the data on the Data Bus is to be written into the selected memory or 1/0 location. Data is set up at the trailing edge of WR. 3stated during
Hold and Halt modes.
READY (Input)
If Ready is high during a read or write cycle, it indicates that the memory or peripheral is ready to send or receive data. If Ready is low, the CPU will wait for
Ready to go high before completing the read or write cycle.
HOLD (Input)
HOLD; indicates that another Master is requesting the use of the Address and Data Buses. The CPU, upon receiving the Hold request. will relinquish the use of
buses as soon as the completion of the current machine cycle. Internal processing can continue. The processor can regain the buses only after the Hold is
removed. When the Hold is acknowledged, the Address, Data, RD, WR, and IO/M lines are 3stated.
HLDA (Output)
HOLD ACKNOWLEDGE; indicates that the CPU has received the Hold request and that it will relinquish the buses in the next clock cycle. HLDA goes low
after the Hold request is removed. The CPU takes the buses one half clock cycle after HLDA goes low.
INTR (Input)
INTERRUPT REQUEST; is used as a general purpose interrupt. It is sampled only during the next to the last clock cycle of the instruction.
If it is active, the Program Counter (PC) will be inhibited from incrementing and an INTA will be issued. During this cycle a RESTART or CALL instruction
can be inserted to jump to the interrupt service routine. The INTR is enabled and disabled by software. It is disabled by Reset and immediately after an interrupt
is accepted.
INTA(Output)
INTERRUPT ACKNOWLEDGE; is used instead of (and has the same timing as) RD during the Instruction cycle after an INTR is accepted. It can be used to
activate the 8259 Interrupt chip or some other interrupt port.
RST5.5
RST 6.5 - (Inputs)
RST7.5
RESTART INTERRUPTS; These three inputs have the same timing as I NTR except they cause an internal RESTART to be automatically inserted.
RST 7.5 ~~ Highest Priority
RST 6.5
www.vidyarthiplus.com
RST 5.5 o Lowest Priority
The priority of these interrupts is ordered as shown above. These interrupts have a higher priority than the INTR.
TRAP (Input)
Trap interrupt is a nonmaskable restart interrupt. It is recognized at the same time as INTR. It is unaffected by any mask or Interrupt Enable. It has the highest
priority of any interrupt.
RESET IN (Input)
Reset sets the Program Counter to zero and resets the Interrupt Enable and HLDA flipflops. None of the other flags or registers (except the instruction register)
are affected The CPU is held in the reset condition as long as Reset is applied.
RESET OUT (Output)
Indicates CPlJ is being reset. Can be used as a system RESET. The signal is synchronized to the processor clock.
X1, X2 (Input)
Crystal or R/C network connections to set the internal clock generator X1 can also be an external clock input instead of a crystal. The input frequency is divided
by 2 to give the internal operating frequency.
CLK (Output)
Clock Output for use as a system clock when a crystal or R/ C network is used as an input to the CPU. The period of CLK is twice the X1, X2 input period.
IO/M (Output)
IO/M indicates whether the Read/Write is to memory or l/O Tristated during Hold and Halt modes.
SID (Input)
Serial input data line The data on this line is loaded into accumulator bit 7 whenever a RIM instruction is executed.
SOD (output)
Serial output data line. The output SOD is set or reset as specified by the SIM instruction.
Vcc
+5 volt supply.
Vss
Ground Reference.
4. Explain 8085 machine cycle.
The 8085 has seven machine cycles. These are
1.Opcode fetch
2.Memory Read
3.Memory Write
4.I/O Read
5.I/O Write
6.Interrupt Acknowlege
7.Bus Idle.
5. Explain the data transfer instructions available in 8085.
Instruction Naming Conventions:
The mnemonics assigned to the instructions are designed to indicate the function of the instruction. The instructions fall into the following functional
categories:
www.vidyarthiplus.com
Move
MVI
Move Immediate
LDA
STA
LHLD
SHLD
Memory
An 'X' in the name of a data transfer instruction implies that it deals with a register pair (16-bits);
LXI
LDAX
STAX
XCHG
XTHL
Add to Accumulator
ADI
ADC
ACI
SUB
SUI
SBB
SBI
INR
DCR
INX
DCX
DAD
www.vidyarthiplus.com
ANI
ORA
OR
XRA
XRI
The Compare instructions compare the content of an 8-bit value with the contents of the accumulator;
CMP
Compare
CPI
The rotate instructions shift the contents of the accumulator one bit position to the left or right:
RLC
RRC
RAL
RAR
Complement Accumulator
CMC
STC
Jump
CALL
Call
RET
Return
Conditional branching instructions examine the status of one of four condition flags to determine whether the specified branch is to be executed. The conditions
that may be specified are as follows:
NZ
Zero (Z = 1)
NC
No Carry (C =0)
Carry (C = 1)
PO
PE
www.vidyarthiplus.com
P
Plus (S = 0)
Minus (S = 1)
Calls
Returns
CC
RC
(Carry)
INC
CNC
RNC
(No Carry)
JZ
CZ
RZ
(Zero)
JNZ
CNZ
RNZ
(Not Zero)
JP
CP
RP
(Plus)
JM
CM
RM
(Minus)
JPE
CPE
RPE
(Parity Even)
JP0
CPO
RPO
(Parity Odd)
Two other instructions can affect a branch by replacing the contents or the program counter:
PCHL
RST
POP
XTHL
SPHL
OUT
DI
HLT
Halt
NOP
No Operation
www.vidyarthiplus.com
Most of the instructions that use register addressing deal with 8-bit values. However, a few of these instructions deal with 16-bit register pairs. For example,
the PCHL instruction exchanges the contents of the program counter with the contents of the H and L registers.
Immediate Addressing:
Instructions that use immediate addressing have data assembled as a part of the instruction itself. For example, the instruction CPI 'C' may be interpreted as
compare the contents of the accumulator with the letter C. When assembled, this instruction has the hexadecimal value FE43. Hexadecimal 43 is the internal
representation for the letter C. When this instruction is executed, the processor fetches the first instruction byte and determines that it must fetch one more byte.
The processor fetches the next byte into one of its internal registers and then performs the compare operation.
Notice that the names of the immediate instructions indicate that they use immediate data. Thus, the name of an add instruction is ADD; the name of an add
immediate instruction is ADI.
All but two of the immediate instructions uses the accumulator as an implied operand, as in the CPI instruction shown previously.
The MVI (move immediate) instruction can move its immediate data to any of the working registers including the accumulator or to memory. Thus, the
instruction MVI D, OFFH moves the hexadecimal value FF to the D register.
The LXI instruction (load register pair immediate) is even more unusual in that its immediate data is a 16-bit value.
This instruction is commonly used to load addresses into a register pair. As mentioned previously, your program must initialize the stack pointer; LXI is the
instruction most commonly used for this purpose. For example, the instruction LXI SP,3OFFH loads the stack pointer with the hexadecimal value 30FF.
Direct Addressing:
Jump instructions include a 16-bit address as part of the instruction. For example, the instruction JMP 1000H causes a jump to the hexadecimal address 1000 by
replacing the current contents of the program counter with the new value 1000H.
Instructions that include a direct address require three bytes of storage: one for the instruction code, and two for the 16-bit address
Register Indirect Addressing:
Register indirect instructions reference memory via a register pair. Thus, the instruction MOV M,C moves the contents of the C register into the memory
address stored in the H and L register pair. The instruction LDAX B loads the accumulator with the byte of data specified by the address in the B and C register
pair.
Combined Addressing Modes:
Some instructions use a combination of addressing modes. A CALL instruction, for example, combines direct addressing and register indirect
addressing.
The direct address in a CALL instruction specifies the address of the desired subroutine; the register indirect address is the stack pointer. The CALL
instruction pushes the current contents of the program counter into the memory location specified by the stack pointer.
www.vidyarthiplus.com
So, when is this useful? It's almost always used when you call subroutines. For example, you have an often used value stored in HL. You have to call a
subroutine that you know will destroy HL (with destroy I mean that HL will be changed to another value, which you perhaps don't know). Instead of first
saving HL in a memory location and then loading it back after the subroutine, you can push HL before calling and directly after the calling pop it back. Of
course, it's often better to use the pushes and pops inside the subroutine.
All registers you know will be changed are often pushed in the beginning of a subroutine and then popped at the end, in reverse order! Don't forget - last in first
out. If you want to only push one 8 bit register, you still have to push it's "friend". Therefore, be aware that if you want to store away D with pushing and
popping, remember that E will also be changed back to what it was before. In those cases, if you don't want that to happen, you should try first to change
register (try to store the information in E in another register if you can) or else you have to store it in a temporary variable.
Before executing a program, you should keep track of your pushes and pops, since they are responsible for 99% of all computer crashes! For example, if you
push HL and then forget to pop it back, the next RET instruction will cause a jump to HL, which can be anywhere in the ROM/RAM and the computer will
crash. Note however, its also a way to jump to the location stored in HL, but then you should really use the JMP instruction, to do the same thing.
Push and pop doesn't change any flags, so you can use them between a compare and jump instructions, depending on a condition, which is often very useful.
- has highest priority and cannot be masked or disabled. A rising-edge pulse will cause a jump to location 0024H.
RST 7.5- 2nd priority and can be masked or disabled. Rising-edge pulse will cause a jump to location 7.5 * 8 = 003CH.
This interrupt is latched internally and must be reset before it can be used again.
RST 6.5 3rd priority and can be masked or disabled. A high logic level will cause a jump to location 6.5 * 8 = 0034H.
RST 5.5 4th priority and can be masked or disabled. A high logic level will cause a jump to location 5.5 * 8 = 002CH.
INTR
5th priority and can be masked or disabled. A high logic level will cause a jump to specific location as follows:
When the interrupt request (INTR) is made, the CPU first completes its current execution. Provided no other interrupts are pending, the CPU will take the
INTA pin low thereby acknowledging the interrupt.
It is up to the hardware device that first triggered the interrupt, to now place an 8-bit number on the data bus, as the CPU will then read whatever number it
finds on that data bus and do the following: multiply it by 8 and jump to the resulting address location. Since the 8-bit data bus can hold any number from 00
FFH (0 255) then this interrupt can actually jump you to any area of memory between 0*8 and 255*8 ie: 0000 and 07FFH ( a 2K space). N.B: This interrupt
does not save the PC on the stack, like all other hardware and software interrupts!
You will notice that there isn't many locations between vector addresses. What is normally done is that at the start of each vector address, a jump instruction (3
bytes) is placed, that jumps to the actual start of the service routine which may be in RAM..
This way the service routines can be anywhere in program memory. The vector address jumps to the service routine. There is more than enough room between
each vector address to put a jump instruction. Looking at the table above, there are at least 8 locations for each of the vectors except RST 5.5, 6.5, and 7.5.
When actually writing the software, at address 0000h will be a jump instruction that jumps around the other vector locations.
Besides being able to disable/enable all of the interrupts at once (DI / EI) ie: except TRAP, there is a way to enable or disable them individually using the SIM
instruction and also, check their status using RIM.
www.vidyarthiplus.com
There are other things about interrupts that we will cover as they come up, but this lesson was to get you used to the idea of interrupts and what they're used for
in a typical system. Its similar to the scene where one is standing at a busy intersection waiting for the traffic light to change, when a person came up and
tapped us on the shoulder and asked what time it was. It didn't stop us from going across the street, it just temporarily interrupted us long enough to tell them
what time it was. This is the essence of interrupts. They interrupt normal program execution long enough to handle some event that has occurred in the system.
Polling, or scanning, is the other method used to handle events in the system. It is much slower than interrupts because the servicing of any single event has to
wait its turn in line while other events are checked to see if they have occurred. There can be any number of polled events but a limited number of interrupt
driven events. The choice of which method to use is determined by the speed at which the event must be handled.
The software interrupts are the instructions RST n, where n = 0 7. The value n is multiplied by 8 and the result forms an address that the program jumps to as
it vector address ie: RST 4 would jump to location 4*8 = 32 (20H).
1
In this device address is 16 bit. A0-A15 lines are used to generate device address.
lines are used to generate device address.
2
-------- ----------
MEMR,MEMW control signals are used to control read &write I/O operations.
------ -----IOR, IOW control signals are used to control read &write I/O operations.
3
Maximum number of I/O devices are 65536. Maximum number of I/O devices are 256.
5.
14. Add two 4 digit BCD number in HL and DE register pairs and store result in memory l0cation. 2300H and 2301H
Problem:
(HL) =
3629
(DE)=
4738
Step 1:
Step 2 :
Result = 8367
Source Program:
MOV A,L ; Get lower 2 digits of no.1
ADD E
DAA
www.vidyarthiplus.com
DAA
15. Explain different type of Data transfer instructions with suitable examples.
Data Transfer Group:
The data transfer group instructions load the given data into register, copy data from register to register, and copy data from register to memory
location and vice versa. This group consists of following set of instructions. These instructions do not affect any flag in the flag register.
1.
2.
3.
MOV rd, rs
4.
MOV M, rs
5.
MOV RD, m
6.
7.
STA addr
8.
LDA addr
9.
SHLD addr
10.
LHLD addr
11.
STAX rp
12.
LDAX rp
13.
XCHG
Description
: This instruction directly loads a specified register with an 8-bit data given within the instruction. The register r is an 8-bit general
purpose register such as A,B,C,D,E,H and L
No. of bytes
: 2 bytes
First byte: Opcode of MVI r
Second byte : g-bit data
No. of T- states
Addressing mode
Flags
Example
MVI B, 60H
2. MVI M, data (8)
Operation
Description
: This instruction directly loads an 8-bit data given with the instruction into a memory location. The memory location is specified by
the contents of HL register pair.
No. of bytes
: 2 bytes
www.vidyarthiplus.com
First byte : Opcode of MVI M.
Second byte: 8 bit data
No. of T- states
Addressing mode
Flags
Example
3. Mov rd, rs
Operation
: rd rs
Description : This instruction copies data from the source register into destination register .the rs and rd are general-purpose registers such as A,B,C,D,E,H
and L. The contents of the source register remain unchanged after execution of the instruction.
No. of bytes
: 1 byte
Opcode of MOV rd,rs
: A= 20H
MOV B,A
: Thus instruction will copy the contents of register A(20H) into register B.
4. Mov M,rs
: Move data from source register (rs) to memory whose address is HL register pair.
Operation
: (HL) rs.
Description
www.vidyarthiplus.com
5. MOV rd, M
Operation
Description
: This instruction copies data from memory location whose address is specified by Hl register pair into destination register . the contents of
the memory location remain unchanged. The rd is an 8-bit general-purpose register such as A,B,C,D,E,H and L.
No. of bytes : 1 byte
Opcode of MOV d,M
No of T- states: Requires 7 T-state for execution
Addressing mode : Indirect addressing.
Flags : Flags are not affect
Example ; HL =2050H, contents at 200H memory location =40H
MOV C,M
6. LXI rp , data (16) : Load 16-bit immediate data to specified register pair
:rp data (16)
Operation
Description
: This instruction loads immediate16 bit data specified within the instruction into register pair or stack pointer. The rp is 16-bit register pair
such as BC, DE, HL or 16-bit stack pointer.
No. of bytes
: 3 bytes
First byte : Opcode of LXI rp
Second byte: Low order byte of 16-bit data
Third byte: High order byte of 16-bit data.
Example
Description
: This instruction stores the contents of A register into the memory location whose address is directly specified within the instruction. The
contents of A register remain unchanged.
No of bytes : 3 bytes
First byte: Opcode of STA.
Second byte: Low order byte of the address
Third byte: High order byte of the address.
www.vidyarthiplus.com
No. of T-states : Requires13 T-states for execution
Addressing mode : Direct addressing.
Flags
Example ; (2000H0=30H
LDA 2000H : This instruction will copy the
; contents of memory location
: 2000H i.edata 30H into the
: A regiser
9. SHLD addr : Store HL register pair in memory
: (addr) L and (addr+1) H
Operation
Description : This instruction storesthe contents of L register in the memory location given within the instruction and contents of H register at address next
to it. This instruction is used to store the contents of H and L register directly into the memory. The contents of the H and L register remain unchanged.
No of bytes : 3 bytes
First bytes : Opcode of SHLD
Second byte : Low order byte of the address
Third byte : High order byte of the address
No. of T- states
Example
: H =30H .L =60H
Description : This instruction copiesthe contents of the memory location given with the instruction into the L register and the contents of the next memory
location into H register.
No.of bytes
; 3 bytes
www.vidyarthiplus.com
: i.e. data 30H into the L register and
; the contents at memory location
; 2501 h i.e. data60H into the H register
11. STAX rp ; Store the contents of A register in memory location whose address is specified by BC or DE register pair
Operation : (rp) A
Description : This instruction copies the contents of accumulator into the memory location. Whose address is specified by the specified register pair. The rp is
BC or DE register pair. This register pair is used as a memory pointer. The contents of the accumulator remain unchanged.
No. of bytes ; 1 byte
Opcode of STAX rp
No.of T-states ; Requires7 T- states for execution
Addressing mode :Register indirect addressing
Flags : Flags are not affected
Example ; BC : 1020H , A = 50H
STAX B
12. LDAX rp : Load A register with the contents of memory location whose address is specified by Bc or DE register pair.