Open skeuchel opened 6 months ago
Thanks Steven!
I'll try to look into this over the summer (busy with deadlines right now), but I think you're reading the spec right. I ignore the spec a little in places, but this one might be worth adhering to because I want to add input.
The book uses the frame variable abstraction with nonnegative indices, i.e.
fv0
,fv1
, ... Using the reference implementation, the first frame variablefv0
is compiled to a zero displacementIn the System V AMD64 ABI, local variables are accessed through negative displacements of the base pointer only, and normally only negative displacements from the initial stack pointer should be used. In fact, the above assembly code will overwrite the argument count (
argc
) passed by the operating system. See Figure 3.9: Initial Process Stack in the ABI specification. Am I missing something or is this sort of an off-by-one bug?