Additions of two 8-bit numbers using embedded C and keil.

preview_player
Показать описание
Step 1: First start KEIL IDE software
Step 2: Go to new project
Step 3: Give name of the project(do not add any .asm or .c extension)
Step 4: Now save the project after that select your Microcontroller,here I am using ATMEL 89C51
Step 5: Now go to file and select new file
Step 6: Now save this editor file in the same folder where u have saved ur project
Step 7: Now write ur program code here and save it.

Here is algorithm for the program...
Algorithm :
1. Declare three unsigned char variables.
2. Assign some data to two variables
3. Declare port P0 as an output port
4. Perform addition and store result into variable
5. Display the result on port0
6. Stop

Step 8: Now add this file (save it with extension .c) in the project i.e. in source group 1;
Step 9: Now right click on source group and click on build target.
Step 10: Now go to debugg section and click on start/stop
Step 11: Go to peripherals and select port here i m using port 1 ...
Step 12: Now run the project and you will get addition of two numbers in port 1.

Addition of 0x34(0011 0100)
+ 0xa9(1010 1001)
=(1101 1101) i.e 0xDD

Done...!!

Mazidi 8051 uc

Thanks for watching...!! :-)
Рекомендации по теме
Комментарии
Автор

Hi sir, How to perform multiplication of two 16-bit numbers in Keil using embedded C...?

madhukarm