Question

In: Computer Science

**Add comments to existing ARM code to explain steps** Write an ARM assembly program to convert...

**Add comments to existing ARM code to explain steps**

Write an ARM assembly program to convert temperatures from Celsius to Fahrenheit or from Fahrenheit to Celsius. Here are the two formulas for your reference. Use variable to read and store values.

C= 5* (F - 32) / 9

F = (9 * C / 5 ) + 32

My code below:

TempConvert.s

LDR R8,=temperature

LDR R1,[R8]

LDR R8,=unit

LDRB R2,[R8]

LDR R8,=celsius

LDRB R3,[R8]

LDR R8,=fahrenheit

LDRB R4,[R8]

MOV R6,#9

MOV R7,#5

;----C = 5 * (F - 32) / 9

SUB R5,R1,#32

MUL R5,R5,R7

UDIV R5,R5,R6

;------F = (9 * C / 5) + 32

MUL R5,R1,R6

UDIV R5,R5,R7

ADD R5,R5,#32

stop B stop

temperature DCD 50

unit DCB "F",0

celsius DCB "C",0

fahrenheit DCB "F",0

END

Solutions

Expert Solution

Given that,

C= 5* (F - 32) / 9

F = (9 * C / 5 ) + 32

if you have any other doubts u can comment so that ill solve it for you thanks for giving me this opportunity.


Related Solutions

**Add comments to existing ARM code to explain steps** Question that my code answers: Write an...
**Add comments to existing ARM code to explain steps** Question that my code answers: Write an ARM assembly program to calculate the value of the following function: f(y) = 3y^2 – 2y + 10 when y = 3. My Code below, that needs comments added: FunSolve.s LDR R6,=y LDR R1,[R6] MOV R2,#5 MOV R3,#6 MUL R4,R1,R1 MUL R4,R4,R2 MUL R5,R1,R3 SUB R4,R4,R5 ADD R4,R4,#8 st B st y DCD 3
write a assembly language program to convert GRAY to BCD code in 8051
write a assembly language program to convert GRAY to BCD code in 8051
Calculator in Assembly Language (Please add comments to explain your steps) Description: You are responsible to...
Calculator in Assembly Language (Please add comments to explain your steps) Description: You are responsible to implement several assembly functions to perform the simple arithmetic calculations for 2 64-bit integers. These functions will use the C function signature but the main logic within this function should be inline assembly code using the ASM block similar to the assembly example shown in class. Program Specification: 1. long mult ( long op1, long op2 ) - Can’t use the MUL/IMUL instructions, meaning...
Convert the following C++ statements to an ARM assembly language program: const int size = 10;...
Convert the following C++ statements to an ARM assembly language program: const int size = 10; int x[size] = {8, 2, 9, 6, 7, 0, 1, 3, 5, 4}; int y[size] = {399, -87, 12, 0, 42, -367, 57, 92, -1000, 25}; for i = 0; i < size; i++) if (x([ i ] > y[ i ]) z[ i ] = 0 else z[ i ] = 1;
Write an arm assembly program that will multiply two arrays (index by index) and store the...
Write an arm assembly program that will multiply two arrays (index by index) and store the result in a third array. Declare an array: .data Arr1: .quad 10    #index 0             .quad 4      #index 1          ….. Arr2: .quad 2,5,6…. Arr3: .quad 0,0,0…. To load array pointer address:      Movq $Arr1, %rdx   #stores address of Arr1 index 0 in rdx To move to the next index of an array:     Addq $8,%rdx To retrieve data: Movq (%rdx), %rcx         # will...
You have to write an ARM Assembly M4 program for SLTB004A Thunderboard Sense 2. Write an...
You have to write an ARM Assembly M4 program for SLTB004A Thunderboard Sense 2. Write an assembly program that blinks the red LED to send out a SOS Morse code (... --- ...). The dot duration must be 1/4 second and the dash one - 1/2 sec. Duration between dots and dashes is 1/4 second. After displaying SOS the program must delay for 2 seconds and then loop back to blink out SOS again. Use LETIMER for generating all time...
write a program for the microcontroller-msp430fr6989 using code composer studio not assembly language. write a code...
write a program for the microcontroller-msp430fr6989 using code composer studio not assembly language. write a code that transmits a single character and lights the red LED upon receiving that character. The board will "talk" to itself. The green LED should turn on whenever a message is sent and the LCD will display the message being received.
write this program in java... don't forget to put comments. You are writing code for a...
write this program in java... don't forget to put comments. You are writing code for a calendar app, and need to determine the end time of a meeting. Write a method that takes a String for a time in H:MM or HH:MM format (the program must accept times that look like 9:21, 10:52, and 09:35) and prints the time 25 minutes later. For example, if the user enters 9:21 the method should output 9:46 and if the user enters 10:52...
The following code fragment is expressed in arm assembly code. Fill in the blanks, so that...
The following code fragment is expressed in arm assembly code. Fill in the blanks, so that it is equivalent to the following C code. int counter; int x = 5; int y = 6; for (counter =10; counter >0;counter--) IF(X==Y) Y = Y + 1 ; ELSE Y = Y + 2} Fill in the blanks in the following code: MOV__________ ;loop counter into r0-ten times round the loop MOV__________ ;Value of y loaded into r1 MOV__________ ;Value of x...
PLEASE PROVIDE COMMENTS ON STEPS Write a C++ program that modifies a string (null terminated) as...
PLEASE PROVIDE COMMENTS ON STEPS Write a C++ program that modifies a string (null terminated) as follows: Consonants are positioned at the beginning of the string and vowels are moved to the end of the string. Example : Original string : washer New string : wshrae Note: The library string functions cannot be used. You must use pointers and the switch statement to execute this program. Assume that the vowels are a, e, i, o, and u. The modification has...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT