Question: 1 1 . 8 LAB: Volume of a rectangular box - LDUR / STUR the result is stored at memory address 4 4 0 0
LAB: Volume of a rectangular box LDURSTUR the result is stored at memory address :
Note: Use the button under the Registers and Memory display to initialize X X and the three dimensions in the memory.
LAB
ACTIVITY
: LAB: Volume of a rectangular box LDURSTUR
Load default template...
Assembly
Line Type your code here.
Line Do not initialize any register and
Line memory values here! This zyLab platform supports the following LEGv instructions:
Arithmetic: ADD, ADDS, ADDI, ADDIS, MUL, SDIV, SUB, SUBS, SUBI, SUBIS
Data transfer: LDURB, LDUR, LDURH, LDURSW, MOVK, MOVZ, STURB, STUR, STURH, STURW
Logical: AND, ANDI, EOR, EORI, ORR, ORRI, LSL LSR
Conditional branch: BHS BLO BEQ
BGT
BGE BHI
BLT BLE
BLS BMI
BNE
BVCBVS
BPL CBZ CBNZ
Unconditional jump: B BL BR
Given the dimensions of a rectangular box, write a program to calculate the volume of the box and store the result at memory address
Assume register X stores the memory address and register X stores the memory address
Assume also the dimensions are stored in the following memory locations:
Ex: If the dimensions are initialized in the simulator as:
the result is stored at memory address :
WARNING: Only use the commands provided in the final image. So do not use commands such as MOV or CMP
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
