Due to the very limited stack space, the MOS6502 port by default generates non-reentrant code. Re-entrant functions should be declared using the __reentrant keyword. Alternatively the entire program can be compiled using –stack-auto. On the MOS6502 re-entrant code is, in general, much less efficient.