8085 Microprocessor Programs Courtesy : www.8085projects.info Rachit Agrawal 07-CE-52 Kalol Institute of Technology & Research Center
PROGRAMS FOR 8085 MICROPROCESSOR PROGRAMS FOR LEARNERS 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Store 8-bit data in memory Exchange the contents of memory locations Add two 8-bit numbers Subtract two 8-bit numbers Add two 16-bit numbers Add contents of two memory locations Subtract two 16-bit numbers. Finding one's complement of a number Finding Two's complement of a number Pack the unpacked BCD numbers Unpack a BCD number Execution format of instructions Right shift bit of data Left Shifting of a 16-bit data Alter the contents of flag register in 8085 PROGRAMS FOR BEGINNERS 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. Calculate the sum of series of numbers Multiply two 8-bit numbers Divide a 16 bit number by a 8-bit number Find the negative numbers in a block of data. Find the largest of given numbers Count number of one's in a number Arrange in ascending order Calculate the sum of series of even numbers Calculate the sum of series of odd numbers Find the square of given number Search a byte in a given number Add two decimal numbers of 6 digit each Add each element of array with the elements of another array Separate even numbers from given numbers Transfer contents to overlapping memory blocks PROGRAMS FOR TRAINEES 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. Add parity bit to 7-bit ASCII characters Find the number of negative, zero and positive numbers Inserting string in a given array of characters Deleting string in a given array of characters Multiply two eight bit numbers with shift and add method Divide 16-bit number with 8-bit number using shifting technique Sub routine to perform the task of DAA Program to test RAM Program to generate fibonacci number Generate a delay of 0.4 seconds Arrange in DESCENDING Order Data transfer from one memory block to other memory block. Find the factorial of a number Find the Square Root of a given number Split a HEX data into two nibbles and store it
46. 47. 48. Add two 4-digit BCD numbers Subtraction of two BCD numbers Multiply two 2-digit BCD numbers PROGRAMS FOR EXPERTS a.PROGRAMS TO WORK WITH COUNTERS 49. 50. 51. 52. 53. Generate and display binary up counter Generate and display BCD up counter with frequency 1Hz Generate and display BCD down counter Generate and display the contents of decimal counter Debug the delay routine b.PROGRAMS IN CODE CONVERSION 2-Digit BCD to binary conversion. 54. 55. Binary to BCD conversion Find the 7-segment codes for given numbers 56. 57. Find the ASCII character 58. ASCII to Decimal Conversion 59. HEX to Decimal conversion 60. HEX to binary conversion c.PROGRAMS IN INTERFACING & APPLICTIONS I. Interfacing with IC 8251(Serial Communcation/USART) Output byte from SOD pin 61. 62. Generate square wave from SOD pin 63. Receive ASCII character through SID pin 64. Transmit message using 8251 65. Receive message using 8251 II. Interfacing with IC 8255( Programmable Periperal Interface - PPI) 66. Initialize 8255 67. Blink port C bit 0 of 8255 68. Flashing of LEDs 69. Traffic Light Control 70. Stepper Motor Control 71. Keyboard interface(64-key-matrix-keyboard) 72. Seven Segment Display Interface (Eight Digits) III. Interfacing with IC 8279 (Keyboard and Display Controller) 73. 8 x 8 Keyboard Interface(Without Interrupt signal) 74. 8 x 8 Keyboard Interface(With Interrupt signal) 75. 8 x 4 Matrix Keyboard Interface 76. Interfacing of eight 7-segment digits 77. Interfacing of 4x4 matrix keyboard and 4 digit 7 segment display 78. Roll a message - 'HELL0123' 79. Roll your NAME
1 Statement: Store the data byte 32H into memory location 4000H. Program 1: MVI A, 52H STA 4000H HLT : Store 32H in the accumulator : Copy accumulator contents at address 4000H : Terminate program execution Program 2: LXI H MVI M (4000H) HLT : Load HL with 4000H : Store 32H in memory location pointed by HL register pair : Terminate program execution The result of both programs will be the same. In program 1 direct addressing instruction is used, whereas in program 2 indirect addressing instruction is used. 2 Statement: Exchange the contents of memory locations 2000H and 4000H Program 1: LDA 2000H MOV B, A LDA 4000H STA 2000H MOV A, B STA 4000H Program 2: LXI H 2000H location 2000H. LXI D 4000H location 4000H. MOV B, M register. LDAX D MOV M, A 2000H. MOV A, B STAX D 4000H. HLT : Get the contents of memory location 2000H into accumulator : Save the contents into B register : Get the contents of memory location 4000Hinto accumulator : Store the contents of accumulator at address 2000H : Get the saved contents back into A register : Store the contents of accumulator at address 4000H : Initialize HL register pair as a pointer to memory : Initialize DE register pair as a pointer to memory : Get the contents of memory location 2000H into B : Get the contents of memory location 4000H into A register. : Store the contents of A register into memory location : Copy the contents of B register into accumulator. : Store the contents of A register into memory location : Terminate program execution. In Program 1, direct addressing instructions are used, whereas in Program 2, indirect addressing instructions are used.