1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
maxonik [38]
3 years ago
13

Translate the following C program into an assembly program. The C program finds the minimal value of three signed integers. Assu

me a, b, and c is stored in register r0, r1, and r3, respectively. The result min is saved in register r4.
If (a< b && a min =a;
} else if (b min=b;
} else {
Min=c:
}
Computers and Technology
1 answer:
Gnoma [55]3 years ago
7 0

Answer:

  GLOBAL minRoutine

  AREA MYCODE, CODE, READONLY

  ENTRY

minRoutine

  MOV r0, #0xA  

  MOV r1, #0x3  

  MOV r3, #0x8  

  CMP r0,r1      

  BLT less1Routine      

  CMP r1,r0    

  BLT less2Routine      

  MOV r4,r3      

less1Routine              

CMP r0,r3      

  BLT cond1

less2Routine              

  CMP r1,r3    

  BLT cond2

 

cond1              

  MOV r4,r0      

cond2            

  MOV r4,r1      

  END

Explanation:

  • Inside the minRoutine, move the essential values to the r0, r1 and r3 registers.
  • Check if a is greater than b by comparing value in r0 with r1.
  • Jump to less1Routine, if value of r0 is less than value of r1. Otherwise go to next instruction .
  • Check if b is greater than a by comparing value in r1 with r0.
  • Jump to less2Routine, if value of r1 is less than value of r0. Otherwise go to next instruction .
  • Finally move result of r1 into r4 register.
You might be interested in
Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3 and then m2 calls m4, m3 calls m5.
Minchanka [31]

Answer:

M2 is the answer for the above question.

Explanation:

  • The above question states the scenario, where firstly main function calls the M1 function.
  • Then M1 function calls the function M2.
  • Then M2 function calls the function M3.
  • Then M3 function calls the function M5.
  • Then Again M2 function will resume and calls the function M4.
  • Then Again M2 function will resume because when the M4 will ends it return to the statement of the M2 function from which the M4 function has been called.
  • It is because when any function ends its execution it returns to that line of a statement from which it has been called. This is the property of programming language to call the function.
  • So when the M4 will terminate its execution then the M2 function will resume again.
4 0
3 years ago
3k means about 3 thousand bytes. How would you express four trillion bytes?
Elanso [62]
Hello!

Four trillion bytsz will be expressed as "4T".

T stands for trillion.
8 0
3 years ago
Lập biêu đồ gantt chart
notka56 [123]

Answer:

Explanation:

yes

5 0
3 years ago
What are two fundamental components of data structures?
Fed [463]
Organization and access method.

Hope this helped! :)

- Jujufire
8 0
4 years ago
write a program which prompts the user for a celsius temperature, convert the temperature to fahrenheit, and print out the conve
JulsSmile [24]

print("——OR——") Input ("Temperature value in degree Celsius:"), celsius 2 = float) Celsius 2 = (Fahrenheit 2 * 9/5) + 32; print the result.

The user's input is taken. Enter the temperature in celsius by typing it into the input box. Fahrenheit is equivalent to (celsius multiplied by 1.8) + 32 print(str(celsius)+ "A degree in Celsius is equal to a " + str(fahrenheit)+ " degree in Fahrenheit. The change from C to F is therefore 100/180, or 5/9. It is 180/100 or 9/5 from F to C. As a result, the conversion yields °F = °C (9/5) + 32. As a result, the equation for changing from the Celsius to Fahrenheit scale becomes °F = °C (9/5) + 32. To convert from degrees Fahrenheit to degrees Celsius, do the inverse calculation: subtract 30 from the degrees Fahrenheit reading, then multiply the result by two to obtain the degrees Celsius reading.

Learn more about conversion here-

brainly.com/question/13163755

#SPJ4

6 0
1 year ago
Other questions:
  • How do you fix a computer
    12·1 answer
  • What is spam? electronic junk mail e-mail abuse e-mail subscriptions the e-mail server the opt out feature unethical use of e-ma
    14·1 answer
  • Which of the following will you select as X in the following series of clicks to lay the title over a chart: Chart Title box &gt
    14·1 answer
  • A series of four or five comparisons and calculations that together determine an employee's withholding tax value might be group
    6·1 answer
  • Which arrangement shows the strongest gravitational effects of the sun and moon on the earth's tides?
    10·1 answer
  • ___________ is a technique that uses IT to develop an ongoing relationship with the purchasers or buyers of an organization's pr
    13·1 answer
  • Imagine that you are in the market for a digital camera. Would it be better for you to purchase a high-quality digital camera or
    7·1 answer
  • Write the issue related to the cyber ethnic. ​
    7·2 answers
  • Question 3 of 10
    12·1 answer
  • n (m,n) correlating branch predictor uses the behavior of the most recent m executed branches to choose from 2m predictors, each
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!