keriwarr / orangejoos

JOOS1W Compiler, written in Crystal
0 stars 1 forks source link

fix initial program EBP and ESP on returns #79

Closed lgo closed 6 years ago

lgo commented 6 years ago

Previously, when the program begins there is no EBP. As methods now expect the caller to set up their EBP, the entry-point needs to do this for the entry function.

Additionally, the ESP was not modified to discard the method's stack frame (i.e. localvars), which would cause an error on ret as EIP was not on the top of the stack.