0% found this document useful (0 votes)
23 views2 pages

8086 Microprocessor Programming Guide

Uploaded by

ABESH Meena
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

8086 Microprocessor Programming Guide

Uploaded by

ABESH Meena
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

INDIAN INSTITUTE OF INFORMATION TECHNOLOGY, BHOPAL

Microprocessors and Microcontrollers

TUTORIALS
1. Write difference between machine language and assembly languages.
2. Write assembly language program to add two 32-bit numbers.
3. Write an assembly language program for 2’s compliment of a 16-bit number stored in AX register. Store the output in BX
register.
4. Assume register B holds 93H and the accumulator holds 15H. Illustrate the results of the instructions ORA B.
5. Determine the physical address when CS=5300H and IP=0200H. Write the starting and ending address of the code segment.
6. Assume that the accumulator contains data byte 82H, and the instruction MOV C,A (4FH) is fetched. List the steps in
decoding and executing the instruction.
7. Determine the physical address when ES is 6500H and offset address is 4767H.
8. A register B has 65H and the accumulator has 97H. Subtract the content of register B from the contents of the accumulator.
9. Write assembly language program for the addition of two 16 bit numbers with 16 bit sum using 8085 microprocessor.
10. Write assembly language program to shift an 8 bit number left by one bit using 8085 microprocessor.
11. Write assembly language program to arrange a series of numbers in descending order using 8085 microprocessor.
12. Write assembly language program to transfer a block of data from one section of memory to the other section of memory
using 8085 microprocessor.
13. Write assembly language program to decide whether the parity of a given number is even or odd using 8086 microprocessor.
If parity is even set DL to 00; else, set DL to 01. The given number may be a multibyte number.
14. Write assembly language program to shift an 8 bit number left by one bit using 8086 microprocessor.
15. Write assembly language program for the addition of two 3x3 matrices using 8086 microprocessor. The matrices are stored
in the form of lists (row wise). Store the result of addition in the third list.
16. Write assembly language program to convert an 8 bit binary number in to equivalent gray code using 8086 microprocessor.
17. Calculate the execution time of an 8085 instruction that takes 12 T-states on a 3 MHz processor.
18. If an 8085 system operates at 4 MHz, determine the time taken to execute an instruction of 18 T-states.
19. Compute the memory address range for a 4 KB memory module connected to 8085 at address 2000H.
20. Determine the physical address of data stored at memory location 5000H in an 8085-based system.
21. A microprocessor-based system requires 64 KB of memory. How many 16 KB ROM and 8 KB RAM chips are needed?
22. If an instruction in 8086 requires 6 clock cycles and the system runs at 10 MHz, compute the execution time.
23. A program requires 5000 clock cycles to execute on an 8086-system running at 5 MHz. Determine the execution time.
24. Compute the number of instructions executed per second for an 8086 processor running at 16 MHz with an average of 5
clock cycles per instruction.
25. An 8086-based system has a bus cycle time of 200 ns. Compute the maximum data transfer rate if each transfer takes 4
cycles.
26. If a loop in 8086 iterates 1000 times and each iteration takes 10 cycles, calculate the total execution time for a 10 MHz
processor.
27. An 8086-based system has an interrupt latency of 10 µs. Compute the maximum interrupt frequency that can be handled.
28. If an 8237 DMA controller transfers 512 bytes in 1.5 ms, calculate the data transfer rate.
29. Determine the interrupt service time if an interrupt request is acknowledged in 4 cycles, and the service routine takes 20
cycles to execute at 8 MHz.
30. If a DMA operation transfers 4 KB of data in 2 ms, calculate the bandwidth of data transfer.
31. Compute the maximum number of interrupts per second that can be processed if an interrupt routine takes 40 clock cycles
and the system runs at 8 MHz.
32. Design an 8086-based system with 4 MB of memory and explain its memory addressing.
33. Compute the size of the stack segment required for 500 nested function calls, each using 10 bytes.
34. If an interrupt-driven system has an average interrupt frequency of 1000 Hz, compute the CPU utilization for interrupts if
each service routine takes 1000 cycles on a 10 MHz system.
35. An 8259 PIC services 15 external devices. Compute the interrupt response time if the interrupt vector fetch takes 5 clock
cycles.
36. Compute the instruction throughput for an 8086 processor running at 20 MHz, assuming an average of 4 cycles per
instruction.
37. Write an 8085 assembly language program to convert a BCD number to binary
38. Convert the decimal number 285 into its equivalent binary, octal, and hexadecimal representations.
39. If the clock frequency of 8085 is 3 MHz, calculate the time taken for one T-state.
40. An 8085 microprocessor executes a MOV B, C instruction in 4 T-states. Calculate the execution time if the clock frequency
is 5 MHz.
41. Determine the memory size in KB for a system with a 16-bit address bus.
42. An instruction takes 3 machine cycles (M1, M2, M3) with 4, 3, and 3 T-states, respectively. If the clock frequency is 2 MHz,
calculate the total execution time.

