Register usage

From RevaWiki

Jump to: navigation, search

Return to the main manual page


The x86 version of Reva uses the following CPU register assignments:

  • EAX - top-of-stack (TOS). This is a convenient register to use for this purpose, since external functions will generally return their values in EAX.
  • ESI - data stack-pointer, from the second and further values on the stack. It points to an array of cells, and the n'th item is at [ESI + 4*n]
  • ESP - return stack-pointer. Convenient also, since this is also the CPU's return stack

When writing an inline{ word, keep in mind that other words may freely modify any other CPU register. EBX and ECX are particularly commonly used by other words - do not rely on other registers being untouched.

Personal tools