Basic System Problem Analysis - August 2003
52
Procedure Calling Convention: SP & PSP
This, admittedly very simple example shows how to look for r26 appearing either as the
source register or destination register to see whether it has been moved. In this example
the only reference to R26 from the beginning of FCLOSE to the current offset is that one
instruction. All that is doing is extracting the right 16 bits of the register because file
number is defined as a 16 bit value.
This also assumes (which is not always a good thing) that FCLOSE has not hopped
around and executed code past the current PC location which might have saved R26
someplace you could find it. You can determine that by reading each instruction from top
to bottom and essentially “replaying” the procedure based on the data you find in
registers and on the stack (assuming you have the time and inclination!).
Here we can see that FCLOSE did not save R26 to the stack. It had no need to. Perhaps
fclose_nm did?