1
43. Find the effective address if the instruction LXI H, 2500H is executed.
44. A stack pointer contains 5000H, and a PUSH operation is performed. What will be the new stack pointer value?
45. Write an 8085 assembly language program to divide an 8-bit number by 2 without using the division instruction.
46. Calculate the delay generated by an 8085 instruction sequence consisting of multiple NOP instructions if the clock frequency
is 3 MHz.
47. A subroutine is called, and the stack pointer is at 4000H. After executing the subroutine, the stack pointer is 4002H. How
many bytes were pushed onto the stack?
48. If an 8086 operates at 8 MHz, calculate the duration of one clock cycle.
49. Find the physical address when the segment register is 2000H and the offset is 1234H.
50. How much memory can be addressed by an 8086 microprocessor in real mode?
51. If an 8086 instruction takes 6 clock cycles and the processor runs at 5 MHz, calculate the execution time of the instruction.
52. Compute the total memory required for an 8086 system with 128 KB RAM and 64 KB ROM.
53. If the stack segment is 3000H, and SP is FFFEH, what will be the stack pointer after a PUSH AX operation?
54. Calculate the total number of bytes transferred in a string operation (MOVS) for CX = 100H.
55. Write an 8086 assembly language program to multiply two 16-bit numbers.
56. If an 8086 instruction takes 5 T-states, how long will it take to execute at a 10 MHz clock speed?
57. The instruction MOV AL, [BX+SI] takes 7 T-states. Compute the execution time if the clock frequency is 8 MHz.
58. If an 8255 PPI is operating in Mode 1, calculate the total input-output lines available.
59. If the 8253 timer operates at 1 MHz and the initial count is 5000, calculate the output pulse period.
60. The 8259 PIC is cascaded with two other 8259s. Find the total number of interrupt vectors generated.
61. Calculate the baud rate for 8251 USART if the clock frequency is 1.8432 MHz and the divisor is 16.
62. An 8257 DMA controller is transferring 256 bytes of data per block. Calculate the total time required if the transfer rate is 5
MB/s.
63. Compute the clock pulses required for a single conversion in an ADC0808 operating at 640 kHz.
64. Determine the DAC output voltage if the reference voltage is 5V, and the digital input is 10101010 (170 in decimal) for an 8-
bit DAC.
65. An 8255 operates with Port A in Mode 0 and requires 5 instructions to transfer one byte. Calculate the time taken to transfer
1000 bytes at a 2 MHz clock frequency.
66. An 8253 timer is programmed in Mode 2, and the clock input is 1 MHz. If the counter value is 200, compute the frequency
of the output waveform.
67. Compute the total number of memory chips required to design a 64 KB memory system, assuming each chip is 8 KB.
68. A microprocessor-controlled temperature monitoring system requires 50 samples per second from an ADC. Calculate the
total data acquired in 1 minute.
69. In a stepper motor control system, the motor requires 200 steps per revolution. Calculate the step angle.
70. A microprocessor-based traffic light system operates with a cycle time of 60 seconds. If each state (Red, Green, Yellow)
runs sequentially, determine the ON time for each light.
71. Calculate the resolution of a 10-bit ADC with a reference voltage of 5V.
72. If a temperature sensor outputs 0.01V per degree Celsius, determine the digital output for 30°C using an 8-bit ADC with a
5V reference.
73. Calculate the sampling rate required for an ADC to digitize a 1 kHz analog signal without aliasing.
74. A 16-bit DAC operates with a 10V reference voltage. Calculate the minimum voltage step size.
75. If an 8051 microcontroller-based DC motor control system operates at 10 Hz PWM frequency, determine the duty cycle
required for 75% speed.
76. Calculate the data transfer rate in a microprocessor-based serial communication system with a baud rate of 9600.
77. In an 8051-based stepper motor driver, each pulse moves the motor by 1.8°. Calculate the total pulses required for one
complete rotation.
78. If a Pentium processor has a clock speed of 100 MHz, calculate the execution time for a 10-cycle instruction.
79. Compute the cache size required for a system with 256 KB direct-mapped cache and a block size of 64 bytes.
80. An 80486 processor has a 2-stage cache. If the cache miss penalty is 10 cycles, calculate the effective memory access time.
81. If a Pentium processor can execute 2 instructions per clock cycle, calculate the maximum instructions executed per second at
200 MHz.
82. Compute the addressable memory for a 64-bit processor.
83. If an 80286 operates at 10 MHz, determine the minimum instruction execution time.
84. A Pentium system has a 4-way set-associative cache with 16 KB size. Calculate the number of cache blocks.
85. Calculate the delay generated by Timer 1 in 8051 for Mode 2 with TH1 = 250 and a 12 MHz clock.
86. Compute the total number of external interrupts handled by the 8051.
87. Find the time taken to execute an 8051 instruction with 12 T-states at 11.0592 MHz.
88. Compute the PWM resolution for an 8-bit 8051 timer.
89. An 8051 UART operates at 4800 baud. Calculate the time for one bit transmission.
90. Compute the size of the stack segment required for 500 nested function calls, each using 10 bytes.

