Upload
dhaval-shukla
View
216
Download
2
Embed Size (px)
Citation preview
Solution: MPI
Ques_1 (Any Three) (6)
(1) What do you mean by low level and high level programming languages?
Programming languages that are machine dependent are called low level
languages. For
example, assembly language(8085/8086/8051) is a low level language.
On the other hand, programming languages that are machine independent are
called high level languages. Examples are BASIC, FORTRAN, C, ALGOL, COBOL, etc.
(2) The address capability of 8085 is 64 KB. Explain.
Microprocessor 8085 communicates via its address bus of 2-bytes width the
lower byte AD0 AD7 and upper byte A8 A15. Thus it can address a maximum of 216
different address locations. Again each address (memory location) can hold 1 byte of
data/instruction. Hence the maximum address capability of 8085 is
= 216 1 Byte
= 65, 536 1 Byte
= 64 KB (where 1 K = 1024 bytes)
(3) Mention the addressing modes of 8085. What jobs ALU of 8085 can perform?
Each instruction indicates an operation to be performed on certain data. There are
various methods to specify the data for the instructions, known as addressing modes.
For 8085 microprocessor, there are five addressing modes. These are:
Direct addressing
Register addressing
Register indirect addressing
Immediate addressing
Implicit addressing.
The Arithmetic Logic Unit (ALU) of 8085 can perform the following jobs:
8-bit binary addition with or without carry.
16-bit binary addition.
2-digit BCD addition.
8-bit binary subtraction with or without borrow.
8-bit logical OR, AND, EXOR, complement (NOT function).
1-bit shift operation.
(4) What are the temporary registers of 8085? Describe the utilization of temporary
register in 8085 operations.
The temporary registers of 8085 are temporary data register and W and Z
registers. These registers are not available to the programmer, but 8085 uses them
internally to hold temporary data during execution of some instructions.
CALL-RET instructions are used in subroutine operations. On getting a CALL in
the main program, the current program counter content is pushed into the stack and
loads the PC with the first memory location of the subroutine. The address of the first
memory location of the subroutine is temporarily stored in W and Z registers.
Again, XCHG instruction exchanges the contents H and L with D and E
respectively.W and Z registers are used for temporary storage of such data.
(5) Describe the general purpose registers of 8085? Mention the utility of the general
purpose registers. In what other way HL pair can be used?
The general purpose registers of 8085 are: B, C, D, E, H and L. They are all 8-bit
registers but can also be used as 16-bit register pairsBC, DE and HL.
General purpose registers store temporary data during program execution, which
can also be stored in different accessible memory locations. But storing temporary data
in memory requires bus accesshence more time is needed to store. Thus it is always
advisable to store data in general purpose registers.
The more the number of general purpose registers, the more is flexibility in
programmingso a microprocessor having more such registers is always advantageous.
HL register pair can be used as a memory address pointer.
Que_2 Draw the timing diagram for execution of instruction MVI A, 32 H. (4)
or
Draw the Timing diagram for Read Cycle and Write cycle for byte operation. [4]
Read Cycle
Write Cycle
Que_3 Write the algorithm and make flow chart for multiplication of two 8-bit numbers with
program instructions using assembly language of 8085.
Algorithm:
Step 1: Start the microprocessor
Step 2: Get the 1st 8 bit numbers
Step 3: Move the 1st 8it number to register B Step 4: Get the 2nd 8 bit number
Step 5: Move the 2nd 8 bit number to register C Step 6: Initialize the accumulator as zero
Step 7: Initialize the carry as zero
Step 8: Add both register B value as accumulator Step 9: Jump on if no carry
Step 10: Increment carry by 1 if there is
Step 11: Decrement the 2nd value and repeat from step 8, till the 2nd value becomes zero.
Step 12: Store the multiplied value in accumulator
Step 13: Move the carry value to accumulator
Step 14: Store the carry value in accumulator
Flow Chart
Code:
LXI H 4500h
MOV A M
INX H
MOV B M
MVI D 00h
MOV C A
MOV A D
GO: ADD B
JNC AHEAD
INR D
AHEAD: DCR C
JNZ GO
STA 4100h
MOV A D
STA 4101h
HLT