LD02: Condition Codes and Control Structures due Thu 19 Sep 13:20

Purpose

In this assignment you will learn/practice:

Preparation for Lab Day

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.

Lab Day

  1. At the beginning of the period show your prep work to the instructor.

  2. Make sure you have the most recent version of the homework repository. You will do your work in the provided ld02 directory.

  3. 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.

  4. Commit your work and push to bitbucket. Show your work to the instructor.

  5. If you finish early, work on your homework assignment until the end of the lab period.

Assembly Language

Segmentation Fault Counter

1779740147