Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE WRITE THEM IN ARMS CORTEX M3 ASSEMBLY LANGUAGE, thank you. 1) Write an as

ID: 3801310 • Letter: P

Question

PLEASE WRITE THEM IN ARMS CORTEX M3 ASSEMBLY LANGUAGE, thank you.

1) Write an assembly language function int toKilometers (int miles) that takes distance as miles and returns the distance in kilometers.

2) 1 foot equals 12 inches, write an assembly language function that int toInches( int feet) that accepts a length written in feet and returns this length written in inches.

3) Write an assembly language function int isGreater(int a, int b)

that will return 1 if a>b , will return 0 otherwise.

Note: Your answer should be written in a way similar to this syntax

.global nameoffunction

.text

mov r1, #2

mov r2, r1

...

I tried using a converter online however, the converter returned nearly a 100 lines for this simple program which should be wayyyyy less than that. Thank you in advance.

Explanation / Answer

#include #include void main() { int inches = 0; int yards = 0; int feet = 0; const int inches_per_foot = 12; const int feet_per_yard = 3; printf("Enter a distance in inches: It); scanf("%d", &inches); feet = inches/ inches_per_foot; yards = feet/ feet_per_yard; feet %= feet_per_yard; inches %= inches_per_foot; printf("That is equivalent to %d yards %d feet and %d inches. ",yards, feet, inches); getch(); }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote