Found 558 Articles for Microprocessor

8085 program to find maximum and minimum of 10 numbers

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

1K+ Views

In this program we will see how to find the maximum and minimum number in a block data.Problem StatementWrite 8085 Assembly language program to find the maximum and minimum number in a block often 8-bit numbers.DiscussionIn this program we are taking the first number of the block into register D and E. The D will store the minimum number, and E will store maximum number. In each iteration we will check whether the number is smaller than D or not, if it is smaller, then update D with the new number, and then compare it again with E to check ... Read More

8085 program to check whether the given number is even or odd

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

8K+ Views

In this program we will see how to check whether a number is odd or even.Problem StatementWrite 8085 Assembly language program to check whether a number is odd or even.DiscussionThe Odd Even checking is very simple. we can determine one number is odd or even by checking only the LSb. When LSb is 1, the number is odd, otherwise it is even.In this program we are taking a number from memory and then ANDing 01H with it. if the result is nonzero, then the number is odd,  otherwise it is even.Inputfirst inputAddressData......800015......second inputAddressData......80002C......Flow DiagramProgramAddressHEX CodesLabelMnemonicsCommentsF0003A, 00, 80LDA 8000HLoad the number ... Read More

8085 program to find 2's complement of the contents of Flag Register

Anvi Jain
Updated on 30-Jul-2019 22:30:24

332 Views

In this program we will see how to find 2's complement of the content of flag register.Problem StatementWrite 8085 Assembly language program to find 2's complement of the content of flag register.DiscussionWe cannot access the total flag register directly. To use them we have to push the PSW(Accumulator-Flag) into stack, and then pop it to another register pair, then after complementing the LS byte of that register pair, we have to push it again into the stack, and then pop it to PSW  to get it into Flag bits.InputHere we are not putting any input directly. If the flag bits ... Read More

8085 program to find 1's and 2's complement of 16-bit number

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

2K+ Views

In this program we will see how to find 1's complement and 2's complement of a 16-bit number.Problem StatementWrite 8085 Assembly language program to find 1's complement and 2's complement of a16-bit number stored in 8000H and 8001H.Discussion8085 has an instruction CMA. This instruction complements the content of Accumulator. For 1's complement CMA instruction is sufficient, and for 2's complement we have to increase the number by 1 after complementing.For 16-bit number, we are taking the number into HL pair, but for complementing we have to copy the numbers to Accumulator from H and L one by one. Then by ... Read More

8085 program to find 1's and 2's complement of 8-bit number

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

6K+ Views

In this program we will see how to find 1's complement and 2's complement of an 8-bit number.Problem StatementWrite 8085 Assembly language program to find 1's complement and 2's complement of a number stored in 8000H.Discussion8085 has an instruction CMA. This instruction complements the content of Accumulator. For 1's complement CMA instruction is sufficient, and for 2's complement we have to increase the number by 1 after complementing.We are taking the number from 8000H and storing the 1's complement at location 8050H, and 2's complement to 8051H.InputAddressData......8000AB......Flow DiagramProgramAddressHEX CodesMnemonicsCommentsF0003A, 00, 80LDA 8000HLoad the number from memoryF0032FCMAComplement the accumulatorF00432, 50, 80STA ... Read More

8085 program to count total even numbers in series of 10 numbers

Anvi Jain
Updated on 30-Jul-2019 22:30:24

860 Views

In this program we will see how to count number of even numbers in a block of elements.Problem StatementWrite 8085 Assembly language program to count number of even numbers in a block of data, where the block size is 10D. The block is starting from location8000H.DiscussionThe Odd Even checking is very simple. we can determine one number is odd or even by checking only the LSb. When LSb is 1, the number is odd, otherwise it is even. In this program we are taking a number from memory and then ANDing01H with it. if the result is nonzero, then the ... Read More

8085 program to count number of once in the given 8-bit number

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

778 Views

In this program we will see how to count number of 1's in an 8-bit number.Problem StatementWrite 8085 Assembly language program to count number of 1s in 8-bit number stored atlocation 8000H.DiscussionIn this program we areusing the rotate operation to count the number of 1's. As there are8 different bits in 8-bit number, then we are rotating the numbereight times. we can use RRC or RLC. Here we have used the RRCinstruction. This instruction sends the LSb to MSb also to carryflag. So after each iteration we can check the carry status to getthe count of 1s.If the number is ... Read More

8085 program to find the sum of first n natural numbers

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

2K+ Views

In this program we will see how to add first n natural numbers.Problem StatementWrite 8085 Assembly language program to add first N natural numbers. The value of N is provided.DiscussionWe are getting the value of N from memory location 8000H. We are using the number N as count variable, in each step we are calculating (A + Count) value, and store them into A. After adding them, the count value is decreased, thus the total series is completed.If the number is 23H(35D), then the sum will be (35*36)/2 = 630 (276H)InputAddressData......800023......Flow DiagramProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 00, 80LXI H, 8000HPoint to get the ... Read More

8085 program to find sum of digits of 8 bit number

Rishi Rathor
Updated on 30-Jun-2020 05:01:51

776 Views

In this program we will see how to add the digits of an 8-bit number.Problem StatementWrite 8085 Assembly language program to add the digits of an 8-bit number stored in memory location 8000H.DiscussionTo get the digits of an 8-bit number, we can use the masking operation. At first we will mask the upper nibble, and then the lower nibble. After masking the lower nibble, we have to rotate it to the right to make it least significant nibble. Then we can simply add it to the stored nibble to get the sum.InputAddressData......80008A......ProgramAddressHEX CodesMnemonicsCommentsF0003A, 00, 80LDA 8000HLoad the number into AF0034FMOV ... Read More

8085 program to add 2-BCD numbers

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

4K+ Views

In this program we will see how to add two 8-bit BCD numbers.Problem StatementWrite 8085 Assembly language program to add two 8-bit BCD number stored in memory location 8000H – 8001H.DiscussionThis task is too simple. Here we are taking the numbers from memory and after adding we need to put DAA instruction to adjust the accumulator content to decimal form. The DAA will check the AC and CY flags to adjust a number to its decimal form.InputAddressData......800099800125......Flow DiagramProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 00, 80LXI H, 8000HPoint to first operandF0037EMOV A, MLoad A with first operandF00423INX HPoint to next operandF00586ADD MAdd Acc and memory ... Read More

Advertisements