Please read the questions carefully. No pseudoinstructions are allowed (the only exception was mentioned in class). You
Posted: Fri Jul 01, 2022 5:39 am
Please read the questions carefully.
No pseudoinstructions are allowed (the only exceptionwas mentioned in class).
You have the following
struct ProductionUnit{ unsigned short yield; short id; bool active;};
ProductionUnit units[1000];
Convert to MIPS the following piece of code
for( int i{0}; i<1000;i++ ) if( units.active ) totalSum +=units.yield;
The value of totalSum is already in$s7 and is already initialized to zero.The address of units is already loadedin $s0.All data members of ProductionUnit are stored inmemory next to each other (no padding) and in the same order inwhich they are declared.
No pseudoinstructions are allowed (the only exceptionwas mentioned in class).
You have the following
struct ProductionUnit{ unsigned short yield; short id; bool active;};
ProductionUnit units[1000];
Convert to MIPS the following piece of code
for( int i{0}; i<1000;i++ ) if( units.active ) totalSum +=units.yield;
The value of totalSum is already in$s7 and is already initialized to zero.The address of units is already loadedin $s0.All data members of ProductionUnit are stored inmemory next to each other (no padding) and in the same order inwhich they are declared.