Question: ARM ASSEMBLY Assignment (ARM7TDMI) Consider the operations described by if (R0 is less than R1) begin swap(R0,R1) end else if (R0 equals R1) begin R1

ARM ASSEMBLY Assignment (ARM7TDMI)

Consider the operations described by

if (R0 is less than R1) begin

swap(R0,R1)

end

else if (R0 equals R1) begin

R1 = -R0;

R0 = 0;

end

else begin

R1 = NOT R0;

R0 = -1;

end

PROBLEM: Using the following algorithm solve questions 1,2 in assembly, use template provided for solution and code execution.

----------------

algorithm:

Consider the operations described by

if (R0 is less than R1) begin

swap(R0,R1)

end

else if (R0 equals R1) begin

R1 = -R0;

R0 = 0;

end

else begin

R1 = NOT R0;

R0 = -1;

end

-----------------------------------------------------------

Question1: Use unconditional instructions to implement the algorithm in assembly language

Question2: Use conditional instructions, but no branches at all. to implement the algorithm in assembly language

----------------------------------

Use the following template for solution:

AREA FLASH, CODE, READONLY

ARM

EXPORT __main

R0VAL EQU 0x6 ; different value will be used to test your program

R1VAL EQU 0x7 ; assume that numbers are signed numbers

__main

; PART 1

MOV R0, #R0VAL ;load test case

MOV R1, #R1VAL

. . .

. . .

endpart1

; PART 2

MOV R0, #R0VAL ;load test case

MOV R1, #R1VAL

. . .

. . .

endpart2

B endpart2

END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement this algorithm in ARM7TDMI assembly language we will develop two solutions based on the provided template one using unconditional instruc... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!