Separate Pass 2 Programs

NOTE: if you are NOT submitting Pass 2 as a separate program from Pass 1, you can ignore this document.

If you are doing Pass 2 as a separate program from Pass 1, you have to somehow get the total size of data and code into Pass 2 and we have to know how that is happening so we can grade it.

IMPORTANT: You MUST notify the grader that you are submitting Pass 2 as a separate program or it will be graded as if it is combined with Pass 1 and your grade will suffer. You must also indicate which of the following 3 options you are using.

You have three options:

  1. you can figure out a way that determines the code and data sizes without any action on our part and without our having to modify our data files in any way. You must make sure that this works correctly since we will not be able to debug or modify your program.
  2. you can simply ask the user for the code and data sizes by asking for them at the beginning of your program. In that case, we will know the sizes for the test programs we are using and will enter the correct values. This option will not require that we modify our test files in any way and is also easy for you to write.
  3. we will include two special entries in our symbol table files that will give the code and data length. These special entries will be numeric constants called CODE_LEN and DATA_LEN and will follow the correct format for numeric constants. Since they are numeric constants, they do not have memory space allocated for them. They also will not be used anywhere in the program as constants. After you have read the symbol table file into your program, you can search the symbol table for these two constants and that will provide the data Pass 2 needs.

If you have already finished Pass 2 and you are submitting it as a separate program from Pass 1, you must modify it to use one of these 3 options (unless it already does).