Steps to use Keil uVision Software
After Installing the Keil software follow the below steps to perform the 8-bit Addition
1. Open the software and click on the Project option which is settled at the top of the window, Then it will shows a popup like this below:
And then click on the “New uVision Project” option then it will opens and explorer to save it like below:
Give a name to your Project and save it in your desired location. Then a popup will come to select the device of Microcontroller here in this case we are going to select the ‘AT89C51’ Microcontroller to run the program. In the popup there will be a search bar type the above name then select it as below:
After selecting the MC click on “OK” Option ‘AT89C51’ is a Microcontroller that designed by ‘ATML’ it is 8051-MC. Then you will get a dialog box with yes or no like below:
Click on ‘NO’ we don’t have need of that file so that click on NO but that’s up to you if you have any use cases with that file you can click on YES Then we have successfully created a project file like below:
Then right click on Source Group 1 and click on the option called “add new item to Group ‘Source Group 1′” and select the file type and enter the file name also like below:
Then click on Add that create an .asm file in your project. Now the asm file will be open in the editor to type the program so that Enter the above Program of 8-bit Addition. You can paste the above Program in your code editor after completing the code click on “F7” key to Build the target file or right click on the asm file and select Build target option from there.
In the below at Build output box you will get like below:
Build started: Project: addition
Build target 'Target 1'
assembling add.asm...
linking...
Program Size: data=8.0 xdata=0 code=11
".\Objects\addition" - 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:00:01
So when we are getting the output as 0 Errors we can proceed to run the Program by debugging.
To debug the program we can simply click ‘ctrl + F5’ or there will be a option to do that at the top of the window.
we can debug the program by step wise or complete program at a time by clicking on keys, By clicking on F11 Key we can achieve step wise debugging
At starting the register values are like below:
At starting all the registers are empty by pressing the F11 key we can check how the values of the accumulator, b are changing.
We can in the above picture that the value #5 came into Accumulator and B also added, the result was stored in Accumulator as per the program, as in the program we are added that to store the value in r0 register and 50h address see the result in the below:
As you can see the result was stored in R0 Register and 50h address. so that we can change the program to test your own values and make sure to rebuilt it again by clicking on F7 key .
Assembly Language Programming for Beginners: 8-bit Addition
We will learn how to add two 8-bit numbers using Assembly Language programming. We are going to use the 8051 microcontroller instruction set to write the program.