CS220 Assignment 9

Trish Cornez





   Write complete programs with the following guidelines:
  1. Comment every instruction and document important segments of code.
  2. Use TAB to delineate your code columns. Do NOT allow columns to overlap into other columns.

    Describe procedures and include a description of the parameters they are receiving.

  3. Prompt your user with proper question strings.
  4. Generate readable output.
  5. email me the .asm file.

All assignments are due at at the end of the day.




       PROGRAM 1
    Write a procedure that receives two parameters: an array LIST of 16-bit words and the array size, N.
    The procedure should return in EDX the index of the maximum element in the array and in EBX the average integer in the array.
    Pass the address of LIST and N using registers. Test your procedure using a main program.




       PROGRAM 2
    In the game of DICE the player is asked for a target number in the range 4-6 or 8-12.
    The dice is then tossed until either the "target number" is rolled or a 7 is rolled.
    If the target appears first, the player wins, otherwise he/she loses.

    Write a program which plays DICE.

    Guidelines:
    1. Create a procedure which prompts the player for his/her target number.
    2. Write a procedure with simulates tossing a pair of dice. To do this, you will use the seed and random procedures provided in the Irvine library.
    3. Display the results for each roll of the dice.