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 […]