6 void initArchitecture(int stackSize
, int regsCount
);
16 /* The stack when in a user procedure:
18 | fp | - the old fp (before this application)
19 | ret | - return address
20 | env | - points to the enviroment vector
21 | n | - number of arguments
25 | An-1 | - argument n-1
27 Note: sp does NOT have to be equal to fp - for example if we are in the
28 middle of applying a procedure and already pushed some arguments
29 on to the stack (then sp has changed, but fp has not).
31 Macros for user procedures:
33 #define ST_ARG(n) (stack[fp-5-(n)])
34 #define ST_ARG_COUNT() (stack[fp-4])
35 #define ST_OLDFP() (stack[fp-1])
36 #define ST_RET() (stack[fp-2])
37 #define ST_ENV() (stack[fp-3])
38 #define RETURN() goto *pop()
40 /* General Purpose Registers */