| 27. Moto 1.0 Process Slot 2 Stack Problem | Index |
Modules Affected
Problem
A BrainStem Moto 1.0 module running a TEA program in process slot 2 may generate erroneous results when executing some opcodes. This problem can occur when short (2-byte) values are stored at absolute stack locations 31 and 32 and the NEGS, MODS, or DIVS opcode is executed. The problem can also occur when a 1-byte value is stored at absolute stack location 32 and the NEGB opcode is executed. Process slots 0 and 1 are not affected.
Work-Arounds
For a TEA program that will run in process slot 2, add 32 bytes of global variable data. This will pad the stack and prevent operations at the problematic stack locations.
Add two dummy int variables in any routine that stores short values at stack locations 31 and 32 or byte values at stack location 32. This will prevent storage of a short variable at the problematic stack location. This solution requires advanced knowledge of how the processor stores variables, parameters, and return addresses.