Microp Revision Q & A
Microp Revision Q & A
OPCODE: Short for Operation Code, is the part of a machine language instruction that specifies
the operation or task to be performed by the microprocessor. Example: In the instruction "ADD
A, B," the opcode is the code representing the addition operation i.e. ADD
OPERAND: Is the part of a machine language instruction that provides the data or the address
of data on which the operation specified by the opcode is to be performed. Example: In the
instruction "ADD A, B," the operands are registers A and B.
The flag register of the Intel 8085 microprocessor typically includes the following flags:
Sign (S) flag: Indicates the sign of the result after an arithmetic operation.
Auxiliary Carry (AC) flag: Used for binary-coded decimal (BCD) arithmetic.
Parity (P) flag: Indicates whether the number of set bits in the result is even or odd.
Carry (CY) flag: Set if there's a carry out of the most significant bit during arithmetic
operations.
3. With Aid Of A Timing Diagram, Describe The Opcode Fetch Machine Cycle.
(T1) Address Phase: The microprocessor places the memory address of the next
instruction on the address bus. The address is typically stored in the program counter
(PC).
(T2) Read Phase: The microprocessor activates the Read (RD) signal, indicating a read
operation. The memory responds by placing the specified address onto the data bus.
(T3) Fetch Phase: The microprocessor reads the opcode from the data bus and stores it
in the instruction register (IR). The program counter is incremented to prepare for the
next instruction.
(T4) Execution Phase: The op-code byte is placed in instruction decoder of MP and the
op-code is decoded and executed.
Kindly note that there are other 6 machine cycles that can be tested, make sure you
know how to draw and explain the T states of all of them
4. Table 1 Shows An 8085 Microprocessor Assembly Language Program.
(i) Hand-Code The Program Into It’s Equivalent Hexadecimal Machine Code.
4000: 21 01 4A
4003: 11 01 51
4006: 16 05
4008: 7E
4009: 02
400A: 23
400B: 13
400C: C2 07 40
400F: 76
Length of the Program: The program consists of 16 bytes, ranging from address 4000H to
400F.
Explanation of the Program:
Initialization:
LXI B, 4A01H: Load immediate data 4A01H into register pair BC.
LXI D, 5101H: Load immediate data 5101H into register pair DE.
Loop:
JNZ LOOP: Jump to the LOOP label if the Zero flag is not set.
Termination:
6. Describe Each Of The Following Interrupt Instructions: (I) SIM: (II) RIM:
(i) SIM (Set Interrupt Mask):
SIM is used to set the interrupt mask bits and serial output data bit.
It enables or disables the RST7.5, RST6.5, and TRAP interrupts.
(ii) RIM (Read Interrupt Mask):
RIM is used to read the status of the interrupt system.
It loads various registers with information about the status of interrupt-related
flags, such as the status of the interrupt lines, serial input data, and the status of
the SID (Serial Input Data) and SOD (Serial Output Data) pins.
Explanation:
1. Initialization:
MOV C, #00H: Initialize the port C value to 00H.
MOV B, #01H: Initialize the increment value to 01H.
2. Triangular Wave Generation Loop (TRIANGLE):
OUT C0H: Output the current value to port C0H, generating a triangular wave.
INX C: Increment the port C value.
CMP B, #0AH: Compare the current increment value with 10.
JZ REVERSE: If equal, jump to the REVERSE label.
3. Reverse Direction (REVERSE):
DCX C: Decrement the port C value.
CMP B, #01H: Compare the current decrement value with 1.
JZ TRIANGLE: If equal, jump back to the TRIANGLE label.
JMP REVERSE: Jump back to the REVERSE label.
In the implicit addressing mode, the operand is implied or understood, and no explicit address or
operand is specified in the instruction. The instruction implicitly operates on some predefined
data or register. Example: Consider the HLT instruction in the Intel 8085 assembly language. It
is an example of the implicit addressing mode. The HLT instruction stands for Halt, and it
doesn't require any operand. It implicitly instructs the microprocessor to halt its operation.
In register indirect addressing mode, the effective address of the operand is held in a register.
The instruction specifies the register, and the data at the memory location pointed to by that
register is the operand. Example: The MOV instruction can use register indirect addressing. For
instance, MOV A, M copies the content of the memory location pointed to by the HL register
pair into register A.
In direct addressing mode, the operand's address is directly specified in the instruction. The data
to be operated on is directly fetched from or stored to the specified memory address. Example:
The `LDA` (Load Accumulator) instruction in the Intel 8085 assembly language uses direct
addressing. It loads the accumulator with the data from a specific memory address. LDA 3000H;
Load the accumulator with the content at memory address 3000H (direct addressing)
Note that there are 5 addressing modes in 8085 make sure you know all 5 with examples:
immediate addressing mode, stack addressing mode etc.
10. With Aid Of A Block Diagram, Describe The Direct Memory Access (DMA) Method
Of Data Transfer.
Direct Memory Access (DMA) is a method of data transfer that allows peripheral devices to
access the system memory directly without the intervention of the CPU. This method is useful
for transferring large amounts of data between memory and peripheral devices, such as hard
drives, without burdening the CPU.
11. State Two Demerits If I/O-Mapped Input-Output Technique.
Limited Address Space: I/O-mapped I/O dedicates a specific address space for I/O operations.
This can limit the available address space for memory, especially in systems with a small address
range, potentially restricting the amount of addressable memory.
12. Describe each of the following tools used in assembly language programming:
(i) Assembler; (ii) Compiler.
(i) Assembler:
(ii) Compiler:
13. With Aid Of A Block Diagram, Describe The Operation Of A Signature Analyzer.
A signature analyzer is a device that is used to detect faults in digital circuits. It works by
converting a train of pulses at the test point into a recognizable form such as a hexadecimal
number, which is called a "signature". The signature analyzer then compares this signature with
the expected signature of a healthy circuit to identify the fault The block diagram of a signature
analyzer is shown below:
14. Write A Program To Test Ten RAM Memory Locations Starting At 4000 H
LXI H, 4000H ; Initialize HL register pair with the starting address (4000H)
TEST_LOOP:
MOV A, M ; Move the content of the memory location pointed to by HL into register A
CALL DISPLAY ; Call a subroutine to display the content of the memory location
Two control signals are used to request and acknowledge a DMA transfer in the microprocessor-
based system. The HOLD signal is a bus request signal which asks the microprocessor to
release control of the buses after the current bus cycle.
The HLDA signal is a bus grant signal which indicates that the microprocessor has indeed
released control of its buses by placing the buses at their high- impedance states.
Or you can say, two signals used in Direct Memory Access (DMA) are DMA request and DMA
acknowledge.
16. Draw A Flowchart For A Program That Adds Even Numbers Less Than 20 And
Outputs The Results At PORT 1.
17. State Two Defining Features Of Each Of The Following Input/Output (I/O)
Techniques: (I)Memory Mapped, (Ii) I/O Mapped
1. Address Space Integration: I/O devices share the same address space as memory.
Advantage: Simplifies addressing, as both memory and I/O devices use the same set of
addresses.
2. Read/Write Instructions: I/O operations are performed using regular load and store
instructions. Advantage: Uniformity in instruction set simplifies programming.
1. Separate Address Spaces: I/O devices have different address spaces from memory.
Advantage: Allows dedicated addressing for I/O operations, reducing potential conflicts.
2. Specialized I/O Instructions: Specific I/O instructions (IN and OUT) are used for data
transfer. Advantage: Provides different instructions for I/O operations, minimizing
confusion with memory operations.
18. Write An Intel 8085 Program To Perform The Following: 2789 + 3273
20. Write An Intel 8085 Program To Perform The Following: (00000110)2 × (1100)2
ORG 2000H ; Set the origin address to 2000H
Instruction Meaning
ADD A, D A + D to A (The results of regA and regD are
stored in regA)
MUL D A × D to A (The results of A multiplied by D
are kept in A)
MUL A A × A to A (Contents in A are multiplied by
contents in A and the results is kept in reg A)
MOV D, A A to D (contents in reg A are transferred to D)
MOV A, DATA DATA to A (Data is transferred to reg A)
END Halt program
ORG 2000H ; Set the origin address to 2000H
; Calculate x2
MUL A ; A × A to A
; Save x2 to register D
MOV D, A ; A to D
; Calculate x4
MUL D ; A × D to A
; Multiply x by 8
MUL B ; A × B to A
22. Write An Assembly Language Program, Using Stack Operations, To Exchange Data
Between Register Pairs BC And DE
PUSH B
PUSH C
PUSH D
PUSH E
POP E
POP D
POP C
POP B
Make sure you read more about stack operations: PUSH and POP
23. With the aid of a flowchart, write an assembly language program to search byte
'btey' from a block of consecutive memory locations, which is 256 bytes long, and
report the number of occurrences of the byte. The starting address of the memory
block is 2000h
MVI C, 04H ; Set the length of the search byte 'BTEY' (4 bytes)
SEARCH_LOOP:
CHECK_NEXT_BYTES:
CPI 'T' ; Compare with the second byte of the search byte
CHECK_THIRD_BYTE:
CPI 'E' ; Compare with the third byte of the search byte
CHECK_FOURTH_BYTE:
INCREMENT_COUNT:
NEXT_LOCATION:
JNZ SEARCH_LOOP ; Jump back to SEARCH_LOOP if there are more bytes to check
You can follow the guidelines of drawing a flowchart to draw the flowchart for the
program above.
24. List the purpose of signals INTA, INTR, IR0 to IR7 of the pins of 8085
microprocessor and a device each signal would be connected to.
INTA (Interrupt Acknowledge): Acknowledges the interrupt request from an external device.
Connected to an external interrupt controller (e.g., 8259) that manages multiple interrupt
sources.
INTR (Interrupt Request): Requests interrupt service from the microprocessor. Connected to
devices generating interrupts, such as peripheral devices requiring immediate attention.
IR0 to IR7 (Interrupt Request 0 to 7): Represent individual interrupt request lines for
prioritized interrupt handling. Connected to devices generating specific priority-level interrupts,
such as high-priority peripherals or external interrupt controllers.
Make sure to know the functions of all the 40 pins of the 8085.
25. State Two Tests That Can Be Carried Out On A Microprocessor System Using Each
Of The Following Equipment: Multimeter, Oscilloscope, Logic Analyzer
Multimeter:
1. Continuity Test:
Check for continuity in the power supply lines and ground connections on the
microprocessor system. Ensure that there are no open circuits or breaks in the
connections.
2. Voltage Measurement:
Measure the voltages at key points on the microprocessor board, such as power
supply pins and clock signal lines. Ensure that the voltages are within the
specified operating range.
Oscilloscope:
Logic Analyzer:
Performing these tests helps ensure the proper functioning of a microprocessor system,
identifying issues related to continuity, voltage levels, timing signals, and data integrity.
26. Outline The Checksum Method Of Testing A Microcomputer Random Access
Memory
To test a microcomputer random access memory (RAM) using the checksum method, the
following steps can be taken:
It can detect errors but does not provide a mechanism for correcting them. If a single-bit error
occurs, the checksum method can identify the discrepancy but lacks the ability to pinpoint and
correct the specific error.
28. The table below shows an 8085 assembly language program listing, draw a trace
table of the program execution.
A trace table records the state of registers and memory at each step of program execution.
|---------|-----------|---------|-------|-------|-------|-------|-------|-------|-------|--------|-------|
i. Schematic Capture:
31. Describe typical features of each of the following types of operating systems;
i. Real time
ii. Network
iii. Batch
Deterministic Response:
Provides predictable and guaranteed response times for critical tasks.
Task Scheduling:
Prioritizes and schedules tasks based on urgency.
Low Latency:
Minimizes response time to external events.
Concurrency:
Supports concurrent execution of real-time processes.
Distributed Computing:
Facilitates communication and resource sharing across a network.
User Authentication:
Manages user authentication and access control.
Resource Sharing:
Enables sharing of files and resources among networked computers.
Centralized Management:
Provides centralized tools for network administration.
Batch Processing:
Executes a series of jobs without manual intervention.
Job Scheduling:
Orders and schedules jobs based on priorities.
No User Interaction:
Operates without direct user interaction during execution.
Efficient Resource Utilization:
Maximizes resource utilization by processing multiple jobs sequentially.
32. Define each of the following with respect to microprocessors:
i. Bus
ii. Word length
ii. Word Length: The number of bits processed in parallel by a microprocessor in a single
operation or instruction. Example: A microprocessor with a 16-bit word length can process data
in 16-bit chunks in a single operation.
Role: Keeps track of the memory address of the next instruction to be fetched and
executed.
Function: Guides the microprocessor through the sequential execution of instructions in
a program.
Importance: Crucial for the flow control and sequencing of program execution.
ii. Accumulator:
Role: A register that performs arithmetic and logic operations, typically storing the
results temporarily.
Function: Central in arithmetic calculations, comparisons, and other mathematical
operations.
Importance: Often used as a primary working register for intermediate data storage
during computation.
Make sure you know how to describe all the registers of 8085
34. Four bytes of data are stored in consecutive memory locations 3500H to 3503H.
Write an assembly language program to add the data and store the result at
memory location 3504H to 3505H starting with the lower byte.
MVI H, 35H ; Initialize H register with the high byte of the source address
MVI L, 00H ; Initialize L register with the low byte of the source address
MVI H, 35H ; Initialize H register with the high byte of the destination address
MVI L, 04H ; Initialize L register with the low byte of the destination address
MOV M, L ; Store the lower byte of the result
35. The accumulator contains data CH4. Determine the contents of the accumulator
after each of the following shift operations:
(i) Arithmetic right shift;
(ii) Logical right shift
1. Initial State:
AH = C, AL = H
2. After Arithmetic Right Shift:
AH = E (shifted from C), AL = C (shifted from H)
3. Result:
Accumulator Contents: EC4
1. Initial State:
AH = C, AL = H
2. After Logical Right Shift:
AH = 6 (shifted from C), AL = 4 (shifted from H)
3. Result:
Accumulator Contents: 64
36. Describe the page zero addressing mode of microprocessors using an example
The zero page addressing mode is a type of addressing mode used in microprocessors. It is
used to specify an address in the first 256 bytes of RAM where data which has been loaded into a
specific register may be located
LDA $10 ; Load the accumulator with the content of memory location $0010 (page zero
addressing)
STA $20 ; Store the content of the accumulator into memory location $0020 (page zero
addressing)
38. With the aid of a flow chart describe handshaking input output data transfer
Handshaking is a method used to synchronize I/O devices with the microprocessor. It
involves exchanging signals between the I/O device and the microprocessor before data
transfer takes place.
The handshaking process involves two signals: data valid, which is created by the source
unit, and data accepted, created by the destination unit
39. State 2 reasons of disabling buffers when not in use
Signal Integrity: When buffers are not actively driving or receiving signals, leaving them
disabled prevents unnecessary loading or interference on the communication lines. This helps
maintain signal integrity by avoiding unintended effects such as reflections, crosstalk, or other
forms of signal degradation that might occur if the buffers were left active without a purpose.
40. With the aid of a diagram, describe the operation of tri-state buffer
A tri-state buffer is a digital circuit that can be in one of three states: high, low, or high
impedance (disconnected). It has three inputs: a data input, an enable input, and an output.
When the enable input is high, the output follows the data input.
When the enable input is low, the output is disconnected from the data input and goes into a
high-impedance state.
This allows multiple devices to share the same data bus without interfering with each other.
41. The table below shows instruction listing of a delay program. The clock frequency is
5 MHz
Label Mnemonic T-States
LXI B, 10
1000H
LOOP DCX B 6
XTH L 16
XTH L 16
NOP 4
NOP 4
MOV A, B 4
ORA C 4
JNZ LOOP 10/7
HLT 5
Determine the:
i. Program delay time;
ii. Number of memory locations occupied by the machine code program
42. State 4 functions of interface modules of a microprocessor system
Signal Conversion: Interface modules convert signals between the microprocessor and
external devices, ensuring compatibility between different voltage levels and communication
protocols.
Data Buffering: They provide buffering functions to isolate and stabilize data flow,
preventing signal degradation and ensuring reliable communication between the
microprocessor and peripherals.
Control and Timing: Interface modules manage control signals and timing synchronization,
facilitating coordinated interactions between the microprocessor and connected devices.