Mi 013846
Mi 013846
Winter 2021
Q-1 (b) explain pins of 8o85 microprocessor.
The input/output port addresses are 8 The input/output port addresses are
bits. 16 bits.
It is a comparatively High-cost
It is a low-cost Microprocessor
Microprocessor.
So, to summarize:
Again, please note that these values can vary depending on the specific microprocessor
architecture and clock speed. Always refer to the processor's datasheet or technical
documentation for precise timing information.
(ii) RAL
RAL stands for Rotate Accumulator Left through Carry. It is an
instruction used in assembly language programming for certain
microprocessors, particularly those from the Intel 8080 family.
So, to summarize:
• The program starts by loading the HL register pair with the starting address for
positive values (5100H) and the DE register pair with the starting address for
negative values (5200H).
• It then initializes the loop counter using register C with the value 0AH,
representing the total number of values to be processed.
• The program iterates through each memory location, checking if the value is
positive or negative based on the most significant bit (MSB). If it's positive, it
adds the value to the accumulator. If it's negative, it skips to the next memory
location.
• After processing all values, the result is stored in memory location 5300H.
• Finally, the program halts its execution.
(i) CALL
The CALL instruction is used in assembly language programming to implement
subroutines or functions. It is typically found in microprocessor architectures like the
Intel 8085. The CALL instruction is used to transfer control from the main program to a
subroutine or a specific memory address. After executing the subroutine, the control is
transferred back to the instruction following the CALL instruction.
Here's an explanation of the CALL instruction along with the associated machine cycles
and T states required for its execution:
So, to summarize:
Please note that these values can vary depending on the specific microprocessor
architecture and clock speed. Always refer to the processor's datasheet or technical
documentation for precise timing information.
(ii) CPI
The CPI (Compare Immediate) instruction is used in assembly language programming to
compare the contents of the accumulator register with an immediate 8-bit data value. It
is commonly found in microprocessor architectures such as the Intel 8085.
Here's an explanation of the CPI instruction along with the associated machine cycles
and T states required for its execution:
1. Function: The CPI instruction compares the contents of the accumulator register
with an immediate 8-bit data value provided as part of the instruction. It sets or
clears various condition flags in the flag register based on the result of the
comparison. Commonly used flags include the zero flag (Z), carry flag (CY), and
sign flag (S).
2. Number of Bytes: The CPI instruction typically takes 2 bytes of memory to store
the opcode and the immediate 8-bit data value.
3. Machine Cycles: The number of machine cycles required for execution of the CPI
instruction depends on the specific processor and its clock speed. In general, the
CPI instruction typically takes 2 machine cycles to execute.
4. T States (Timing States): Timing states represent the smallest unit of time in the
processor's execution cycle. The number of T states required for the CPI
instruction also varies depending on the processor. For example, in the Intel 8085
microprocessor, the CPI instruction typically takes 7 T states to execute.
So, to summarize:
• Number of Bytes: 2 bytes
• Machine Cycles: 2 cycles
• T States: Typically 7 T states
Please note that these values can vary depending on the specific microprocessor
architecture and clock speed. Always refer to the processor's datasheet or technical
documentation for precise timing information.
JMP STORE ; If all values are compared, store the largest value
1. `MVI C, 7FH`: This instruction loads the value 7FH (0111 1111 in
binary) into register C.
2. `MVI B, 3EH`: This instruction loads the value 3EH (0011 1110 in
binary) into register B.
So, the final value in the accumulator after executing the program is
0111 1001 (79H).
- Clock cycles: 10
- Clock cycles: 6
- Clock cycles: 5
- Clock cycles: 4
5. `JNZ NEXT`: This instruction jumps to the label NEXT if the Zero
flag is not set.
- Clock cycles: 10 (if jump occurs), 7 (if jump does not occur)
Now, let's calculate the total delay:
- If the jump occurs (meaning the Zero flag is not set), it will take an
additional 10 clock cycles.
- If the jump does not occur (meaning the Zero flag is set), it will take
an additional 7 clock cycles.
You can calculate these values to get the delay in seconds or you can
convert it to other time units based on your requirements.
1. `MVI A, 07H`: This instruction loads the immediate value 07H into
the accumulator.
So, the final value in the accumulator after executing the program is
0111 1110 (7EH).
Q-4(b) Write an 8085 assembly language program to
convert a two-digit BCD number into its equivalent
hexadecimal number.
MVI A, 00H ; Initialize accumulator to store the converted
hexadecimal number
LXI D, 8000H ; Load the memory address where the BCD number
is stored
; Combine the converted tens and units place digits to form the
hexadecimal number
2. **T-state**:
3. **JC**:
4. **CMP**:
5. **RET**:
6. **SBB**:
7. **STC**:
COPY_LOOP:
1. **PUSH**: The PUSH instruction is used to add data onto the stack.
It first decrements the stack pointer (ESP in x86 architecture) to
reserve space for the new data, and then copies the specified data onto
the stack. In other words, PUSH "pushes" a value onto the stack.
LOOP:
SKIP:
DELAY:
DELAY_LOOP:
```
211 = 2048 memory locations are required because 2KB is equal to 211
bytes.
MOV A, #01H ; If sum is greater than FFH, load 01H into accumulator
A
DISPLAY_SUM:
```
This program loads the hexadecimal numbers 56H and A9H into
registers D and E, respectively. Then, it adds them together. If the sum
is greater than FFH, it outputs 01H to PORT0; otherwise, it outputs the
sum.
- ALE is used to latch the address present on the address bus into
external latches, such as those used by memory or I/O devices.
- It ensures that the data is stable and can be read by external devices
connected to the microprocessor.
1. **Minimum Mode**:
- Key features:
- Single master: The 8086 acts as the master on the bus, meaning it
initiates and controls all data transfers.
- Key features: