Question

Write a program that finds the largest number among two numbers and store the result in...

Write a program that finds the largest number among two numbers and store the result in any register.

Value1: 0x18345678 (hexidecimal)

Value2: 0x15678245 (hexidecimal)

(Code in ARM assembly language, Using Keil software)

Homework Answers

Answer #1

ARM Program to find largest number among the two Numbers.

AREA MAX, CODE, READONLY ENTRY.

START

LDR R0, NUMBERS   // load address of first numbers to be compared in register R0

MOV R2, # & 02 // number of values to be compared

EOR R1, R1, R1. // clear register R1

LOOP 1

LDR R3, [RO] // load number

CMP R3, R1 // compare numbers

BCC LOOP2 // Branch if carry is clear

MOV R1, R3 // move register R3 to R1

LOOP 2

ADD RO, RO, #4

SUBD R2, R2, #1

BEN LOOP1

LDR R4= RESULT   

STR R1, [R4]

OVER B OVER

AREA ANSWER, READWRITE

NUMBER DCD & 18345678,& 15678245

RESULT DCD 00.

END.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write an assembly language program that reverses all the bits of a 32-bit number. (Without using...
Write an assembly language program that reverses all the bits of a 32-bit number. (Without using RBIT instruction) Write an assembly language program that checks whether an unsigned number is perfect square or not.
PLEASE COMMENT CODE AND TEST THAT IT WORKS: Write a assembly program to find the largest...
PLEASE COMMENT CODE AND TEST THAT IT WORKS: Write a assembly program to find the largest item in an array and store it in a AX. Hint: Use both Jump and loop instruction to write the program. logic: Assume that the first item of the array is the minimum and store it in AX Write a loop. Inside the loop, compare the each array item with the AX If the array item is less than the AX, update AX with...
Write an ARM assembly language program that counts the number of 1’s for any value in...
Write an ARM assembly language program that counts the number of 1’s for any value in R0. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, R0 may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into R0. The number in R0 does not need be preserved. You may use any other registers as you need. The result, total count of 1’s in R0, should be in...
Write a program in ARM assembly language that copies each element of array A to consecutive...
Write a program in ARM assembly language that copies each element of array A to consecutive fourth elements of array B, i.e., A[0] to B[0], A[1] to B[3], A[2] to B[7], etc. The array A is 12 elements long, and each element is a number that is 32 bits (1 word) wide. Assume the base address of array A is in register R2, and the base address of array B is in R3.
EMBEDDED: Write a program in ARM assembly language that copies each element of array A to...
EMBEDDED: Write a program in ARM assembly language that copies each element of array A to consecutive fourth elements of array B, i.e., A[0] to B[0], A[1] to B[3], A[2] to B[7], etc. The array A is 12 elements long, and each element is a number that is 32 bits (1 word) wide. Assume the base address of array A is in register R2, and the base address of array B is in R3.
Write the following program in MIPS: a) declare an array A of the following numbers: 3,...
Write the following program in MIPS: a) declare an array A of the following numbers: 3, 5, 8, 10, 12, 2, 76, 43, 90, 44 b) declare a variable called size which stores the number of element in array A, that is 10. c) write a subroutine to search for a number stored in an array and return true or false. In C++ the subroutine is as follows: search(array, size, number_To_Search) e.g. search(A, 10, 12) The subroutine should return 0...
In Java, Write a small program that gets some numbers as command line arguments and finds...
In Java, Write a small program that gets some numbers as command line arguments and finds the minimum of those numbers. You can assume that the user will provide some command line arguments when running the program (so you don’t have to worry about what to do if the user doesn’t provide any arguments -- that won’t happen). Also, you can assume that all the command line arguments will be floating-point numbers, i.e., numbers with a decimal point, like 8.25.
Write an LC-3 program (machine code) that compares the two numbers located in x3600 and x3601...
Write an LC-3 program (machine code) that compares the two numbers located in x3600 and x3601 and puts the value 0 in R1 if the two numbers are equal, 1 if the first number is larger than the second number, and -1 if the first number is smaller than the second number.
A) write a program the computes nx and store the result into y You can use...
A) write a program the computes nx and store the result into y You can use y = Math.pow( Mantissa, exponent) Requirements: Besides main() your program must have one method with two parameters, one double and one int n and x are positive numbers read from the keyboard if the user makes an entry that does not meet this criteria, the user must be given to opportunity retry the entry the user must be able to quit prior to entering...
Write a program to input 6 numbers. After each number is input, print the biggest of...
Write a program to input 6 numbers. After each number is input, print the biggest of the numbers entered so far. Please use python and include a screenshot that the code is running. Please use simple code as I am only a high school student.