I have posted how to find a number is even or nor before…. Just check it. ORG 000h MOV DPTR,#0Ah ; an external address MOV RO,#0Ah ;array counter …
8051 code to convert hexadecimal to ascii value
In this article let’s learn how to convert Hexadecimal value to Ascii equivalent number. Hexadecimalvalue Asciivalue 01H 31H 02H 32H 03H 33H 04H …
8051 code to find a number is even or odd
So the basic logic we use is to check weather a number divides with 2 or not . Here we can use another logic by rotating the value in the accumulator to the right through carry and then make the decision based on the value of the carry.I will post…
8051 code to transfer 10 bytes of data to external memory
Whenever u need to transfer data from/to external memory, MOVX is used. We use DPTR to save the external address which acts as a pointer to the address .I have generated the data to be transfered in program…The following ALP uses the same logic: ORG 000h MOV DPTR,#adrdress…
8051 code to find a square of first 10 natural numbers and store it in an array.
8051 code to find a square of first 10 natural numbers and store it in an array. In this article let’s learn how to find the square of first 10 natural numbers and store them in an array. Algorithm: 1)Initialize R0 with memory address where all squares are stored and…
8051 Assembly code to find LCM of two numbers
Hello guys! After lot of optimization and debugging finally found a ALP program to find LCM of two numbers using 8051 micro-controller. Happy share this piece of code with you guys. Its easy and short. We have been learning to find LCM from our…
8051 Assembly code to find average of all numbers stored in array
We use Indirect addressing mode to access arrays in 8051, because it is efficient and has advantage of accessing adjacent address locations with one base address. So, lets see how to find average of all numbers stored in an array. ALGORITHM: Start Initialize a register with base address of memory…
8051 code to find number of prime numbers in array stored in memory with starting address 0xA0
What is a prime number? A prime number is a number which divides by 1 and itself.S o when we are taking in the program we have to take and check for the numbers which are not divisible by the half of the number to be checked as a prime…
8051 code to check whether the number is prime or not…!!
What is a prime number? A prime number is a number which divides by 1 and itself. So when we are taking in the program we have to take and check for the numbers which are not divisible by half of the number to be checked as a prime number.…
8051 code to find number of zeros and ones in a given number…!!
In this article let’s learn how to find the number of zeros and ones in a number. The easy way to find the number of zeros is by rotating each bit with carry and checking whether the carry flag is set or reset. Algorithm: 1) Initializing R0 to the numbers…