0

okay guys im really stuck on this and i need help badly. All i know is that i need a loop at the begining to ask for four different marks, these marks have to be between 0-100. the marks are then stored in array and then i do a sum such as SAR EAX,2 to work out the average mark.

If you guys could help that would be great!

Hees some code snippets i have already

C++ Syntax (Toggle Plain Text)
 
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <stdafx.h>
 
int main (void)
{
	int mark1[] = "Enter the Mark for Module:";
	char average[] = "The average mark is:";
	char format[] = "%d"; 
 
	int myarray[4]; 
	myarray[0] = test1; 
	myarray[1] = test2; 
	myarray[2] = test3; 
	myarray[3] = test4; 
 
	_asm {
	mov ecx,4 
	mov eax,0 
	mov ebx,0 
	Loop1: add eax,myarray[ebx] 		
	add ebx,4
	loop Loop1
	... }
}
 Sleep(99999999);
return 0;
}

Thanks,

~Crag

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Tight_Coder_Ex
0

What part needs to be in assembly?
Is the array necessary?
Calculation to consider interations other than 4?
Where does test1 through 4 come from?

Post the details of the assignment as they were given to you by the instructor

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.