Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include int main ( ) { int i = 0 ; int h [ 9 ] = { 0 } , x [ 6 ]
#include
int main
int i ;
int h x y;
FILE input fopeninputtxtr;
fori ; i ; i fscanfinputd &hi;
fori ; i ; i fscanfinputd ξ
fori ; i ; i fscanfinputd &yi;
fcloseinput;
int px &x;
int ph &h;
int py &y;
asm volatile
add arrayHarrayHpoint
t
add arrayXarrayXpoint
t
"Loop:
t
add countzerozero
t
add countcountone
t
add arrayHarrayHpoint
t
add arrayXarrayXpoint
t
beq countfourExit
t
"Loop:
t
add countzerozero
t
add resultzerozero
t
"Loop:
t
lw tempXarrayX
t
lw tempHarrayH
t
mul temptempXtempH
t
add resultresulttemp
t
add countcountone
t
add arrayHarrayHfour
t
add arrayXarrayXfour
t
add arrayXarrayXfour
t
bne countthreeLoop
t
sw resultarray
t
add arrayarrayfour
t
add countcountone
t
add arrayHarrayHpoint
t
add arrayXarrayXpoint
t
bne counttwoLoop
t
beq counttwoLoop
t
"Exit:
t
: arrayrpy
: pointronerfourrtemprarrayXrpxarrayHrphcountrthreertempXrirtempHrcountrresultrzerorcountrpointrtworpointrpointrpointr
;
py &y;
fori ; i ; i
printfd py;
printf
;
return ;
explain the code each and explain it using a table or matrix
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started