CS 2011, C Term 2002: Lab 4

                                                                             Name: _______________

                                                                            Section:_______________

Objective

The goal of this lab is to give you some experience using DOS file I/O and buffered keyboard input.

You'll need two files for this lab:

http://www.cs.wpi.edu/~jburge/courses/c02/cs2011/labs/lab4.asm

and

http://www.cs.wpi.edu/~jburge/courses/c02/cs2011/labs/LAB4FILE.TXT

Download these on to your floppy disk using a web browser. There are links to them on the course home page.

This program will not assemble.  You'll need to edit it and add some assembly code where indicated by **. When completed, the program will open an existing file, read data from it, ask you for a new file name, read the name using buffered I/O, open the new file, write the data read earlier into it, and close both files.  You'll need to refer to Irvine when doing this.

Use the debugger to test this out and keep an eye on the registers after each INT 21 instruction. If the carry flag is set, you can look at the error code to see what went wrong (where's the error code?  look in Irvine!).

 

After your program is working, answer the following questions:

 

 

 

 

You will need to turn in this handout at the end of your lab session to receive credit for the lab.