You are on page 1of 5

Assembly Language

Programming
Basic Addition
Peeyush K. P.
Assistant Professor
Department of Electronics and Communication Engineering
Amrita School of Engineering
Coimbatore

Data Processing Instructions 1


Memory Map – LPC2148

RAM
Data
(Data Memory)

Program Flash ROM


(Code M/M)

Data Processing Instructions 2


Example Code
• Assembly Language Program to add two numbers
Assembler CODE,READONLY
AREA ADDITION, Directive
ENTRY
MOV R1,#1
MOV R2,#2 R1 1 R2 2
ADD R0,R1,R2

END

+
R0 3

Data Processing Instructions 3


Example Code
• Assembly Language Program to add two numbers
AREA ADDITION,CODE,READONLY
ENTRY
MOV R1,#1 Program M/M
MOV R2,#2 0X00000000 MOV R1,#1
ADD R0,R1,R2 0X00000004 MOV R2,#2
STOP B STOP 0X00000008 ADD R0,R1,R2
END
Short Jump 0X0000000C B 0X0000000C
Label
0X00000010
……..

Data Processing Instructions 4


Thank
You
Data Processing Instructions 5

You might also like