Found 409 Articles for Microcontroller

8086 program to generate AP series of n numbers

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

482 Views

In this program we will see how to find AP series using 8086.Problem StatementWrite 8086 Assembly language program to find AP series. The limit of the series is stored at 500, First term is stored at 501, and the common difference is stored at 502.DiscussionAP generation is simple task. We are taking the limit as counter value, the first term is loaded into AL first, then the BL is holding the common difference d. Now the result is storing memory offset 600 onwards. The AL is placing as it is, then repeatedly add BL with AL and store it into ... Read More

8086 program to find sum of digits of 8 bit number

Chandu yadav
Updated on 30-Jul-2019 22:30:26

1K+ Views

In this program we will see how to add the digits of an 8-bit number.Problem StatementWrite 8086 Assembly language program to add the digits of an 8-bit number stored in memory address 2000H.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 upper 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……20008A…… Flow Diagram ProgramOutputAddressData……200112……      

8086 program to determine sum of corresponding elements of two arrays

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

2K+ Views

Here we will see how to find sum of two array elements and store result into memory.Problem StatementWrite 8086 Assembly language program to find summation of two arrays stored at 501 onwards and 601 onwards. The size of array is stored at location 500. After calculating the sum results are store result at 501 onwards.DiscussionTo solve this problem, we are taking elements from first array using source register SI, and second array using destination register DI. Repeatedly take elements from SI to AL, then add with the content of DI, and store again into SI address. Thus it is solved.InputAddressData……500055012C5020B5037D5042550521……601BA6024560369604CA60595…… Flow ... Read More

8086 program to determine squares of numbers in an array of n numbers

George John
Updated on 30-Jul-2019 22:30:26

2K+ Views

In this program we will see how to find the squares of n numbers stored in an array.Problem StatementWrite 8086 Assembly language program to calculate square of each numbers stored in an array of size n. The array size is stored at location offset 600, and Numbers are stored at 601 onwards.DiscussionTo solve this problem, we are taking the size of the array into the CL register, and make CH = 00H for counting. Now from each location take the number into accumulator, to make square, we have to multiply it two times. so we are multiplying AL with AL. ... Read More

8086 program to determine product of corresponding elements of two array elements

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

362 Views

Here we will see how to find product of two array elements and store result into memory.Problem StatementWrite 8086 Assembly language program to find product of two arrays stored at 501 onwards and 601 onwards. The size of array is stored at location 500. After calculating product store result at 501 onwards.DiscussionTo solve this problem, we are taking elements from first array using source register SI, and second array using destination register DI. Repeatedly take elements from SI to AL, then multiply with the content of DI, and store again into SI address. Thus it is solved.InputAddressData……500055012C5020B5037D5042550521……6010460212603026040460505…… Flow Diagram ProgramOutputAddressData……501B0502C6503FA504B9505A5……    Read More

8086 program to determine cubes of numbers in an array of n numbers

Chandu yadav
Updated on 30-Jul-2019 22:30:26

979 Views

In this program we will see how to find the cubes of n numbers stored in an array.Problem StatementWrite 8086 Assembly language program to calculate cubes of each numbers stored in an array of size n. The array size is stored at location offset 600, and Numbers are stored at 601 onwards.DiscussionTo solve this problem, we are taking the size of the array into the CL register, and make CH = 00H for counting. Now from each location take the number into accumulator, to make cube, we have to multiply it three times. so we are storing the number temporarily ... Read More

8085 program to find the sum of series of even numbers

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

1K+ Views

In this program we will see how to find the sum of all even numbers.Problem StatementWrite 8085 Assembly language program to find sum of all even numbers stored in an array. The size of the array is stored at location F100; the numbers are stored from memory location F101 onwards. The result will be stored at F150.DiscussionTo check whether a number is odd or even, we can to AND operation. If a number is odd, then it will contain 1 as LSb, for even LSb will be 0. So after AND operation if the result is 0, then it is ... Read More

8085 program to find the element that appears once

George John
Updated on 30-Jul-2019 22:30:26

284 Views

In this program we will see how to find a number who appears only once in an array of elements.Problem StatementWrite 8085 Assembly language program to find a number who appears only once in an array of elements. The size of the array is stored at location F100; the numbers are stored from memory location F101 onwards. The result will be stored at F150.DiscussionThe logic behind this problem is simple. Though it may find some wrong results in some cases. It can find the number if there is only one number which is appeared once, and rest of the numbers ... Read More

8085 program to divide two 16 bit numbers

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

2K+ Views

Here we will see how to divide two 16 bit numbers using 8085.Problem StatementWrite 8085 Assembly language program to divide two 16-bit numbers.Discussion8085 has no division operation. To perform division, we have to use repetitive subtraction. To perform 16-bit division, we have to do the same but for the register pairs. As the register pairs are used to hold 16-bit data.The Divisor is stored at location FC00 and FC01, the dividend is stored at FC02 and FC03. After division, the quotient will be stored at FC04 and FC05, and the remainder will be stored at FC06 and FC07.InputAddressDataFC008AFC015CFC025AFC031D Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00001, ... Read More

8085 program to determine if the number is prime or not

Chandu yadav
Updated on 30-Jul-2019 22:30:26

2K+ Views

In this program we will see how to check a number is prime or not using 8085.Problem StatementWrite 8085 Assembly language program to check whether a given number is prime or not.DiscussionHere the approach is little bit different. We are actually counting the number of unique factors. For prime numbers the factors are only two. The 1 and the number itself. So if the result is 02H, then it is prime, otherwise not a prime number. As there is no division operation, we have to perform division by subtracting repeatedly.InputAddressDataF10007 AddressDataF100FF AddressDataF1002F Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 00, F1 LXI H, F100Point to F100 to take ... Read More

Previous 1 ... 7 8 9 10 11 ... 41 Next
Advertisements