View Full Version : MCORE forth details
patrebert
12-22-04, 03:23 PM
I've recently started a 2114-based project using Max-Forth. What are the rules for register usage when writing interrupt service routines? Which are used by Max-Forth and need to be left alone?
Do you have any documentation of implementation-specific issues such as this for the MCORE?
Pat
For interrupts, save and restore any registers you are planning on using. If you only write in assembler then this is easy to keep track of. If you also use C, then you might have to check the assembler output or check with the compiler. MaxForth itself does not use any registers other than virtual registers. It is a C program that is compiled for the MCore platform and I cannot say which registers are never used. As with interrupts, they can happen at any time so if any register is ever used by another piece of code, it must be saved and restored by the interrupt.
There are more details in Section 8.3 of the manual where an example is given that makes use of the alternate file of registers avoiding all saves.
Rob
vBulletin v3.0.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.