Consider the following Java constructs. Express each in ARM assembly language. Assume all variables are singlebit Booleans and are in registers r0 = A, r1 = B, r2 = C, r3 = D. Note. The Java operators &, ¦, ! are AND, OR, and NOT, respectively. The operators && and || are AND and OR operators that support short?circuit evaluation; that is, if the expression yields false (AND) or true (OR) further evaluation is halted.

a. A = (B & C) | (!D);
b. A = (B && C) || (!D);

a. AND r0,r2,r3 ;A = B&C
NOT r4,r4 ;D = !D
ORR r0,r0,r4 ;A = (B & C)|(!D)
b. AND r0,r2,r3 ;A = B&&C check
NOTNE r4,r4 ;D = !D
ORRNE r0,r0,r4 ;A = (B & C)|(!D)

Computer Science & Information Technology

You might also like to view...

Explain why it is important to have a backup plan for your presentation in case of equipment failure. What might be two good backup plans?

What will be an ideal response?

Computer Science & Information Technology

The function that accepts a C-string as an argument and converts the string to a long integer is

a. atol b. strlong c. strtolong d. stringlong e. None of these

Computer Science & Information Technology