Question: Here is my code: program Crazy 8 s; #include ( stdlib . hhf ) static num 1 : int 3 2 ; num

Here is my code:
program Crazy8s;
#include("stdlib.hhf")
static
num1: int32;
num2: int32;
num3: int32;
countWins: int32 :=0;
procedure CheckForEight(n: int32) : boolean;
begin CheckForEight;
while (n >=10) do
n := n -10;
endwhile;
return (n =8);
end CheckForEight;
begin Crazy8s;
stdout.put("Welcome to Crazy 8s Game!", nl);
stdout.put("Gimme a number: ");
stdin.get(num1);
stdout.put("Gimme a number: ");
stdin.get(num2);
stdout.put("Gimme a number: ");
stdin.get(num3);
mov(eax, num1);
call(CheckForEight);
movzx(num1, al);
mov(eax, num2);
call(CheckForEight);
movzx(num2, al);
mov(eax, num3);
call(CheckForEight);
movzx(num3, al);
or(num1, num2);
or(num1, num3);
cmp(num1,1);
je(win);
stdout.put("Sorry Charlie! You lose the game!", nl);
jmp(endgame);
win:
inc(countWins);
stdout.put("One of them ends in eight!", nl);
endgame:
cmp(countWins,3);
jl(Crazy8s);
stdout.put("You Win The Game!", nl);
end Crazy8s;
Here is the feedback from the instructor: The Goal Of Class Is To Learn Assembly Instructions, Not Write High-Level Language Statements Like while Loops Like You Are Doing In Your Crazy8 Code.
Here is my code: program Crazy 8 s; #include ( "

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!