Home /
Answered Questions /
Other /
for-this-quiz-create-a-data-section-with-two-word-values-a-and-b-then-implement-the-following-four-f-aw716
(Solved): For This Quiz, Create A Data Section With Two Word Values: A And B. Then Implement The Following Fou...
For this quiz, create a data section with two word values: a and b. Then implement the following four functions in ARM assembly language: void setAB(int a, int b); int getA(); int getB(); void swapAB(); setAB sets the values of a and b. geta and getB get the values of a and b respectively. swapAB swaps the values of a and b. For example setAB(12, 72); // a=12, b=72 printf("%d
", getA()); // Prints 12 printf("%d
", getB()); // Prints 72 swapAB(); printf("%d
", getAO); // Prints 72 printf("%d
", getB()); / Prints 12 Use only registers ro-r3. Do not use any other registers. Hints and Suggestions Other than swapAB, the functions are very short. Even it is only a few lines of code.
We have an Answer from Expert
View Expert Answer
Expert Answer
Given that void setAB(int a,int b); int getA(); int getB(); int swapAB(); These are the given four functions. int getA() { int a=12; //Take input as 12 } getA : li $r0,0x12//Take input 12
We have an Answer from Expert
Buy This Answer $6
Buy This Answer $6
-- OR --
Subscribe To View Unlimited Answers
Subscribe $20 / Month
Subscribe $20 / Month