LD04: Arrays of Records due Thu 10 Oct 13:20

Purpose

In this assignment you will learn/practice:

Preparation for Lab Day

Do these steps to get ready for lab day:

On lab show your paper calculations and show the hw06 directory you created.

Lab Day

  1. At the beginning of the period show your prep work to the instructor. You will continue work in your hw06 folder.

  2. Modify sumo.asm to comment out most of the existing executable section and modify it as follows.

  3. At the top of the program (after %include) use %define to assign names (all caps) to the offsets you calculated above. Also define a value for RECSIZE which will hold the size of an entire record (three numbers and a string).

  4. Add code to reserve space for an array big enough to hold 100 sumo records based on your calculations (100*RECSIZE).

  5. Add code to open the small.txt file and read the first entry (as 3 signed 32-bit ints and one string). Store the data in the first slot of the array.

  6. Print the data you read from the file using the offsets you defined.

  7. NOTE: after reading the 3rd number and then reading the string you will find that the string contains a space at the beginning because there was a space leftover after reading the 3rd number. Add a get_ch statement prior to your get_str to read the extra space.

  8. Have the instructor give you feedback on what you have done so far.

  9. Modify your source code so it uses a loop to read 5 entries from the file and into the array in consecutive slots. It is okay to initially hardcode the number of entries to read.

  10. Modify your source code so it prints 5 entries from the array.

  11. Show your completed work to the instructor.

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

Assembly Language

Segmentation Fault Counter

1779740194