COAL Assignment: 02: k19 - XXXX
COAL Assignment: 02: k19 - XXXX
2. College Registration
Using the College Registration example from Section 6.7.3(Chapter 06) as a starting point, do the following:
• Recode the logic using CMP and conditional jump instructions (instead of the .IF and .ELSEIF directives).
• Perform range checking on the credits value; it cannot be less than 1 or greater than 30. If an invalid entry is
discovered, display an appropriate error message.
• Prompt the user for the grade average and credits values.
• Display a message that shows the outcome of the evaluation, such as
“The student can register” or “The student cannot register”.
3. Implement the following C++ code in assembly language, using the block-structured. Assume that all
variables are 32-bit signed integers:
int array[] = {10,60,20,33,72,89,45,65,72,18};
int sample = 50;
int ArraySize = sizeof array / sizeof sample;
int index = 0;
int sum = 0;
while( index < ArraySize )
{
if( array[index] <= sample )
{
sum += array[index];
}
index++;
}
Optional: Draw a flowchart of your code.
Enjoy Coding...