Professional Documents
Culture Documents
Subject:: Microcontroller and Embedded Systems Laboratory 18CSL48 2 0:2:2
Subject:: Microcontroller and Embedded Systems Laboratory 18CSL48 2 0:2:2
DCD - DCD (Define Constant Data) allocates one or more words of memory,
aligned on four-byte boundaries, and defines the initial runtime contents
of the memory
data1 DCD 1,5,20 ; Defines 3 words containing decimal values 1, 5, and 20
DCW - The DCW directive allocates one or more halfwords of memory, aligned
on two-byte boundaries, and defines the initial runtime contents of the
memory.
Program No. 2 :
Write a program to find the sum of first 10 integer numbers.
Instructions :
ADD R0,R2,R4 // Add R2 and R4 and store result to R0, update flags
ADD R4,R4,#0xFF00 // Add value in 0xFF00 and R4 and store result in R4
Instructions :
LDRH : Load register 16-bit half word value to Memory. The address must be
even for Halfword transfers.
STR : Store register 32-bit words to Memory. The address must be 32-bit
word-aligned.
Instructions :