You are on page 1of 8

Lab No.

2: Getting Started with Assembly Language


Introduction:
Assembly language is the most basic programming language available for any processor.
With assembly language, a programmer works only with operations implemented directly on the
physical CPU. Assembly language lacks high-level conveniences such as variables and
functions, and it is not portable between various families of processors.
A processor understands only machine language instructions, which are strings of 1's and
0's. However, machine language is too obscure and complex for using in software development.

Advantages of Assembly Language:


1. It requires less memory and execution time;
2. It allows hardware-specific complex jobs in an easier way;
3. It is suitable for time-critical jobs;
4. It is most suitable for writing interrupt service routines and other memory resident
programs.

Creation of New Assembly Project on Keil:


Step 1:
Run the software by clicking the icon on desktop. An interface similar to one shown in
Figure 1 will open.

Figure 1
Step 2:
Click on Project tab and choose New _Vision Project from the drop-down list as shown
in Figure 2

Figure 2

Step 3:
Select and create a directory, then assign a name to your project then click on Save. Do
not make a directory, file or project name with a space in it. A space will prevent simulation from
working properly.

Figure 3
Step 4:
To select a microcontroller, click on STMicroelectronics and then click on
STM32L4 series and select STM32L476VG. Click OK.

Figure 4

Step 5:
click on CMSIS and select CORE and then click on Device and select startup. Click Ok.

Figure 5
Step 6:
Right click on Source Group 1 under Target 1, click on Add New Item to Group ‘Source
Group 1’...

Figure 6

Step 7:
Select the type of file you want to add (. s for assembly and .c for C file), write its name
in given space and click add.

Figure 7
Step 8:
File added to the project and now start programming

Step 9:
. when programming completes then we translate it and then we build it.

Figure 8
Step 10:
After build the code we click Options for target, then click on debug, then select use
simulator and Click Ok.

Figure 9

Step 11:
Then click on Debug.

Figure 10
Step 12:
After Debug comment

1. IMPORT SystemInit
2. LDR
3. BLX

Figure 11

Step 13:
Close startup file.
Step 14:
Debug the project.

Figure 12

You might also like