Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

Students also viewed these Databases questions