Get the most recent version of the homework/labday repository. In the ld03
directory you should have a program called arraystarter.asm. Edit that
file and follow the instructions provided in the comments. Once you have
completed the instructions commit your solution and push to bitbucket.
At the beginning of the period show your prep work to the instructor will
examine your prelab work from you repository. You can go ahead and start
working on the following steps.
With a text editor, open lib/iomacros.asm and read the documentation
for the commands: fopenr, fget_i, and fclosem.
Do this and the remainining steps in the ld03 directory of your
repository. With a text editor create a document called numbers.txt
and type in 10 different numbers (one per line).
Add code to your arraystarter.asm program so that it opens and
closes the text file you just created. Use dump_regs to verify
that RAX contains what you expect.
Between the open and close commands add a command to read a single
integer from your file. Display the integer you read.
Add a loop so that you read 10 numbers from the file and display them
as they are read.
Modify the data file so that it contains 11 numbers. Is your program
stopping at 10? If so, rewrite the code so the program stops reading at
the end of the file rather than a fixed number.
Create an array in memory big enough to hold up to 100 integers.
Modify your loop so that values you read from the file are stored
into the new array.
After the file is closed, write a separate loop that will traverse the
array and display the numbers.
Show your completed work to the instructor.
If you finish early, work on your homework assignment until the end of
the lab period.