Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
02.
Sol: Programming model
A
Flag Register
B
C
D
E
H
L
Stack pointer (SP)
Program counter (P.C)
Accumulator is a 8bit Register involved in
most of the operations performed by
8085 like
Arithmetic,
Logical,
Load/store,
input/output operations.
Flag Register is a 8bit Register which
consists of 5 conditional flags (CY, P,
AC, Z, S) whose status will be updated
by ALU after Arithmetic and logical
operations.
ACE Engineering Academy
Sol:
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 282 :
Microprocessors
02.
Sol: Refer IES-2015 Conventional solutions.
03.Ans: (a)
Sol:
(i) READY:
This is an active-high control input pin
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 283 :
(iv) TRAP:
TRAP (also known as RST 4.5) is a
Hardware,
Non-maskable,
vectored
interrupt
This interrupt cannot be disabled by
programmer it is always said to be in
enabled condition.
This interrupt is both +ve edge triggered
and active high level triggered.
Instructions like EI, DI & SIM dont
effect TRAP.
The vector Address is 0024H.
04.
Sol: Refer IES-2015 Conventional solutions.
05. Ans: (c)
06.
Sol:Refer IES-2015 Conventional solutions.
07. Ans: (c)
08.
Sol:
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 284 :
Microprocessors
RST 0
RST 1
RST 2
RST 3
RST 4
RST 5
RST 6
RST 7
Vectored
interrupt
RST 0
RST 1
RST 2
RST 3
RST 4
RST 4.5
RST 5
RST 5.5
RST 6
RST 6.5
RST 7
RST 7.5
or
RST 7.5
RST 6.5
Vectored
Address
0000H
0008H
0010H
0018 H
0020 H
0024 H
0028 H
002C H
0030 H
0034 H
0038 H
003C H
RST 5.5
INTR
(Low priority )
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 285 :
02.
Sol: Refer IES-2015 Conventional solutions.
Level - 2
01.
Sol:
03.
Sol: Refer IES-2015 Conventional solutions.
04.
(3)
+5V
VCC
R
ALE
8085
74LS373 A0 to A7
AL
RESET IN
fcrystal
X1 AD0 to AD7
X2
GND
D0 to D7
A8 to A15
A8 to A15
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 286 :
Microprocessors
05.
Sol: When there is an interrupt request on INTR
01.
Sol:
FFFFH
I/O
Memory
0000H
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 287 :
03.
Sol:
The information about how many bytes
are there in the instruction is included in
the 1st byte of instruction.
ALE stands for address Latch Enable.
During T1(i.e., 1st clock cycle), when
8085 generates 16 bit Address (Lower
order 8bit Address Via AD0 to AD7 &
Higher order 8bit Address via A8 to
A15), it also asserts ALE output as 1.
The ALE control signal is to be used by
designer to enable 8bit Address Latch to
separate lower order Address from the
multiplexed Address/Data Bus. i.e., the
function of ALE is to de multiplex the
Address/Data Bus.
In the subsequent T-states of Instruction
cycle, ALE output is asserted as 0
04.
(i) n
Level - 2
01.
Sol: Refer IES-2015 Conventional solutions.
02.
Sol:
Sol:
1 KB
8 chips
1024 1
(ii) n
16 KB
128 chips
1024 1
1.
2.
3.
4.
5.
6.
ROM related
RAM related
I/O related
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 288 :
Microprocessors
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 289 :
8085
performs
the
3microperaty in 3T-states:
following
06.
Sol: Refer IES-2015 Conventional solutions.
02.
Sol:
XRA A:
The contents of Accumulator is XORed
with same and result is stored in
Accumulator. The addressing mode is
Register Addressing mode. Carry flag
and Auxillary carry flag will be cleared
and remaining flags affected based on
result.
DAA:
The content of accumulator is adjusted
into valid decimal range by 8085 after
Addition. 8085 performs following steps
for execution of DAA instruction.
If (LN>9 OR AC=1), then 6 is added to LN
If (HN>9 OR CY=1), then 6 is added to HN
(LN stands for Lower Nibble of
Accumulator and HN stands for Higher
Nibble of Accumulator)
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 290 :
Microprocessors
DCR M:
The content of 8 bit memory location is
subtracted from the contents of
Accumulator and the result will be stored
in Accumulator. The Addressing mode is
Register Indirect Addressing mode. All
the flags will be affected accordingly.
ADD B:
The content of accumulator is added with
the contents of B register and the result
will be stored in Accumulator. The
Addressing mode is Register Addressing
mode. All the flags will be affected
accordingly.
Zero Flag:
After an Arithmetic/Logical operation, if
the result contains all 0s then zero flag is
set to 1. Otherwise, reset to 0.
Sign Flag:
After an Arithmetic/Logical operation,
the MSB of result is always copied into
sign flag. If MSB of result is 1, then sign
flag is set to 1.If MSB of result is 0, then
sign flag is reset to 0.
04.
Sol: Refer IES-2015 Conventional solutions.
05.
Sol:
06.
Sol:
S Z X AC X P X CY
07.
Carry flag:
After an Arithmetic/ Logical operation, If
there is carry generated from MSB of
result then carry flag is set to 1.
08.
Sol: Refer IES-2015 Conventional solutions.
09. Ans: (B)
Parity flag:
After an Arithmetic/Logical operation, if
total number of 1s in the result is even
ACE Engineering Academy
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 291 :
Level - 2
01.
Sol:
10010101
After RAL
CY
1
00101011
(A) = 2BH, CY = 1
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 292 :
(ii)
RRC:
Before RRC:
Microprocessors
; (A) = 11 H, CY = 0
03.
Sol:
CY
1
(p)
10010101
(q)
After RRC:
(r)
CY
1
11001010
XRA A
SUB A
ORA A
ANA A
DAD H
LXI H, 0020H
04.
Sol:
(A) = CAH, CY = 1
(iii) XRI A5H:
(A) = 95 H 1 0 0 1 0 1 0 1
A5 H 1 0 1 0 0 1 0 1
(A) = 30 H 0 0 1 1 0 0 0 0
; CY = 0
(iv) CPI A9H
:
(A) = 95 H A9H
;95H A9H CY = 1, S = 1, Z
=0
;(A) = 95 H, CY = 1 ( ve result)
(v) ORI C9H
(A) = 95 H 1 0 0 1 0 1 0 1
C9 H 1 1 0 0 1 0 0 1
(A) =DDH 1 1 0 1 1 1 0 1
; (A) = DDH, CY = 0
(vi) ANI 33 H ;
(A) = 95 H 1 0 0 1 0 1 0 1
33 H 0 0 1 1 0 0 1 1
(A) = 11 H 0 0 0 1 0 0 0 1
ACE Engineering Academy
1. PUSH instruction
Syntax: PUSH r16
Operation: Contents of 16 bit register given
in instruction is moved into stack memory
(as given below) and stack pointer contents
decremented by 2.
((SP) 1) (rH)
((SP) 2) (rL)
(SP) is decremented by 2
Ex:
PUSH B
PUSH PSW
PUSH D
PUSH H
2. POP instruction
Syntax: POP r16
Operation: Contents of 2 memory locations
from Top of stack is retrieved into specified
16 bit register and stack pointer contents
will be incremented by 2
(rL) ((SP))
(rH) ((SP) + 1)
(SP) is incremented by 2
Ex:
POP PSW
POP D
POP
H
POP B
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 293 :
3. XTHL instruction
Syntax: XTHL
Operation: Contents of 2 memory locations
from Top of stack exchanged with contents
of HL pair. The contents of stack pointer
will be unchanged.
Ex: XTHL
06.
Sol: Refer IES-2015 Conventional solutions.
07.
Sol: Refer IES-2015 Conventional solutions.
08.
Sol: Refer IES-2015 Conventional solutions.
05.
09.
Main program
MAIN: 1st instruction of
MP
SOD
User defined
Service Routine
Addr16 : 1st instruction
Of USR
MP to USR
CALL Addr16
HLT
USR to MP
RET
Reset
7.5FF
Serial
Output
Data
Next instruction
SDE
Serial
Data
Enable
Local mask
status bits for
3HW, M, V.Is
Mask
Set Enable
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 294 :
RIM instruction
RIM is used for reading status of local
masks, global mask, pending interrupts and
also for receiving data bit at SID input pin.
For execution of RIM instruction, 8085 p
loads accumulator with 8bit number as
shown below (which is to be interpreted by
programmer)
SID I7.5 I5.6 I5.5 IE M7.5 M6.5 M5.5
Pending
Status Bits for
3 HW, M, V.Is
Serial
Input
Data
Sol:
Local mask
status bits for
3HW, M, V.Is
ORG 0000H
JMP MAIN
ORG 2501H
NUM
DB
96H
ORG 2100H
Global mask
status bit
MAIN:
LDA 2501H
CMA
Microprocessors
masked
01H
STA
2502H
HLT
masked
masked
ADI
03.
Sol:
are in
p sets
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 295 :
04.
Sol: ; Two 8 bit Hex numbers are stored in
;
;
;
;
;
;
;
;
Sol:
ORG 0000H
JMP
MAIN
ORG 0100H
MAIN: XRA A
MOV C,A
LDA
4200H
MOV B,A
END:
LDA
ADD
JNC
INR
STA
MOV
STA
HLT
4201H
B
END
C
4202H
A,C
4203H
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 296 :
START
Load accumulator with the
contents of 4200H
07.
Sol: Refer IES-2015 Conventional solutions.
08.
Sol:
Memory location 2050 holds data byte F7H.
This data is to be transferred to
accumulator
Using MOV instruction:
LXI H,2050H
; (HL) 2050H
MOV A,M ; (A) (HL) = F7H
Using LDAX instruction:
LXI B,2050H
; (BC) 2050H
LDAX B
; (A)(BC) = F7H
Using LDA instruction:
LDA 2050H
; (A) (2050H)
Out of above 3 op codes, LDA is more
efficient because less no. of T-states are
required.
Any
carry
?
NO
YES
Increment contents
of register C
Microprocessors
09.
Sol:
ORG 0000H
JMP MAIN
ORG 2600H
TABL dB
Store results in
A & C in the locations
4202H & 4203H
00,01,04,09,16,25,36,69,64,81
MAIN:
STOP
06.
Sol:
MOV M,r; the contents of 8 bit
register is copied into a RAM
location whose 16bit address is
available in HL pair.
INR r ;
the contents of 8 bit
register is incremented by 1.
RLC ; Rotate
contents
of
accumulator to left by 1 bit,
without including CY.
CMA ; complements contents of
accumulator
ACE Engineering Academy
DELAY:
LOOP:
ORG 0100H
LXI H, 2600H
IN
F8H;
MOV L,A
MOV A,M
OUT F9H
CALL DELAY
JMP MAIN
MVI A, FFH
DCR A
JNZ LOOP
RET
HLT
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 297 :
Level - 2
02.
Sol:
01.
Sol:
ORG
JMP
0000H
LXI SP,2700H
; (SP)2700H
MAIN
PUSH B
; (TOS)(BC)
ORG 1000H
= 2100H
(SP) = 26FEH
PUSH D
; (TOS)(DE)
MAIN:XRA A
= 0200H
MOV B,A
MVI
C,04H
LXI
H, 2500H
(SP) = 26FCH
LXI H,0100H ; (HL)0100H
; (TOS)(HL)
LOOP: ADD M
JNC
NEXT
INR
NEXT:INX
; (TOS)=0100H,
(HL)=0200H
DAD D
DCR C
JNZ
LOOP
STA
SUM
; (HL)(HL)+(DE)
(HL)0200H+0200H
(HL)=0400H
HLT
; (HL) = 0400H,
MOV A,B
STA
CARY
(DE)=0200H
HLT
03.
Sol:
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 298 :
Microprocessors
04.
Sol:
ORG
0000H
JMP
MAIN
CNTR
EQU 100AH
CARY
EQU 2002H
ORG
0100H
MAIN: LXI
H,0000H
MVI
A,05H
STA
CNTR
LXI
B,1000H
LOOP: LDAX
LI:
B
MOV
E, A
2002H
2001H
INX
2000H
LBRSLT
LDAX
MOV
D,A
100AH
CNTR
INX
DAD
JNC
L1
LDA
CARY
INR
STA
CARY
LDA
CNTR
DCR
STA
CNTR
JNZ
LOOP
SHLD
2000H
1009H
CARRY
HBRSLT
24 bit
result
5th no.
4th no.
3rd no.
2nd no.
1001H
1000H
1st no.
HLD
END
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 299 :
05.
Sol:
06.
Sol: Refer IES-2015 Conventional solutions.
07.
08.
Sol: Refer IES-2015 Conventional solutions.
09.
Sol: Refer IES-2015 Conventional solutions.
START
Sol:
(A)(2000)=X
(B)(2001)=Y
10.
Sol: Refer IES-2015 Conventional solutions.
11.
(A)-(B)
Sol:
ORG 0000H
JMP
MAIN
ORG 0100H
NO
YES
Any
carry
zero
result
?
YES
STOP
NO
(B)(B)-1
(A)(A)-2
C,08H
LOOP: RLC
JNC
SKIP
INR
SKIP:
JNZ
DCR C
LOOP
MOV A,B
ORG 0000H
JMP MAIN
X EQU
2000H
Y EQU
2001H
ORG 0100H
MAIN:
LDA Y
MOV B,A
LDA X
RPT: CMP B
JZ
STOP
JC
NEG
SUI 02H
JMP RPT
NEG: DCR B
JMP RPT
STOP:
HLT
ACE Engineering Academy
RAR
JC
EVEN
MVI
A,DDH
STA
4000H
HLT
EVEN: MVI
STA
STOP:
A,EEH
4000H
HLT
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai
: 300 :
Microprocessors
Hyderabad | New Delhi | Bhopal| Bengaluru | Bhubaneswar | Vijayawada | Visakhapatnam | Tirupati | Pune | Chennai