hello everyone ..
i have an issue converting a C code to MARIE assembly language..
actually i have homework due this friday.. i tried to solve the problem ( i should write a MARIE program) but i couldn't so i started writing it in C
here it is:
do {
scanf("%d",&num);
if (num <0)
break ;
count++;
sum+=num;
if(num>large)
large=num;
}while (num>0);
printf("%d\n",count);
printf("%d\n",sum);
printf("%d\n",large);
the problem is obvious i should ask the user to enter a positive number(loop) once he hit a negative number the program must ends and calculate three things:
1- how many numbers he entered( excluding the negative one).
2- sum of all numbers.
3- largest number.
all i know about MARIE is how the commands work( input,output,skipcond...,halt,store,load..etc)
please help me i'm really desperately lost ..i appreciate any help in this
thanks!
i have an issue converting a C code to MARIE assembly language..
actually i have homework due this friday.. i tried to solve the problem ( i should write a MARIE program) but i couldn't so i started writing it in C
here it is:
do {
scanf("%d",&num);
if (num <0)
break ;
count++;
sum+=num;
if(num>large)
large=num;
}while (num>0);
printf("%d\n",count);
printf("%d\n",sum);
printf("%d\n",large);
the problem is obvious i should ask the user to enter a positive number(loop) once he hit a negative number the program must ends and calculate three things:
1- how many numbers he entered( excluding the negative one).
2- sum of all numbers.
3- largest number.
all i know about MARIE is how the commands work( input,output,skipcond...,halt,store,load..etc)
please help me i'm really desperately lost ..i appreciate any help in this
thanks!