Common questions

Powered by AI

The execution time of instructions in microprocessors is affected by the clock frequency and the number of clock cycles (T-states) an instruction takes. To calculate the execution time, you can use the formula: Execution Time = (Number of Clock Cycles) / (Clock Frequency). For example, if an 8085 instruction requires 12 T-states on a 3 MHz processor, the execution time is 12 / 3,000,000 = 4 microseconds . For an 8086 instruction taking 6 clock cycles on a 10 MHz system, the execution time is 6 / 10,000,000 = 0.6 microseconds .

Machine language consists of binary code that a computer's central processing unit (CPU) can execute directly, whereas assembly language is a low-level programming language that uses symbolic code, which is easier for humans to read and write. Assembly language must be translated into machine language using an assembler before execution. Thus, machine language is the native language of the microprocessor, while assembly language serves as an intermediary step with human-readable instructions .

To calculate the execution time for a loop, multiply the number of cycles per iteration by the total number of iterations, then divide by the clock speed. In an 8086 processor, if a loop iterates 1000 times with each iteration taking 10 cycles, the total cycles are 1000 * 10. With a 10 MHz clock speed, the execution time is (1000 * 10) / 10,000,000 = 1 millisecond. This calculation is significant for optimizing performance and understanding the time complexities involved in loop operations .

In the 8086 microprocessor, the physical address can be determined using the formula: Physical Address = (Segment * 10H) + Offset. For example, if the segment register is 2000H and the offset is 1234H, the physical address is calculated as (2000H * 10H) + 1234H = 20000H + 1234H = 21234H .

To compute the memory address range for a 4 KB module starting at address 2000H, add the size of the module to the starting address. Since 1 KB is 1024 bytes, 4 KB is 4096 bytes. Thus, the memory range is from 2000H to 2000H + 1000H = 3000H (exclusive). This calculation is crucial for memory mapping and ensuring non-overlapping address spaces in a microprocessor-based system .

The operation mode of the 8255 PPI determines how the I/O ports behave. In Mode 1, ports A and B are defined as input/output ports with handshaking capabilities. Each port can be configured independently for input or output. Mode 1 provides additional control lines for handshaking purposes, enhancing data transfer synchronization. The available I/O lines are defined based on the configuration, allowing for efficient data management with input-output operations facilitated by control signals .

NOP (No Operation) instructions are used in timing loops to generate precise delays in microprocessor operations. The delay generated by a sequence of NOP instructions depends on the number of NOPs and the clock frequency. Each NOP instruction typically takes 4 T-states. At a 3 MHz clock frequency, the time for one T-state is 1 / 3,000,000 seconds. Therefore, the delay for a sequence of x NOP instructions is calculated as 4 * x / 3,000,000 seconds .

In an 8086 assembly language program, a parity check determines if the number of set bits (1s) in a byte is even or odd. This can be implemented by successively shifting the bits of the byte and using an XOR operation to accumulate the parity. The routine typically sets a status register or a designated memory location based on the parity; for even parity, a certain value is set, and for odd parity, another value is used. To perform this check, loop through the bits using shift operations, using a counter to toggle the expected result .

Decoding a MOV instruction involves first fetching the instruction from the memory into the instruction queue. The opcode is then interpreted by the control unit to determine that data transfer is needed. The operands are next identified from the instruction and their addresses calculated. Execution then involves moving data from the source to the destination. This step-by-step process ensures that the correct data is manipulated, valuable for understanding instruction pipelining and the functioning of CPUs under different instructions .

An 8085 microprocessor with a 16-bit address bus can address up to 2^16, which equals 65,536 individual address locations, or 64 KB. This defines the upper limit of addressable memory in its architecture. For system design, this implicates that all peripheral and main memory modules must be confined within this 64 KB range, influencing system expansion capabilities and design strategies for efficient memory utilization .

You might also like