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...
Please show all work an explain to be upvoted. Write an assembly program to convert an...
Please show all work an explain to be upvoted. Write an assembly program to convert an 8 character string from upper case to lower case.
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...
Python3  Please add comments Write a program that implements the word guessing game - There is a...
Python3  Please add comments Write a program that implements the word guessing game - There is a secret word - The user enters letters one at a time, if the letter appears in the secret word, it is revealed. Otherwise, it counts as a wrong guess. If the user reveals all the letters in the word before getting too many wrong guesses then they win! Otherwise, they lose. 1 - define secret word 2 - create a revealed letter list that...
Write a recursive ARM Assembly program that takes two integers as input and outputs the greatest...
Write a recursive ARM Assembly program that takes two integers as input and outputs the greatest common divisor. *I am using Eclipse DS-5 Community Workspace with A64 Instruction Set) Use the following algorithm: // Given two integers m and n: if (m < n) gcd(n, m) if n is a divisor of m gcd(m, n) = n else gcd (m, n) = gcd (n, m % n) Your program must be recursive. You must create a function that calls itself,...
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT