Question: Read info below starting: only use commands provided, ( No MOV or CMP for example ) : Hint: Use x 0 0 , x 1
Read info below starting: only use commands provided, No MOV or CMP for example :
Hint: Use as arguments and X as return value, according to the convention for procedure calling.
Ex: If the values of X and X are initialized in the simulator as:
the result is stored in $ :
Note: Use the button under the Registers display to initialize register values for X and X Note: Use the button under the Registers display to initialize register values for X and X
Assembly Note: Use the button under the Registers display to initialize register values for and X
Load default template...
AssemblyNote: Use the button under the Registers display to initialize register values for X and X
qxzqyThis 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
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 LAB: Nested procedures
Given the following C program and the mapping of registers to variables, complete the ARM implementation of procedure Sum.
int Difint a int b
return b a;
int Sumint m int n
int p Difn m;
int q Difm n;
return p q;
int main
int x y;
z x y Sumx y;
return ;
Hint: Use as arguments and X as return value, according to the convention for procedure calling.
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
