In this article let’s learn how to convert Hexadecimal value to Ascii equivalent number. Hexadecimalvalue Asciivalue 01H 31H 02H 32H 03H 33H 04H 34H 05H […]

# 8051

## 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 both the methods.. Method 1: […]

## 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 ;paste your external address […]

## 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 R1 with 0. 2)Increment R1 […]

## 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 school days. Finding Least common […]

## 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 location where array is stored […]

## 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 number. eg: If we are […]

## 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. eg: If we are checking […]

## 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 to be checked and R1 […]

## Interfacing LCD with 8051 using Keil C – AT89C51

LCD Interfacing-8051 AT89C51xD2 Introduction: A 16*2 Alphanumeric display with backlight is provided on Evaluation Board. Liquid Crystal Display (LCD) is widely used electronic display module and having a wide range of applications such as calculators, laptops, mobile phones etc. LCD in ALS 8051 Evaluation Board is connected to Port P2. Before we initialise the LCD […]