Question: PROBLEM 3 (15 POINTS) A (10 points) Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal. CBZ X19,

PROBLEM 3 (15 POINTS)

A (10 points) Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal.

CBZ X19, exit

ADD X10, X19, X20

exit:

Instruction 1:

0x ____________________

Instruction 2:

0x___________________

B (5 points)

Consider the following code fragment for answering the following questions. Assuming the label func located at 0x400040.

func: SUBI SP, SP, #16

STUR X19, [SP,#0]

ADD X19,XZR, XZR

loop: SUBI X0, X0, #1

CBZ X0, else

ADDI X19, X19, #3

B loop

else: ADDI X0, X19, #0

LDUR X30, [SP, #0]

BR LR

For the following LEGv8 fragment find the BR address field for B (26 bits) and immediate field for CBZ instructions (19 bits). Use binary representation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!