0% found this document useful (0 votes)
250 views3 pages

ARM7 Assembly Code Exercises

This document contains 7 code snippets of ARM assembly language code with instructions to add, multiply, swap register contents, shift values, and perform logical operations. The code demonstrates basic arithmetic, logical, and conditional operations in ARM assembly language.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
250 views3 pages

ARM7 Assembly Code Exercises

This document contains 7 code snippets of ARM assembly language code with instructions to add, multiply, swap register contents, shift values, and perform logical operations. The code demonstrates basic arithmetic, logical, and conditional operations in ARM assembly language.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Add the contents of Registers R1,R2 and save the result


in to R3.Use Step execution in keil, write down the
contents of various flags of ARM7

AREA PROG_2_1, CODE, READONLY


ENTRY
MOV R1, #0x25 ;R1 = 0x25
MOV R2, #0x34 ;R2 = 0x34
ADD R3, R2,R1 ;R3 = R2 + R1
HERE B HERE ;stay here forever
END

2. Perform Multiplication operations in ARM7


AREA EXP2, CODE, READONLY
ENTRY
START MOV R0,#0XFFFFFFFF
MOV R1,#0X80000000
MULS R2,R0,R1
END
3. Load R1 register with F631024C and R0 register with
17539ABD.Swap the contents using a logic gate
function.
AREA EXP3, CODE, READONLY
ENTRY
START LDR R1,=0xF631024C
LDR R0,=0x17539ABD
EOR R0,R0,R1
EOR R1,R0,R1
EOR R0,R0,R1
END
4. Let the register content of r5 and r7 are 5 and 8
respectively. Without using MUL instruction make r5
content as 14h(20d)
AREA EXP3, CODE, READONLY
ENTRY
START mov r5,#5
mov r7,#8
mov r7,r5,lsl#2
END
5. What is the inference of the following code? execute and
observe
AREA EXP3, CODE, READONLY
ENTRY
START mov r1,#0x77
mov r0,#0
rsb r0,r1,#2
END
6. What is the inference of the following code? execute and
observe

AREA EXP10, CODE, READONLY


ENTRY
START MOV R0,#5
MOV R3,R0
MOV R1,#1
LOOP
MUL R2,R0,R1
MOV R0,R2
ADD R1,#1
CMP R1,R3
BLT LOOP
MOV R5,R0
HLT
B HLT
END
7. What is the inference of the following code? execute and
observe

AREA EXP4, CODE, READONLY


ENTRY
START MOV R0,#-4
LDR R2,=0X80000000
AND R3,R2,R0
CMP R3,R2
MVNEQ R1,R0
ADDEQ R1,#1
MOVNE R1,R0
HLT
B HLT
END

You might also like