In this assignment you will learn/practice:
- how to view condition codes set by some instructions
- how to set condition codes and branch conditionally
- how to convert high-level language control structures into assembly language
Download the program https://josephus.sergeantservices.com/classes/al/source/rflags.asm
and follow the instructions provided in the comments at the top. Write your
answers on a piece of paper.
One the same paper write x86 assembly language statements that are equivalent to:
if (x < 10 || y < 10)
z= x+y;
else
z= y;
Assume x, y, and z are 32-bit signed integers stored at labels
by the same names.
Bring your hand-written solution to lab day.
- At the beginning of the period show your prep work to the instructor.
- Make sure you have the most recent version of the homework repository.
You will do your work in the provided ld02 directory.
- Write a solution to a guessing game program in which the computer
“thinks” of a number in the range 1-100 and the user is asked to
guess it. If the user guesses wrong the computer will tell the user
whether their guess is too high or too low and allow them to guess
again. This continues until the user guesses the number and is
congratulated for their amazing talent. NOTE: To get a “random” number
in the proper range, at the beginning of the program add the contents
of all the general purpose registers and then get the remainder when
divided by 100. Add one to the result.
- Commit your work and push to bitbucket. Show your work to the instructor.
- If you finish early, work on your homework assignment until the end of
the lab period.