Do the Even questions from section 8.2.6.
(It wouldn't hurt if you studied the answers to the odd questions as
well.)
In addition, do these problems:
- Write a short test program (perhaps using the ArrayFill PROC from
this section) and determine what is loaded into a register when
LEA is used instead of MOV..OFFSET. How is this value related to
the segment in which the data is located in general? How is this
value related to
the OFFSET when both can be used? (Of course, some cases require
LEA — as noted in #11 from 8.4.7.)
In one of the sample compiler generated codes in 8.2.4, the line:
add esp, 0FFFFFFFCh
was used to reserve space for the single local variable in the example
fragment. Why didn't they simply subtract 4 instead of adding negative 4? (There may be more than one reasonable
explanation.)
- When discussing the parameters for a function/procedure/module,
many programmers will use the short-hand of just 'input' instead
of 'input parameter' or 'input formal argument'. Needless to say,
this causes much confusion with beginning programming students
who expect the module to read a value from the user in some way
rather than accept a value from the caller. Briefly discuss the
roles input, output, and input-output have with respect to PROC
parameters. Explain how these differ from user interface or file
input/output.
This assignment is Level 3.