Intel 8085
Intel 8085
Intel 8085
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
RST 6.5
RST 7.5
TRAP
RST 5.5
INTR
INTA
SOD
Interrupt Control
SID
Multiplexer
IR (8)
ACC (8)
TR (8)
Instruction
Decoder
A
L
U
Register Select
FR (8)
W (8)
Z (8)
B (8)
C (8)
D (8)
E (8)
H (8)
L (8)
CLKOUT
RD
READY
WR
S0 S1 IO / M HOLD
RESETIN
HLDA
Address
Buffer (8)
Data/Address
Buffer (8)
A8 A15
AD0 AD7
RESETOUT
Architecture of 8085: 8085 is an 8-bit microprocessor. The architecture of 8085 has the
following blocks:
(I) Arithmetic/Logic Unit (ALU): The Arithmetic/Logic Unit (ALU) performs the socalled the arithmetic operations such as addition and subtraction and logical operations such
as AND and OR.
(II) Register unit: The register unit of 8085 has various general-purpose and specialpurpose registers.
The register unit of 8085 has seven, 8-bit general-purpose registers, namely A, B, C,
D, E, H and L, which are visible to the user i.e., that are accessible through software
instructions. The register A is often referred to as the accumulator. Most arithmetic/logical
operations and all input/output operations involve the accumulator as one of the operands. All
these 8-bit registers, except the accumulator, can be paired to use as 16-bit registers. The
possible pairs are BC, DE and HL. Some general-purpose registers such as W and Z are
invisible to the user i.e., are not accessible through software instructions.
The register unit of 8085 has two, 16-bit special-purpose registers, namely the
program counter (PC) and the stack pointer (SP). The program counter holds the address of
the next instruction byte to be fetched. It is incremented by one each time an instruction byte
is fetched unless modified by a (1-byte or 3-byte) call or an interrupt. The stack pointer holds
the address of the current location in a block of memory called the stack.
The register unit of 8085 has one more 8-bit register called the flag register. The flag
register reflects the change in the status of the accumulator due to an arithmetic operation or a
logical operation. It consists of five flags, namely the sign (S) flag, the zero (Z) flag, the
auxiliary carry (AC) flag, the parity (P) flag and the carry (C) flag.
The sign flag is set whenever the most significant bit (i.e., the 8th bit) of the result of
any arithmetic or logical operation (except rotation) is 1.
The zero flag is set whenever the result of any arithmetic or logical operation (except
rotation) is zero.
The auxiliary carry flag is set whenever the low-order nibble of the result of an
arithmetic operation overflows i.e., whenever there is a carry from the 4th bit to 5th bit due to
an arithmetic operation. All the logical operations except rotation either sets or resets the
auxiliary carry.
The parity flag is set whenever the result of any arithmetic or logical operation
(except rotation) has even number of 1s.
The carry flag is set whenever the result of an arithmetic operation overflows. All the
logical operations except rotation reset (clear) the carry. The rotation either sets or resets the
carry.
(III) Control and timing unit: The control and timing unit generates various control
and timing signals for the proper operation of the microprocessor and data transfer between
the microprocessor and memory and input/output devices. The various control and timing
signals generated by the control and timing unit of 8085 are as follows:
(1) ALE: Address Latch Enable: This is an active high and outgoing signal. This
signal begins (goes high) at the beginning of the first clock cycle of a machine cycle,
indicating that the data bus is to carry the low-order byte of an address. The falling edge of
this signal is used to latch the low-order address byte. The ALE pin is never tri-stated.
(2) RD: ReaD: This is an active low and outgoing signal. When this pin goes low, it
indicates that the microprocessor is to read from the memory location or the peripheral
device, which it has just selected. This pin is tri-sated during HALT, HOLD and RESET
modes.
(3) WR: WRite: This is an active low and outgoing signal. When this pin goes low, it
indicates that the microprocessor is to write into the memory location or the peripheral
device, which it has just selected. This pin is tri-sated during HALT, HOLD and RESET
modes.
(4) IO/ M: InputOutput/Memory: This is an outgoing signal. When this pin goes high,
it indicates that the microprocessor is to carry out an input/output related operation. When
this pin goes low, it indicates that the microprocessor is to carry out a memory related
operation. This pin remains high or low until the respective operation is completed. This pin
is tri-stated during HALT, HOLD and RESET modes.
(5) S0 and S1: Status signals: These two signals along with the IO/M signal indicates
various machine cycle status as shown below:
IO/M
S0
S1
Opcode fetch
M emory read
Memory write
IO read
IO write
Interrupt acknowledge
HI
Halt
HI
Hold
HI
Reset
Status
The IO/M, S0 and S1 signals begin at the beginning of the first clock cycle of a machine
cycle and remain stable throughout the machine cycle.
(6) READY: Ready: This is an active high and incoming signal. If this pin goes high
during a (IO or memory) read or write cycle, then the microprocessor will wait for an integral
number of clock cycles before completing the current read or write cycle.
(7) HOLD: Hold: This is an active high and incoming signal. When this pin goes
high, it indicates that another master is requesting the use of the address and data buses. Upon
receiving this signal, the microprocessor will relinquish the control over the bus after
completing the current bus transfer. (It may still continue any internal process.) The
microprocessor can resume the control over the bus as soon as this pin goes low. Therefore,
this pin must remain high as long as the requesting party uses the bus.
(8) HLDA: HoLD Acknowledge: This is an active high and outgoing signal. Upon
receiving the HOLD signal, the microprocessor generates this HLDA signal and indicates the
requesting party that the bus will be free from the next clock cycle. The microprocessor
removes this HLDA signal as soon as the HOLD pin goes low. The microprocessor resumes
the control over the bus one half cycle after the HLDA goes low.
(9) RESET IN: Reset in: This is an active low and incoming signal. When this pin
goes low, the program counter is cleared to zero and the Interrupt Enable and HLDA flipflops are reset (disabled). The data, address and control bus lines are tri-stated. The
microprocessor remains in this state as long as this pin is low. As this signal is asynchronous,
the processor's internal registers and flags are altered with unpredictable data.
(10) RESET OUT: Reset out: This is active high and outgoing signal. Upon being
reset, the microprocessor generates this signal. This lasts an integral number of clock cycles.
This is synchronized with the processor's clock.
(IV) Interrupt system of 8085: The interrupt system of 8085 has two types of
interrupts: (1) the hardware interrupts and (2) the software interrupts.
(1) Hardware interrupts: The interrupt system of 8085 has the following hardware
interrupts:
(i) TRAP: TRAP is a non-maskable hardware interrupt i.e., it cannot be disabled
through a software instruction. Hence TRAP has the highest priority. This interrupt transfers
the execution control to the memory location 0024H. In order for the microprocessor to
service this interrupt, TRAP must remain high until the microprocessor responds to it.
(ii) RST7.5, 6.5 & 5.5: ReSTart7.5, 6.5 & 5.5: These are maskable hardware
interrupts i.e., they can be disabled through software instructions. They have the priority in
the order they are shown. These interrupts transfer the execution control to the memory
locations 003CH, 0034H and 002CH, respectively.
These four interrupts are called the vectored interrupts, as they transfer the execution
control to predetermined memory locations.
(iii) INTR: INTerrupt Request: This is also a maskable hardware interrupt. This has
the lowest priority. When INTR is high, the P completes the execution of the current
instruction and generates an INTA signal. Then the P expects either a 1-byte CALL (RST0
through RST7) or a 3-byte CALL on the data bus. The INTA signal can be used to enable an
external hardware, which has been designed to provide the Opcode for the required CALL
instruction on the data bus. If a 3-byte CALL instruction is used, then the P generates two
additional INTA cycles in order to fetch all the three bytes of the CALL instruction. This is a
non-vectored interrupt, as it does not transfer the execution control to any predetermined
memory location.
(2) Software interrupts: The interrupt system of 8085 has eight software interrupts,
namely RST0, RST1, RST2, RST3, RST4, RST5, RST6 & RST7. These are vectored
interrupts as they transfer the execution control to the predetermined memory locations,
0000H, 0008H, 0010H, 0018H, 0020H, 0028H, 0030H & 0038H respectively. When any of
these instructions is executed, the microprocessor calculates the required vector address
internally as 8 times the respective vector number (i.e., the numbers 0 through 7).
(V) Serial data transfer: The pins SID and SOD are used for the serial data transfer in
and out of the microprocessor.
Programming model of 8085: The following figure shows the programming model of 8085.
Flags
C
ACC
B
D
E
L
Program Counter
Stac k Pointe r
The programming model of 8085 has seven, 8-bit general-purpose registers, namely
A, B, C, D, E, H and L and two, 16-bit special-purpose registers, namely the program counter
(PC) and the stack pointer (SP).
The register A is often referred to as the accumulator. Most arithmetic/logical
operations and all input/output operations involve the accumulator as one of the operands. All
these 8-bit registers, except the accumulator, can be paired to use as 16-bit registers. The
possible pairs are BC, DE and HL.
The program counter holds the address of the next instruction byte to be fetched. It is
incremented by one each time an instruction byte is fetched unless modified by a (1-byte or
3-byte) call or an interrupt. The stack pointer holds the address of the current location in a
block of memory called the stack.
The register unit of 8085 has one more 8-bit register called the flag register. The flag
register reflects the change in the status of the accumulator due to an arithmetic operation or a
logical operation. It consists of five flags, namely the sign (S) flag, the zero (Z) flag, the
auxiliary carry (AC) flag, the parity (P) flag and the carry (C) flag.
The sign flag is set whenever the most significant bit (i.e., the 7th bit) of the
accumulator is set due to an arithmetic operation or a logical operation.
The zero flag is set whenever the accumulator is cleared to zero due to an arithmetic
operation or a logical operation.
The auxiliary carry flag is set whenever the low-order nibble of the accumulator
overflows due to an arithmetic operation or a logical operation.
The parity flag is set whenever the content of the accumulator has even number of 1s
due to an arithmetic operation or a logical operation.
The carry flag is set whenever the accumulator overflows due to an arithmetic
operation or a logical operation.
MOV r1, r2
2.
MOV r, mem
3.
MOV mem, r
4.
MVI r, data8
5.
6.
7.
LDA addr16
8.
STA addr16
9.
LHLD addr16
10.
SHLD addr16
11.
LDAX rp
Function
( r2 ) ( r1 )
Move data from r2 to r1. The content of the register r2 is copied
to the register r1.
( mem ) ( r ) or (( HL )) ( r )
Move data from mem to r. The content of the memory location,
whose address is stored in the HL pair, is copied to the register r.
The address of the memory location mem should be stored in the
HL pair before using this instruction.
( r ) ( mem ) or ( r ) (( HL ))
Move data from r to mem. The content of the register r is copied
to the memory location, whose address is stored in the HL pair.
The address of the memory location mem should be stored in the
HL pair before using this instruction.
data8 ( r )
Move data immediate to r. The 8-bit data specified in the
instruction is transferred to the register r.
data8 ( mem ) or 8-bit data (( HL ))
Move data immediate to mem. The 8-bit data specified in the
instruction is transferred to the memory location, whose address
is stored in the HL pair.
data16 ( rp)
Load register pair rp immediate with data16. The 16-bit data
specified in the instruction is transferred to the register pair rp.
( addr16 ) ( A )
Load accumulator from addr16. The content of the memory
location, whose address (addr16) is specified in the instruction,
is copied to the accumulator A.
( A) ( addr16 )
Store accumulator in addr16. The content of the accumulator A
is copied to the memory location, whose address (addr16) is
specified in the instruction.
( addr16 ) ( L ) & ( addr16+1 ) ( H )
Load HL pair direct from addr16. The content of the memory
location, whose address (addr16) is specified in the instruction,
is copied to the register L and the content of the next memory
location is copied to the register H.
( L ) ( addr16 ) & ( H ) ( addr16+1 )
Store HL pair direct in addr16. The content of the register L is
transferred to the memory location, whose address (addr16) is
specified in the instruction and the content of the register H is
copied to the next memory location.
(( rp )) ( A )
Load accumulator indirect from (rp). The content of the memory
location, whose address is stored in the register pair rp, is copied
to the accumulator A.
( A ) (( rp ))
Store accumulator indirect in (rp). The content of the
12.
STAX rp
accumulator A is copied to the memory location, whose address
is stored in the register pair rp.
( HL ) ( DE )
13.
XCHG
Exchange HL pair with DE pair. The content of the HL pair is
exchanged with the content of the DE pair.
II. Arithmetic operation instructions:
SlNo.
Instruction
Function
(r)+(A)(A)
1.
ADD r
Add r. The content of the register r is added to the content of the
accumulator A and the result is stored in the accumulator A.
( mem ) + ( A ) ( A ) or (( HL )) + ( A ) ( A )
Add mem. The content of the memory location, whose address is
2.
ADD mem
stored in the HL pair, is added to the content of the accumulator
A and the result is stored in the accumulator A.
data8 + ( A ) ( A )
Add data8 immediate. The 8-bit data specified in the instruction
3.
ADI data8
is added to the content of the accumulator A and the result is
stored in the accumulator A.
( r ) + ( A ) + ( CF ) ( A )
Add r with carry. The content of the register r is added to the
4.
ADC r
content of the accumulator A along with the carry bit and the
result is stored in the accumulator A.
( mem ) + ( A ) + ( CF ) ( A ) or
(( HL )) + ( A ) + ( CF ) ( A )
Add mem with carry. The content of the memory location,
5.
ADC mem
whose address is stored in the HL pair, is added to the content of
the accumulator A along with the carry bit and the result is
stored in the accumulator A.
data8 + ( A ) + ( CF ) ( A )
Add data8 immediate with carry. The 8-bit data specified in the
6.
ACI data8
instruction is added to the content of the accumulator A along
with the carry bit and the result is stored in the accumulator A.
(A)(r)(A)
Subtract r. The content of the register r is subtracted from the
7.
SUB r
content of the accumulator A and the result is stored in the
accumulator A.
( A ) ( mem ) ( A ) or ( A ) (( HL )) ( A )
Subtract mem. The content of the memory location, whose
8.
SUB mem
address is stored in the HL pair, is subtracted from the content of
the accumulator A and the result is stored in the accumulator A.
( A ) data8 ( A )
Subtract data8 immediate. The 8-bit data specified in the
9.
SUI data8
instruction is subtracted from the content of the accumulator A
and the result is stored in the accumulator A.
( A ) ( r ) ( CF ) ( A )
Subtract r with carry. The content of the register r along with
10.
SBB r
the carry bit is subtracted from the content of the accumulator A
and the result is stored in the accumulator A.
( A ) ( mem ) ( CF ) ( A ) or
( A ) (( HL )) ( CF ) ( A )
Subtract mem with carry. The content of the memory location,
11.
SBB mem
whose address is stored in the HL pair, along with the carry bit
is subtracted from the content of the accumulator A and the
result is stored in the accumulator A.
( A ) data8 ( CF ) ( A )
Subtract data8 immediate with carry. The 8-bit data specified in
12.
SBI data8
the instruction along with the carry bit is subtracted from the
content of the accumulator A and the result is stored in the
accumulator A.
(r)+1(r)
13.
INR r
Increment r. The content of the register r is increased by one.
( mem ) + 1 ( mem ) or (( HL )) + 1 (( HL ))
14.
INR mem
Increment mem. The content of the memory location, whose
address is stored in the HL pair, is increased by one.
(r)1(r)
15.
DCR r
Decrement r. The content of the register r is decreased by one.
( mem ) 1 ( mem ) or (( HL )) 1 (( HL ))
16.
DCR mem
Decrement mem. The content of the memory location, whose
address is stored in the HL pair, is decreased by one.
( rp ) + 1 ( rp )
17.
INX rp
Increment register pair rp. The content of the register pair rp is
increased by one.
( rp ) 1 ( rp )
18.
DCX rp
Decrement register pair rp. The content of the register pair rp is
decreased by one.
( rp ) + ( HL ) ( HL )
Double add register pair rp. The content of the register pair rp
19.
DAD rp
is added to the content of the HL pair and the result is stored in
the HL pair.
Decimal adjust accumulator. (1) If the low-order byte of the
accumulator is greater than 9 or if ACF is set (logic 1), 06 is
added to accumulator. (2) If the high-order byte of the
20.
DAA
accumulator is greater than 9 or if CF is set (logic 1), 60 is added
to accumulator. (3) If both ACF and CF are set (logic 1), 66 is
added to accumulator.
III. Logical operation instructions:
SlNo.
Instruction
Function
( r ) AND ( A ) ( A )
AND r. The content of the register r is ANDed with the content
1.
ANA r
of the accumulator A and the result is stored in the accumulator
A.
2.
ANA mem
3.
ANI data8
4.
XRA r
5.
XRA mem
6.
XRI data8
7.
ORA r
8.
ORA mem
9.
ORI data8
10.
CMP r
11.
CMP mem
12.
CPI data8
13.
RLC
CF
D7
D6
D5
D4
D3
D2
D1
D0
( An+1 ) ( An ); ( A0 ) ( A7 ); ( A0 ) ( CF )
Rotate accumulator right. The accumulator A is rotated right bit
wise. The CF is set if A0=1 and vice versa.
14.
RRC
D7
D6
D5
D4
D3
D2
D1
D0
CF
( An ) ( An+1 ); ( A7 ) ( CF ); ( CF ) ( A0 )
Rotate accumulator left through carry. The accumulator A is
rotated left through the carry bit wise.
15.
RAL
CF
RAR
D7
D6
D5
D4
D3
D2
D1
D0
( An+1 ) ( An ); ( A0 ) ( CF ); ( CF ) ( A7 )
Rotate accumulator right through carry. The accumulator A is
rotated right through the carry bit wise.
16.
D7
D6
D5
D4
D3
D2
D1
D0
CF
17.
Compliment accumulator. Compliment the accumulator bit wise.
CMA
18.
Compliment carry. Compliment the carry flag.
CMC
19.
Set carry. Set the carry flag.
STC
IV. Branch operation instructions:
Instruction
Function
SlNo.
Jump unconditionally. The program sequence is transferred to
1.
the memory location, whose address (addr16) is specified in the
JMP addr16
instruction.
Conditional JUMP instructions
2.
JC addr16
3.
JNC addr16
4.
JZ addr16
5.
JNZ addr16
CC addr16
CNC addr16
CZ addr16
CNZ addr16
CP addr16
CM addr16
CPE addr16
CPO addr16
Call on carry.
Call on no carry.
Call on zero.
Call on no zero.
Call on plus.
Call on minus.
Call on parity even.
Call on parity odd.
Return. The program sequence is transferred (returned) to the
19.
RET
main program. This is the last instruction in a subroutine.
RET instruction: When the RET instruction is executed, the content of the memory location
pointed by the stack pointer is transferred to the program counter as the low-order byte of the
address of the next instruction to be executed. Then, the content of the stack pointer is
increased by one and the content of the memory location pointed by the stack pointer is
transferred to the program counter as the high-order byte of the address of the next instruction.
Finally, the content of the stack pointer is again increased by one. This looks as if POP PC was
executed. That is
(( SP )) ( PC )L ; (( SP+1 )) ( PC )H & ( SP ) + 2 ( SP )
Conditional RET instructions
20.
21.
22.
23.
24.
25.
RC
RNC
RZ
RNZ
RP
RM
Return on carry.
Return on no carry.
Return on zero.
Return on no zero.
Return on plus.
Return on minus.
26.
27.
RPE
RPO
( HL ) ( PC )
Load PC with HL. The content of the HL pair is copied to the
program counter PC.
V. Stack, I/O & machine control instructions:
SlNo.
Instruction
Function
( rp )H (( SP-1 )); ( rp )L (( SP-2 )) & ( SP ) - 2 ( SP )
Push register pair rp. The high-order byte of the register pair rp
is transferred to the memory location, whose address is the
1.
PUSH rp
content of the stack pointer minus one (SP-1) and the low-order
byte of the register pair rp is transferred to the memory location,
whose address is the content of the stack pointer minus two
(SP-2).
( A ) (( SP-1 )); ( flag register ) (( SP-2 ))
( SP ) - 2 ( SP )
Push processor status word. The content of the accumulator A is
2.
PUSH psw
transferred to the memory location, whose address is the content
of the stack pointer minus one (SP-1) and the content of the flag
register is transferred to the memory location, whose address is
the content of the stack pointer minus two (SP-2).
(( SP )) ( rp )L; (( SP+1 )) ( rp )H & ( SP ) + 2 ( SP )
Pop register pair rp. The content of the memory location, whose
address is the content of the stack pointer SP, is transferred to
the low-order register of the register pair rp, the content of the
3.
POP rp
memory location, whose address is the content of the stack
pointer SP plus one, is transferred to the high-order register of
the register pair rp and the content of the stack pointer SP is
increased by two.
(( SP )) (A ); (( SP+1 )) ( flag register ) &
( SP ) + 2 ( SP )
Pop processor status word. The content of the memory location,
whose address is the content of the stack pointer SP, is
4.
POP psw
transferred to the accumulator A, the content of the memory
location, whose address is the content of the stack pointer SP
plus one, is transferred to the flag register and the content of the
stack pointer SP is increased by two.
( HL ) ( SP )
5.
SPHL
Load SP with HL. The content of the HL pair is copied to the
stack pointer SP.
( L ) (( SP )) & ( H ) (( SP+1 ))
Exchange HL with (SP). The content of the register L is
exchanged with that of the memory location, whose address is
6.
XTHL
the content of the stack pointer SP and that of the register H is
exchanged with that of the memory location, whose address is
the content of the stack pointer plus one (SP+1).
( addr8 ) ( A )
7.
IN addr8
Input from addr8. The content of the port, whose address
28.
PCHL
8.
OUT addr8
9.
EI
10.
DI
11.
HLT
12.
NOP
13.
RIM
D7=serial input data (status of SID pin).
D6, D5, D4=interrupt pending flags for RST7.5, 6.5 & 5.5;
pending if bit=1.
D3=interrupt mask enable status; masking enabled if bit=1.
D2, D1, D0=interrupt mask status of RST7.5, 6.5 & 5.5; masked
(reset) if bit=1.
Set interrupt mask. The instruction sets the interrupts 7.5, 6.5,
5.5 and serial data output interpreting the content of the
accumulator as follows:
D7 D6 D5 D4 D3 D2 D1 D0
14.
SIM
D7=serial output data. This bit is sent out on SOD pin if SOE=1.
D6=serial output enable; enabled if bit=1.
D5=irrelevant.
D4=reset (mask) RST7.5; reset (masked) if bit=1; this is an
additional control for RST7.5.
D3=mask set enable; enables the functions of bits D2, D1 & D0 if
bit=1.
D2, D1, D0=interrupt mask for RST7.5, 6.5 & 5.5; masked (reset)
if bit=1.
Vector location
0024 H
Comments
Non-maskable, hardware interrupt. This
6
6
6
6
6
The 8085-interrupt system has five interrupts, namely TRAP, RST7.5, RST6.5, RST5.5
and INTR. Among them the TRAP has the highest priority, the RST7.5 has the second
highest priority and so on. The INTR has the lowest priority.
All the interrupts except TRAP are maskable i.e., they can be enabled or disabled through
instructions.
For the P to recognize (service) any maskable interrupt, it must be first unmasked (set)
through the instruction SIM and then the 8085 maskable interrupt system must be enabled
through the instruction EI.
Recognition of any maskable interrupt (RST7.5, RST6.5, RST5.5 and INTR) disables all
maskable interrupts. For the P to recognize any maskable interrupt any further, the 8085
maskable interrupt system must be enabled through the instruction EI again.
On being interrupted, the P completes the execution of the current instruction, saves the
program counter in the stack and branches to the respective vector location.
Cy
+
+
+
+
+
+
0
0
0
+
+
+
+
+
+
Ac
+
+
+
+
+
+
1
1
1
Z
+
+
+
+
+
+
+
+
+
S
+
+
+
+
+
+
+
+
+
P
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0
0
0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0
0
0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0
0
+
+
+
0
0
+
+
+
0
0
+
+
+
memory; rpregister pair
T2
T3
T4
CK
IO/M
A15 - A8
AD0 - AD7
undefined
PCH
PCL
OP
ALE
RD
S0
S1
PC out
PC+1-->PC
op-->IR
Decoding
IR=Instruction Register
Opcode fetch cycle timings of 8085
T1
T2
T3
CK
IO/M
addrH
A15 - A8
AD0 - AD7
addrL
d8 from mem
ALE
RD
S0
S1
RP or WZ out
(or)
PC out
d8-------------------------------->reg
PC+1-->PC
d8----->reg
T1
T2
T3
CK
IO/M
addrH
A15 - A8
AD0 - AD7
addrL
d8 from cpu
ALE
WR
S0
S1
RP or WZ out
d8-------------------------------->mem
Instruction timing of 8085: The important terms that must be known prior to the study of the
instruction timings of 8085 are:
(1) the instruction cycle, which is referred to as the time required to complete the
execution of an instruction and
(2) the machine cycle, which is referred to as the time required to complete a memory
related operation or an IO related operation. Thus, there are five machine cycles possible: (i) the
Opcode fetch, (ii) the memory read, (iii) the memory write, (iv) the IO read and (v) the IO write.
The execution of an 8085 instruction requires one to five machine cycles. The first
machine cycle of any instruction is the Opcode fetch cycle.
The Opcode fetch cycle requires four to six clock cycles (T-states). A memory/IO read or
write cycle requires three clock cycles.
The things explained above have been shown schematically in the following figure:
M1
M2
M3
M4
M5
T1 T2 T3 T4 T5 T6 T1 T2 T3 T1 T2 T3 T1 T2 T3 T1 T2 T3
Opcode fetch cycle of 8085: The Opcode fetch cycle timings of 8085 can be explained as
follows:
(i) The microprocessor puts a LOW on the IO/M pin, indicating a memory related
operation.
(ii) The microprocessor puts a HIGH on the S0 and S1 pins, indicating an Opcode fetch.
(iii) The microprocessor places the high byte of the program counter on the address lines
and the low byte of the program counter on the data lines and puts a HIGH on the ALE pin.
All the above actions take place approximately at the beginning of T1.
The ALE remains HIGH approximately for the first half cycle of T1. The low-order
address byte will be available on the data lines only during T1 and then these lines will be used
to fetch the Opcode. Therefore, when the ALE goes LOW, the trailing edge of the ALE must be
used to latch the low-order address byte externally.
(iv) At the beginning of T2, the microprocessor puts a LOW on the RD pin, indicating a
read operation. The RD pin goes HIGH approximately at the beginning of the second half cycle
of T3. When this pin is LOW, the microprocessor reads the data lines, which are now carrying
the Opcode, into the instruction register.
(v) During T4, the microprocessor decodes the instruction.
Memory read cycle of 8085: The memory read cycle timings of 8085 can be explained
as follows:
(i) The microprocessor puts a LOW on the IO/M pin, indicating a memory related
operation.
(ii) The microprocessor puts a LOW on the S0 pin and a HIGH on the S1 pin, indicating
a read operation.
(iii) The microprocessor places the high-order address byte on the address lines and the
low-order address byte on the data lines and puts a HIGH on the ALE pin.
All the above actions take place approximately at the beginning of T1.
The ALE remains HIGH approximately for the first half cycle of T1. The low-order
address byte will be available on the data lines only during T1 and then these lines will be used
to fetch the data from the selected memory location. Therefore, when the ALE goes LOW, the
trailing edge of the ALE must be used to latch the low-order address byte externally.
(iv) At the beginning of T2, the microprocessor puts a LOW on the RD pin, indicating a
read operation. The RD pin goes HIGH approximately at the beginning of the second half cycle
of T3. When this pin is LOW, the microprocessor reads the data lines into a register such as the
accumulator.
Memory write cycle of 8085: The memory write cycle timings of 8085 can be explained
as follows:
(i) The microprocessor puts a LOW on the IO/M pin, indicating a memory related
operation.
(ii) The microprocessor puts a HIGH on the S0 pin and a LOW on the S1 pin, indicating
a write operation.
(iii) The microprocessor places the high-order address byte on the address lines and the
low-order address byte on the data lines and puts a HIGH on the ALE pin.
All the above actions take place approximately at the beginning of T1.
The ALE remains HIGH approximately for the first half cycle of T1. The low-order
address byte will be available on the data lines only during T1 and then these lines will be used
to carry the data to the selected memory location. Therefore, when the ALE goes LOW, the
trailing edge of the ALE must be used to latch the low-order address byte externally.
(iv) At the beginning of T2, the microprocessor puts a LOW on the WR pin, indicating a
write operation. The WR pin goes HIGH approximately at the beginning of the second half
cycle of T3. When this pin is LOW, the data lines are read into the selected memory location (by
an external logic).
Microoperations in each machine cycle:
Opcode fetch cycle:
(1) During T1, the content of PC is placed on the address bus.
(2) During T2, PC is incremented by one.
(3) During T3, the opcode is read in the instruction register.
(4) During T4, the opcode is decoded.
The execution of the instruction is often carried out in the opcode fetch cycle of the next
instruction.
Memory read cycle:
(1) During T1, the required memory address, which may be the content of either a RP or
WZ or PC, is placed on the address bus.
If PC is used in T1, then
(2) During T2, PC will be incremented by one and during T3, the 8-bit data from the
selected memory location will be read into a register or else
(3) the 8-bit data from the selected memory location will be read into a register during
T2 and T3.
Memory write cycle:
(1) During T1, the required memory address, which may be the content of either a RP or
WZ, is placed on the address bus.
(2) During T2 and T3, the 8-bit data is written into the selected memory location.
Additional Machine
cycles for completion of
instruction execution
Total
Machine
cycles
Clock cycles
Or
T-states
MR
4+3=7
MW
4+3=7
4+3=7
MW
4+3+3=10
MR
MW
MR/MR
MW/MW
MR
MW
MR
MR
-
3
4
4
5
5
2
2
1
1
2
2
1
2
2
1
4+3+3=10
4+3+3+3=13
4+3+3+3=13
4+3+3+3+3=16
4+3+3+3+3=16
4+3=7
4+3=7
4
4
4+3=7
4+3=7
4
4+3=7
4+3=7
4
SUB mem
SUI d8
SBB r
SBB mem
SBI d8
INR r
INR mem
DCR r
DCR mem
INX rp
DCX rp
DAD rp
DAA
ANA r
ANA mem
ANI d8
XRA r
XRA mem
XRI d8
ORA r
ORA mem
ORI d8
CMP r
CMP mem
CPI d8
RLC
RRC
RAL
RAR
CMA
CMC
STC
JMP a16
RET
OPF
OPF/MR
OPF
OPF
OPF/MR
OPF
OPF
OPF
OPF
OPF
OPF
OPF
OPF
OPF
OPF
OPF/MR
OPF
OPF
OPF/MR
OPF
OPF
OPF/MR
OPF
OPF
OPF/MR
OPF
OPF
OPF
OPF
OPF
OPF
OPF
OPF/MR/MR
OPF/MR/MR
or
OPF/MR
OPF/MR/MR
OPF/MR/MR
or
OPF/MR
OPF
Rcond
OPF
RSTn
PCHL
PUSH rp
OPF
OPF
OPF
Jcond a16
CALL a16
Ccond a16
MR
MR
MR/MW
MR/MW
BI/BI
MR
MR
MR
MR
MW/MW
MW/MW
MR/MR
MR/MR
or
MW/MW
MW/MW
2
2
1
2
2
1
3
1
3
1
1
3
1
1
2
2
1
2
2
1
2
2
1
2
2
1
1
1
1
1
1
1
3
3
or
2
5
5
or
2
3
3
or
1
3
1
3
4+3=7
4+3=7
4
4+3=7
4+3=7
4
4+3+3=10
4
4+3+3=10
6
6
4+3+3=10
4
4
4+3=7
4+3=7
4
4+3=7
4+3=7
4
4+3=7
4+3=7
4
4+3=7
4+3=7
4
4
4
4
4
4
4
4+3+3=10
4+3+3=10
or
4+3=7
6+3+3+3+3=18
6+3+3+3+3=18
or
6+3=9
4+3+3=10
6+3+3=12
or
6
6+3+3=12
6
6+3+3=12
PUSH psw
POP rp
POP psw
XTHL
SPHL
IN a8
OUT a8
EI
DI
OPF
OPF
OPF
OPF
OPF
OPF/MR
OPF/MR
OPF
OPF
MW/MW
MR/MR
MR/MR
MR/MR/MW/MW
IOR
IOW
-
HLT
OPF
NOP
RIM
SIM
OPF
OPF
OPF
3
3
3
5
1
3
3
1
1
1
or
MORE
1
1
1
6+3+3=12
4+3+3=10
4+3+3=10
4+3+3+3+3=16
6
4+3+3=10
4+3+3=10
4
4
5
or
MORE
4
4
4
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
MNE
ACI d8
ADC B
ADC C
ADC D
ADC E
ADC H
ADC L
ADC mem
ADC A
ADD B
ADD C
ADD D
ADD E
ADD H
ADD L
ADD mem
ADD A
ADI d8
ANA B
ANA C
ANA D
ANA E
ANA H
ANA L
ANA mem
ANA A
ANI d8
CALL a16
CC a16
CNC a16
CP a16
CM a16
CPE a16
CPO a16
CZ a16
CNZ a16
CMA
CMC
CMP B
CMP C
CMP D
CMP E
CMP H
CMP L
CMP mem
CMP A
CPI d8
DAA
DAD B
OP
CE
88
89
8A
8B
8C
8D
8E
8F
80
81
82
83
84
85
86
87
C6
A0
A1
A2
A3
A4
A5
A6
A7
E6
CD
DC
D4
F4
FC
EC
E4
CC
C4
2F
3F
B8
B9
BA
BB
BC
BD
BE
BF
FE
27
09
19
29
39
05
0D
15
1D
25
2D
35
3D
0B
1B
2B
3B
F3
FB
76
DB
04
0C
14
1C
24
2C
34
3C
03
13
23
33
C3
DA
D2
F2
FA
EA
E2
CA
C2
3A
OA
1A
2A
01
11
21
31
40
MOV B, C
MOV B, D
MOV B, E
MOV B, H
MOV B, L
MOV B, mem
MOV B, A
MOV C, B
MOV C, C
MOV C, D
MOV C, E
MOV C, H
MOV C, L
MOV C, mem
MOV C, A
MOV D, B
MOV D, C
MOV D, D
MOV D, E
MOV D, H
MOV D, L
MOV D, mem
MOV D, A
MOV E, B
MOV E, C
MOV E, D
MOV E, E
MOV E, H
MOV E, L
MOV E, mem
MOV E, A
MOV H, B
MOV H, C
MOV H, D
MOV H, E
MOV H, H
MOV H, L
MOV H, mem
MOV H, A
MOV L, B
MOV L, C
MOV L, D
MOV L, E
MOV L, H
MOV L, L
MOV L, mem
MOV L, A
MOV mem, B
MOV mem, C
41
42
43
44
45
46
47
48
49
4A
4B
4C
4D
4E
4F
50
51
52
53
54
55
56
57
58
59
5A
5B
5C
5D
5E
5F
60
61
62
63
64
65
66
67
68
69
6A
6B
6C
6D
6E
6F
70
71
MOV mem, D
MOV mem, E
MOV mem, H
MOV mem, L
MOV mem, A
MOV A, B
MOV A, C
MOV A, D
MOV A, E
MOV A, H
MOV A, L
MOV A, mem
MOV A, A
MVI B, d8
MVI C, d8
MVI D, d8
MVI E, d8
MVI H, d8
MVI L, d8
MVI mem, d8
MVI A, d8
NOP
ORA B
ORA C
ORA D
ORA E
ORA H
ORA L
ORA mem
ORA A
ORI d8
OUT a8
PCHL
POP B
POP D
POP H
POP psw
PUSH B
PUSH D
PUSH H
PUSH psw
RAL
RAR
RLC
RRC
RET
RC
RNC
RP
OP
MNE
OP
72
73
74
75
77
78
79
7A
7B
7C
7D
7E
7F
06
0E
16
1E
26
2E
36
3E
00
B0
B1
B2
B3
B4
B5
B6
B7
F6
D3
E9
C1
D1
E1
F1
C5
D5
E5
F5
17
1F
07
0F
C9
D8
D0
F0
RM
RPE
RPO
RZ
RNZ
RIM
RST0
RST1
RST2
RST3
RST4
RST5
RST6
RST7
SBB B
SBB C
SBB D
SBB E
SBB H
SBB L
SBB mem
SBB A
SBI d8
SHLD a16
SIM
SPHL
STA a16
STAX B
STAX D
STC
SUB B
SUB C
SUB D
SUB E
SUB H
SUB L
SUB mem
SUB A
SUI d8
XCHG
XRA B
XRA C
XRA D
XRA E
XRA H
XRA L
XRA mem
XRA A
XRI d8
F8
E8
E0
C8
C0
20
C7
CF
D7
DF
E7
EF
F7
FF
98
99
9A
9B
9C
9D
9E
9F
DE
22
30
F9
32
02
12
37
90
91
92
93
94
95
96
97
D6
EB
A8
A9
AA
AB
AC
AD
AE
AF
EE
XTHL
E3
PROGRAM:
ADDRESS
OP-CODE
INSTRUCTION
COMMENTS
PROGRAM SHEET
PROGRAM:
ADDRESS
OP-CODE
INSTRUCTION
COMMENTS
MNE
ACI d8
ADC B
ADC C
ADC D
ADC E
ADC H
ADC L
ADC mem
ADC A
ADD B
ADD C
ADD D
ADD E
ADD H
ADD L
ADD mem
ADD A
ADI d8
ANA B
ANA C
ANA D
ANA E
ANA H
ANA L
ANA mem
ANA A
ANI d8
CALL a16
CC a16
CNC a16
CP a16
CM a16
CPE a16
CPO a16
CZ a16
CNZ a16
CMA
CMC
CMP B
CMP C
CMP D
CMP E
CMP H
CMP L
CMP mem
CMP A
CPI d8
DAA
DAD B
OP
CE
88
89
8A
8B
8C
8D
8E
8F
80
81
82
83
84
85
86
87
C6
A0
A1
A2
A3
A4
A5
A6
A7
E6
CD
DC
D4
F4
FC
EC
E4
CC
C4
2F
3F
B8
B9
BA
BB
BC
BD
BE
BF
FE
27
09
MNE
DAD D
DAD H
DAD SP
DCR B
DCR C
DCR D
DCR E
DCR H
DCR L
DCR mem
DCR A
DCX B
DCX D
DCX H
DCX SP
DI
EI
HLT
IN a8
INR B
INR C
INR D
INR E
INR H
INR L
INR mem
INR A
INX B
INX D
INX H
INX SP
JMP a16
JC a16
JNC a16
JP a16
JM a16
JPE a16
JPO a16
JZ a16
JNZ a16
LDA a16
LDAX B
LDAX D
LHLD a16
LXI B, d16
LXI D, d16
LXI H, d16
LXI SP, d16
MOV B, B
OP
19
29
39
05
0D
15
1D
25
2D
35
3D
0B
1B
2B
3B
F3
FB
76
DB
04
0C
14
1C
24
2C
34
3C
03
13
23
33
C3
DA
D2
F2
FA
EA
E2
CA
C2
3A
OA
1A
2A
01
11
21
31
40
MNE
MOV B, C
MOV B, D
MOV B, E
MOV B, H
MOV B, L
MOV B, mem
MOV B, A
MOV C, B
MOV C, C
MOV C, D
MOV C, E
MOV C, H
MOV C, L
MOV C, mem
MOV C, A
MOV D, B
MOV D, C
MOV D, D
MOV D, E
MOV D, H
MOV D, L
MOV D, mem
MOV D, A
MOV E, B
MOV E, C
MOV E, D
MOV E, E
MOV E, H
MOV E, L
MOV E, mem
MOV E, A
MOV H, B
MOV H, C
MOV H, D
MOV H, E
MOV H, H
MOV H, L
MOV H, mem
MOV H, A
MOV L, B
MOV L, C
MOV L, D
MOV L, E
MOV L, H
MOV L, L
MOV L, mem
MOV L, A
MOV mem, B
MOV mem, C
OP
41
42
43
44
45
46
47
48
49
4A
4B
4C
4D
4E
4F
50
51
52
53
54
55
56
57
58
59
5A
5B
5C
5D
5E
5F
60
61
62
63
64
65
66
67
68
69
6A
6B
6C
6D
6E
6F
70
71
MNE
MOV mem, D
MOV mem, E
MOV mem, H
MOV mem, L
MOV mem, A
MOV A, B
MOV A, C
MOV A, D
MOV A, E
MOV A, H
MOV A, L
MOV A, mem
MOV A, A
MVI B, d8
MVI C, d8
MVI D, d8
MVI E, d8
MVI H, d8
MVI L, d8
MVI mem, d8
MVI A, d8
NOP
ORA B
ORA C
ORA D
ORA E
ORA H
ORA L
ORA mem
ORA A
ORI d8
OUT a8
PCHL
POP B
POP D
POP H
POP psw
PUSH B
PUSH D
PUSH H
PUSH psw
RAL
RAR
RLC
RRC
RET
RC
RNC
RP
OP
72
73
74
75
77
78
79
7A
7B
7C
7D
7E
7F
06
0E
16
1E
26
2E
36
3E
00
B0
B1
B2
B3
B4
B5
B6
B7
F6
D3
E9
C1
D1
E1
F1
C5
D5
E5
F5
17
1F
07
0F
C9
D8
D0
F0
MNE
RM
RPE
RPO
RZ
RNZ
RIM
RST0
RST1
RST2
RST3
RST4
RST5
RST6
RST7
SBB B
SBB C
SBB D
SBB E
SBB H
SBB L
SBB mem
SBB A
SBI d8
SHLD a16
SIM
SPHL
STA a16
STAX B
STAX D
STC
SUB B
SUB C
SUB D
SUB E
SUB H
SUB L
SUB mem
SUB A
SUI d8
XCHG
XRA B
XRA C
XRA D
XRA E
XRA H
XRA L
XRA mem
XRA A
XRI d8
XTHL
OP
F8
E8
E0
C8
C0
20
C7
CF
D7
DF
E7
EF
F7
FF
98
99
9A
9B
9C
9D
9E
9F
DE
22
30
F9
32
02
12
37
90
91
92
93
94
95
96
97
D6
EB
A8
A9
AA
AB
AC
AD
AE
AF
EE
E3
GROUP
A
CONTROL
DATA
BUS
BUFFER
D7-D0
GROUP
A
PORT A
(8)
PA7-PA0
GROUP
A
PORT CU
(4)
PC7-PC4
GROUP
B
PORT CL
(4)
PC3-PC0
GROUP
B
PORT B
(8)
PB7-PB0
RD
WR
A0
READ
WRITE
CONTROL
LOGIC
GROUP
B
CONTROL
A1
RESET
CS
Addresses of ports:
A1
0
0
1
1
A0
0
1
0
1
CS
0
0
0
0
Port selected
Port A
Port B
Port C
Control Register
1 Bit set
0 Bit reset
Bit Select
D3 D2 D1
0 0 0 PC0
0 0 1 PC1
0 1 0 PC2
0 1 1 PC3
1 0 0 PC4
1 0 1 PC5
1 1 0 PC6
1 1 1 PC7
D2
D1
D0
1
Group B
Port CL
1 input
0 output
Port B
1 input
0 output
Mode Selection
0 Mode 0
1 Mode 1
Group A
Port CU
1 input
0 output
Port A
1 input
0 output
Mode Selection
D6 D5
0 0 Mode 0
0 1 Mode 1
0 x Mode 2
Bit Set/Reset (BSR) mode: Each bit of Port C can be independently set (1) or reset (0) but
only one bit can be set or reset at a time.
I/O Modes:
Mode 0: Basic I/O mode: Any port (Port A, Port B, Port CU or Port CL) can be
independently configured as simple input port or simple output port.
Mode 1: Strobed I/O mode: Port A and Port B can be independently configured either as
strobed input port or as output port. Port C is used for handshaking.
Port A & Port B as input port: The following figure shows the two of four Mode 1
possible configurations of Port A and Port B. Here Port A and Port B are configured as input
ports with three handshaking signals namely STB, IBF and INTR.
PB7-PB0
PA7-PA0
INTE B
INTE A
PC4
STBA
PC2
STBB
PC5
IBFA
PC1
IBFB
PC3
INTRA
PC0
INTRB
RD
RD
2
PC6/PC7
I/O
PB7-PB0
PA7-PA0
INTE B
INTE A
PC6
ACKA
PC2
ACKB
PC7
OBFA
PC1
OBFB
PC3
INTRA
PC0
INTRB
WR
WR
2
PC4/PC5
I/O
D6
D5
D4
D3
D2
D1
D0
I/O
I/O
IBFA
INTEA
INTRA
INTEB
IBFB
INTRB
Group A bits
Group B bits
D6
D5
D4
D3
D2
D1
D0
OBFA
INTEA
I/O
I/O
INTRA
INTEB
OBFB
INTRB
Group B bits
Group A bits
PC3
INTRA
PA7-PA0
INTE
1
PC7
OBFA
PC6
ACKA
PC4
STBA
PC5
IBFA
INTE
2
WR
PC2 PC0
RD
3
I/O
INTE 1 is controlled by bit set/reset of PC6 and INTE 2 is controlled by bit set/reset of
PC4.
Polling & Interrupt: For polling the processor has to read Port C for a Mode 2 Status Word
and perform standard bit-testing techniques. The format for Mode 2 Status Word has been
shown below.
Mode 2 Status Word for Output Configuration
D7
D6
D5
D4
D3
D2
D1
D0
OBFA
INTE 1
IBFA
INTE 2
INTRA
Group A bits
Group B bits
0000
(A)
0001
(b)
0010
(C)
0011
(d)
Display RAM
Display
In the right entry mode, the characters in the display RAM are displayed as shown below.
0000
(A)
0001
(b)
0010
(C)
0011
(d)
Display RAM
Display
Any new entry to the display RAM will shift the display to the left by one digit, displaying
the newly entered character on the rightmost digit.
Step 2: Select the blanking code using the following control word.
1
EN CD CD
CF
CA
AI
a
f
b
g
dp
dp
Seven-segment display
Assign logic 1s to the selected segments and logic 0s to the other segments. The deselected
segments (those with logic 0s) will be blanked with the proper blanking code determined in
Step 2.
Final note:
Write the proper control words and send them to the control register.
Read the FIFO status word from the control register.
Write the proper character codes and send them to the display RAM.
(II) To read a character from keyboard:
Step 1: Select the desired keyboard (and display) mode using the following control word.
0
AI
SC
SC
SC
RL
RL
RL
RL0
0
8
RL1
1
9
RL2
2
A
RL3
3
B
RL4
4
C
RL5
5
D
RL6
6
E
RL7
7
F
For decoding in case of kit, create a lookup table that contains the display code for each key
code using the above table.
Step 5: Store the display codes and send them to the display RAM through the steps 2 to 4 in
(I).
PROGRAM SHEET
PROGRAM 1: 8-BIT ADDITION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4201h
4101
01
4102
42
4103
47
MOV B, A
4104
3A
LDA 4200h
4105
00
4106
42
4107
0E
4108
00
4109
80
ADD B
410A
D2
410B
0E
410C
41
410D
0C
INR C
410E
32
410F
02
4110
42
4111
79
MOV A, C
4112
32
STA 4203h
4113
03
4114
42
4115
76
MVI C, 00h
HLT
RESULT:
WITHOUT CARRY:
4200: AUGEND
4202: LB OF SUM
4201: ADDEND
WITH CARRY:
4200: AUGEND
4203: HB OF SUM
4201: ADDEND
4203: HB OF SUM
4202: LB OF SUM
COMMENTS
PROGRAM SHEET
PROGRAM 11: 8-BIT ADDITION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4200h
4101
00
4102
42
4103
FE
4104
01
4105
42
4106
86
ADD mem
4107
0E
MVI C, 00h
4108
00
4109
D2
410A
0D
410B
41
410C
0C
INR C
410D
32
410E
02
410F
42
4110
79
MOV A, C
4111
32
STA 4203h
4112
03
4113
42
4114
76
LXI H, 4201h
HLT
COMMENTS
PROGRAM SHEET
PROGRAM 2: 8-BIT SUBTRACTION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4201h
4101
01
4102
42
4103
47
MOV B, A
4104
3A
LDA 4200h
4105
00
4106
42
4107
0E
4108
00
4109
90
SUB B
410A
D2
410B
11
410C
41
410D
2F
CMA
410E
C6
ADI 01h
410F
01
4110
0C
INR C
4111
32
4112
02
4113
42
4114
79
MOV A, C
4115
32
STA 4203h
4116
03
4117
42
4118
76
RESULT:
WITHOUT CARRY:
4200: MINUEND
MVI C, 00h
HLT
4202: DIFFERENCE
4201: SUBTRAHEND
WITH CARRY:
4200: MINUEND
4203: CARRY
4201: SUBTRAHEND
4203: CARRY
4202: DIFFERENCE
COMMENTS
PROGRAM SHEET
PROGRAM 21: 8-BIT SUBTRACTION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4200h
4101
00
4102
42
4103
21
4104
01
4105
42
4106
0E
4107
00
4108
96
SUB mem
4109
D2
410A
10
410B
41
410C
0C
INR C
410D
2F
CMA
410E
C6
ADI 01h
410F
01
4110
32
4111
02
4112
42
4113
79
MOV A, C
4114
32
STA 4203h
4115
03
4116
42
4117
76
LXI H, 4201h
MVI C, 00h
HLT
COMMENTS
PROGRAM SHEET
PROGRAM 3: 8-BIT MULTIPLICATION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4200h
4101
00
4102
42
4103
5F
MOV E, A
4104
16
MVI D, 00h
4105
00
4106
3A
4107
01
4108
42
4109
21
410A
00
410B
00
410C
19
LOOP: DAD D
410D
3D
DCR A
410E
C2
410F
0C
4110
41
4111
22
4112
02
4113
42
4114
76
RESULT:
WITHOUT CARRY:
4200: MULTIPLICANT
LDA 4201h
LXI H, 0000h
SHLD 4202
HLT
4202: LB OF PRODUCT
4201: MULTIPLIER
WITH CARRY:
4200: MULTIPLICANT
4203: HB OF PRODUCT
4202: LB OF PRODUCT
4201: MULTIPLIER
4203: HB OF PRODUCT
COMMENTS
PROGRAM SHEET
PROGRAM 31: 8-BIT MULTIPLICATION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4200h
4101
00
4102
42
4103
5F
MOV E, A
4104
3A
LDA 4201h
4105
01
4106
42
4107
16
4108
00
4109
21
410A
00
410B
00
410C
0E
410D
08
410E
1F
LOOP: RAR
410F
D2
4110
13
4111
41
4112
19
DAD D
4113
EB
SKP: XCHG
4114
29
DAD H
4115
EB
XCHG
4116
0D
DCR C
4117
C2
4118
0E
4119
41
411A
22
411B
02
411C
42
411D
76
MVI D, 00h
LXI H, 0000h
MVI C, 08h
SHLD 4202h
HLT
COMMENTS
PROGRAM SHEET
PROGRAM 32: 8-BIT MULTIPLICATION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4200h
4101
00
4102
42
4103
4F
MOV C, A
4104
3A
LDA 4201h
4105
01
4106
42
4107
47
MOV B, A
4108
AF
XRA A
4109
16
MVI D, 00h
410A
00
410B
80
LOOP: ADD B
410C
D2
410D
10
410E
41
410F
14
INR D
4110
0D
CKCT: DCR C
4111
C2
4112
0B
4113
41
4114
32
4115
02
4116
42
4117
7A
MOV A, D
4118
32
STA 4203h
4119
03
411A
42
411B
76
STA 4202h
HLT
COMMENTS
PROGRAM SHEET
PROGRAM 4: 8-BIT DIVISION
ADDRESS
OP-CODE
INSTRUCTION
4100
3A
LDA 4201h
4101
01
4102
42
4103
47
MOV B, A
4104
3A
LDA 4200h
4105
00
4106
42
4107
0E
4108
00
4109
B8
LOOP: CMP B
410A
DA
JC END (4112h)
410B
12
410C
41
410D
90
SUB B
410E
0C
INR C
410F
C3
4110
09
4111
41
4112
32
4113
02
4114
42
4115
79
MOV A, C
4116
32
STA 4203h
4117
03
4118
42
4119
76
MVI C, 00h
HLT
RESULT:
4200: DIVIDEND
4202: QUOTIENT
4201: DIVISOR
4203: REMINDER
COMMENTS
PROGRAM SHEET
PROGRAM 5: 16-BIT ADDITION
ADDRESS
OP-CODE
INSTRUCTION
4100
0E
MVI C, 00h
4101
00
4102
2A
4103
02
4104
42
4105
EB
XCHG
4106
2A
LHLD 4200h
4107
00
4108
42
4109
19
DAD D
410A
D2
410B
0E
410C
41
410D
0C
INR C
410E
22
410F
04
4110
42
4111
79
MOV A, C
4112
32
STA 4206h
4113
06
4114
42
4115
76
RESULT:
WITHOUT CARRY:
4200: LB OF AUGEND
4201: HB OF AUGEND
4202: LB OF ADDEND
4203: HB OF ADDEND
WITH CARRY:
4200: LB OF AUGEND
4201: HB OF AUGEND
4202: LB OF ADDEND
4203: HB OF ADDEND
COMMENTS
LHLD 4202h
HLT
SUM:
4206
4205
4204
SUM:
4206
4205
4204
10
PROGRAM SHEET
PROGRAM 51: 16-BIT ADDITION
ADDRESS
OP-CODE
INSTRUCTION
4100
0E
MVI C, 00h
4101
00
4102
2A
4103
00
4104
42
4105
EB
XCHG
4106
2A
LHLD 4202h
4107
02
4108
42
4109
7D
LBADD: MOV A, L
410A
83
ADD E
410B
6F
MOV L, A
410C
7C
HBADD: MOV A, H
410D
8A
ADC D
410E
67
MOV H, A
410F
D2
4110
13
4111
41
4112
0C
INR C
4113
22
4114
04
4115
42
4116
79
MOV A, C
4117
32
STA 4206
4118
06
4119
42
411A
76
LHLD 4200h
HLT
COMMENTS
11
PROGRAM SHEET
PROGRAM 52: 16-BIT ADDITION
ADDRESS
OP-CODE
INSTRUCTION
4100
0E
MVI C, 00h
4101
00
4102
21
4103
00
4104
42
4105
3A
4106
02
4107
42
4108
86
ADD mem
4109
5F
MOV E, A
410A
23
HBADD: INX H
410B
3A
LDA 4203h
410C
03
410D
42
410E
8E
ADC mem
410F
57
MOV D, A
4110
D2
JNC END
4113
0C
INR C
4114
EB
END: XCHG
4115
22
SHLD 4204h
4116
04
4117
42
4118
79
MOV A, C
4119
32
STA 4206h
411A
06
411B
42
411C
76
LXI H, 4200h
4111
4112
HLT
COMMENTS
12
PROGRAM SHEET
PROGRAM 6: 16-BIT SUBTRACTION
ADDRESS
OP-CODE
INSTRUCTION
4100
0E
MVI C, 00h
4101
00
4102
06
4103
00
4104
2A
4105
00
4106
42
4107
EB
XCHG
4108
2A
LHLD 4202h
4109
02
410A
42
410B
7B
SULB: MOV A, E
410C
95
SUB L
410D
5F
MOV E, A
410E
D2
410F
12
4110
41
4111
0C
INR C
4112
7A
SUHB: MOV A, D
4113
94
SUB H
4114
57
MOV D, A
4115
D2
4116
22
4117
41
4118
0C
INR C
4119
04
INR B
411A
7A
MOV A, D
411B
2F
CMA
411C
80
ADD B
411D
57
MOV D, A
MVI B, 00h
LHLD 4200h
COMMENTS
13
PROGRAM SHEET
ADDRESS
OP-CODE
INSTRUCTION
411E
7B
MOV A, E
411F
2F
CMA
4120
80
ADD B
4121
5F
MOV E, A
4122
0D
CCHK: DCR C
4123
D2
4124
27
4125
41
4126
15
DCR D
4127
EB
END: XCHG
4128
22
SHLD 4204h
4129
04
412A
42
412B
78
MOV A, B
412C
32
STA 4206h
412D
06
412E
42
412F
76
RESULT:
WITHOUT CARRY:
4200: LB OF MINUEND
4201: HB OF MINUEND
4202: LB OF SUBTRAHEND
4203: HB OF SUBTRAHEND
WITH CARRY:
4200: LB OF MINUEND
4201: HB OF MINUEND
4202: LB OF SUBTRAHEND
4203: HB OF SUBTRAHEND
HLT
4204: LB OF DIFFERENCE
4205: HB OF DIFFERENCE
4206: CARRY
4204: LB OF DIFFERENCE
4205: HB OF DIFFERENCE
4206: CARRY
COMMENTS
14
PROGRAM SHEET
PROGRAM 61: 16-BIT SUBTRACTION
ADDRESS
OP-CODE
INSTRUCTION
4100
0E
MVI C, 00h
4101
00
4102
2A
4103
00
4104
42
4105
EB
XCHG
4106
2A
LHLD 4202h
4107
02
4108
42
4109
7D
MOV A, L
410A
2F
CMA
410B
6F
MOV L, A
410C
7C
MOV A, H
410D
2F
CMA
410E
67
MOV H, A
410F
23
INX H
4110
19
DAD D
4111
3F
CMC
4112
D2
4113
1D
4114
41
4115
0C
INR C
4116
7D
MOV A, L
4117
2F
CMA
4118
6F
MOV L, A
4119
7C
MOV A, H
411A
2F
CMA
411B
67
MOV H, A
411C
23
INX H
411D
22
411E
04
411F
42
LHLD 4200h
COMMENTS
15
PROGRAM SHEET
ADDRESS
OP-CODE
INSTRUCTION
4120
79
MOV A, C
4121
32
STA 4206h
4122
06
4123
42
4124
76
HLT
COMMENTS
16
PROGRAM SHEET
PROGRAM 7: 16-BIT MULTIPLICATION
ADDRESS
OP-CODE
INSTRUCTION
LHLD 4200h
SPHL
LHLD 4202h
XCHG
LXI H, 0000h
LXI B, 0000h
RADD: DAD SP
JNC CNT
INX B
CNT: DCX D
MOV A, E
ORA D
JNZ RADD
SHLD 4204h
MOV L, C
MOV H, B
COMMENTS
17
PROGRAM SHEET
ADDRESS
OP-CODE
INSTRUCTION
SHLD 4206h
HLT
COMMENTS
2
41. What is meant by pipelining?
42. What is meant by FIFO? Give an example.
43. When a segment and offset combination is given as 480B:007A, what is the actual
physical address generated?
44. What is meant by effective address?
45. The operating mode of Intel 8086 is often termed as ___________ in the PC
world.
46. What is meant by page limit?
47. If a segment register contains 680A, what is the starting address of the segment?
48. Name the flags of 8086.
49. Give any four differences between 8085 and 8086.
50. What is meant by postman clock?
UNIT I
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
3
UNIT II
1.
2.
3.
4.
5.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
4
UNIT III
1.
2.
3.
4.
5.
6.
5
21. What is 8259?
22. The maximum number of interrupts resolved by 8259 is _________ without
cascading and __________ with cascading.
23. Name the five arbitration modes of 8259.
24. What is meant by fully nested priority mode of 8259?
25. What is meant by rotating equal priority mode of 8259?
26. What is meant by rotating specific priority mode of 8259?
27. What is meant by basic mask mode of 8259?
28. What is meant by special mask mode of 8259?
29. What is meant by polled mode of 8259?
30. When do you require interrupt-driven IO and when DMA?
UNIT IV
1.
2.
3.
4.
5.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
What is an assembler?
Give any four advantages of using an assembler.
What is a pseudoinstruction? Give an example.
What is the purpose of the directive, ORIGIN (ORG)?
What is the purpose of the directive, EQUATE (EQU)?
What is the purpose of the directive, DEFINE BYTE (DB)?
What is the purpose of the directive, DEFINE WORD (DW)?
What is the purpose of the directive, TITLE?
What is the purpose of the directive, PAGE or EJECT?
What is the purpose of the directive, SPACE?
What is the purpose of the directive, END?
What is the purpose of the directive, LIST?
What is a one-pass assembler?
What is a two-pass assembler?
What is a macro assembler?
What is a cross assembler?
What is a resident assembler?
What is a meta assembler?
What is meant by debugging?
Give the three popular types of debugging methods.
What is meant by single-stepping a microprocessor?
What is meant by breakpoint facility?
What is meant by a simulator?
6
24. Debug the following program.
MOV B, 02H
L1: LXI D, FFFFH
L2: DCX D
JNZ L2
DCR B
JNZ L1
RET
25. What happens when the following program is assembled using a one-pass
assembler?
IN portA
L1: CPI set_pt
JC L2
SUI set_pt
JMP L1
L2: HLT
26. What is a subroutine?
27. Differentiate between a subroutine and an interrupt.
28. What is an algorithm?
29. What is a flow chart?
30. Differentiate between an algorithm and a flow chart.
UNIT V
1.
2.
3.
4.
5.
6.
7.
8.
9.
Write an assembly language program to add two 8-bit numbers and store the sum
in the memory location 4500H. Draw the flow chart.
Write an assembly language program to subtract an 8-bit number from another
and store the difference in the memory location 4500H and the sign bit i.e., the
carry bit in 4501H. Draw the flow chart.
Write an assembly language program to multiply two 8-bit numbers and store the
product in the memory location 4500H. Draw the flow chart.
Write an assembly language program to multiply two 8-bit numbers through
direct binary multiplication method and store the product in the memory location
4500H. Draw the flow chart.
Write an assembly language program to divide an 8-bit number by another and
store the quotient in the memory location 4500H and the remainder in 4501H.
Draw the flow chart.
Write an assembly language program to add two 16-bit numbers and store the
sum in the memory location 4500H. Draw the flow chart.
Write an assembly language program to subtract a 16-bit number from another
and store the difference in the memory location 4500H and the sign bit i.e., the
carry bit in 4502H. Draw the flow chart.
Write an assembly language program to multiply two 16-bit numbers and store
the product in the memory location 4500H. Draw the flow chart.
Write an assembly language program to find the largest number from a given set
of 8-bit numbers and store the result in 4500H. Draw the flow chart.
7
10. Write an assembly language program to find the smallest number from a given set
of 8-bit numbers and store the result in 4500H. Draw the flow chart.
11. Write an assembly language program to arrange a set of 8-bit numbers in
ascending order. Draw the flow chart.
12. Write an assembly language program to arrange a given set of 8-bit numbers in
descending order. Draw the flow chart.
13. Write an assembly language program to convert a given 8-bit hexadecimal
number to decimal number. Draw the flow chart.
14. Write an assembly language program to convert a given 8-bit decimal number to
hexadecimal number. Draw the flow chart.
15. Write an assembly language program to convert a given BCD number to binary
number. Draw the flow chart.
16. Write an assembly language program to convert a given binary number to BCD
number. Draw the flow chart.
17. Write an assembly language program to add two BCD numbers. Draw the flow
chart.
18. Explain the microprocessor-based temperature control system with relevant
flowchart.
19. Explain the microprocessor-based speed control system with relevant flow chart.
20. Explain the microprocessor-based traffic control system with relevant flow chart.
1.
It is desired that two 8-bit numbers are read from the hex keyboard on your trainer
kit and added and the sum is displayed in the 7-segment display on your kit. Write
an assembly language program to accomplish this task. Assume that the hex
keyboard and the 7-segment display are interfaced to 8085 with an 8279. The hex
key matrix and the display section have been shown below. The code for the key
pressed is stored in FIFO RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
2.
It is desired that two 8-bit numbers are read from the hex keyboard on your trainer
kit and subtracted from one another and the difference is displayed in the 7-segment
display on your kit. Write an assembly language program to accomplish this task.
Assume that the hex keyboard and the 7-segment display are interfaced to 8085 with
an 8279. The hex key matrix and the display section have been shown below. The
code for the key pressed is stored in FIFO RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
3.
It is desired that two 8-bit numbers are read from the hex keyboard on your trainer
kit and multiplied by one another and the product is displayed in the 7-segment
display on your kit. Write an assembly language program to accomplish this task.
Assume that the hex keyboard and the 7-segment display are interfaced to 8085 with
an 8279. The hex key matrix and the display section have been shown below. The
code for the key pressed is stored in FIFO RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
4.
It is desired that two 8-bit numbers are read from the hex keyboard on your trainer
kit and divided by one another and the quotient is displayed in the 7-segment
display on your kit. Write an assembly language program to accomplish this task.
Assume that the hex keyboard and the 7-segment display are interfaced to 8085 with
an 8279. The hex key matrix and the display section have been shown below. The
code for the key pressed is stored in FIFO RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
5.
It is desired that a set of 8-bit numbers is read from the hex keyboard on your trainer
kit and the largest number among them is found and displayed in the 7-segment
display on your kit. Write an assembly language program to accomplish this task.
Assume that the hex keyboard and the 7-segment display are interfaced to 8085 with
an 8279. The hex key matrix and the display section have been shown below. The
code for the key pressed is stored in FIFO RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
6.
It is desired that a set of 8-bit numbers is read from the hex keyboard on your trainer
kit and they are arranged in ascending order and the first number in the ordered
array is displayed in the 7-segment display on your kit. Write an assembly language
program to accomplish this task. Assume that the hex keyboard and the 7-segment
display are interfaced to 8085 with an 8279. The hex key matrix and the display
section have been shown below. The code for the key pressed is stored in FIFO
RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
7.
It is desired that a 3-letter word is read from the hex keyboard on your trainer kit
and displayed in the 7-segment display on your kit and made to blink every second.
Write an assembly language program to accomplish this task. Assume that the hex
keyboard and the 7-segment display are interfaced to 8085 with an 8279. The hex
key matrix and the display section have been shown below. The code for the key
pressed is stored in FIFO RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
8.
It is desired that a 3-letter word is read from the hex keyboard on your trainer kit
and rolled through the 7-segment display on your kit. Write an assembly language
program to accomplish this task. Assume that the hex keyboard and the 7-segment
display are interfaced to 8085 with an 8279. The hex key matrix and the display
section have been shown below. The code for the key pressed is stored in FIFO
RAM of 8279 according to
X X SC SC SC RL RL RL
where the SC field represents the binary equivalent of the scan line active during the
key press and the RL field represents the binary equivalent of the return line pulled
during the key press. The 7 display segments are activated according to the code
written into the display RAM of 8279. The display code is of the form
d c b a dp e g f
where a, b, c, d, dp, e, f & g are the display segments.
Assume (i) 00H as control word for selecting desired keyboard and display modes,
(ii) 40H as control word for selecting read FIFO RAM mode to read key code from
FIFO RAM, (iii) 90H as control word for selecting write display RAM mode to
write display code into display RAM, (iv) CCH as control word for blanking the
selected segments, (v) 01H as port address to control register of 8279 and (vi) 00H
as port address to either FIFO RAM or display RAM.
9.
Consider the following traffic diagram. An operator is supposed to control both the
left-right and up-down traffic manually using the keys in front of him. The functions
of the keys are as follows:
(i) The LR key allows the left-right traffic to begin with G2 & G4 ON, R1 & R3
ON, PS2 & PS4 OFF (RED) and PS1 & PS3 ON (GREEN),
(ii) The Y key allows the yellow lights alone to be ON and
(iii) The UD key allows the up-down traffic to begin with G1 & G3 ON, R2 & R4
ON, PS1 & PS3 OFF and PS2 & PS4 ON.
Simulate this situation through an assembly language program with the hex keys A,
B & C on your trainer kit in the place of the traffic control keys LR, Y & UD
respectively. Assume that the traffic lights have been connected to the pins of port A
and B of the PPI 8255 as shown in the table below
G1 G2 G3 G4 R1 R2 R3 R4 Y1 Y2 Y3 Y4 PS1 PS2 PS3 PS4
Also assume (i) 80H as control word for selecting port A and B of 8255 as output
ports, (ii) 0FH as port address to control register of 8255, (iii) 0CH as port address
to port A of 8255 and (iv) 0DH as port address to port B of 8255.
10.
A stepper motor has been interfaced to 8085 with a buffer cum driver as shown
below. An operator is supposed to control the stepping speed of the motor manually
using the keys in front of him. The functions of the keys are as follows: (i) The key
L allows the motor to advance one step every second. (ii) The key M allows the
motor to advance one step every half a second. (iii) The key H allows the motor to
advance one step every quarter a second. Simulate this situation through an
assembly language program with the hex keys A, B & C on your trainer kit in place
of the speed control keys L, M & H respectively. Assume C8H as port address to
buffer cum driver.
D7 (d)
D6 (c)
D5 (b)
D4 (a)
D3 (dp)
D2 (e)
D1 (g)
D0 (f)
dp
Display section
RL0
RL1
RL2
RL3
RL4
RL5
RL6
RL7
SC0
SC1
PS1
PS1
G1
PS4
G2
Y2
Y1
R2
PS2
R1
R3
PS4
R2
Y3
Y2 G2
G3
PS3
PS3
Traffic diagram
PS2
D3
D1
D0 - D3
B1
A1
Buffer
cum
driver
D2
A2
D0
B2