int16_t *addrStackPtr;
#endif
+int16_t *mathStackStartAddress;
+int16_t *addrStackStartAddress;
+
int16_t *prog; // user programs (opcodes) are placed here
int16_t *progOpcodes; // mapping between user word index and program opcodes
i = *mathStackPtr;
// prevent stack under-flow
- if (mathStackPtr < (int16_t *)config->mathStackStartAddress) {
+ if (mathStackPtr < mathStackStartAddress) {
mathStackPtr++;
}
break;
case 27: // depth ( -- n ) \ math stack depth
- pushMathStack((int16_t *)config->mathStackStartAddress - mathStackPtr);
+ pushMathStack(mathStackStartAddress - mathStackPtr);
break;
case 28: // .h ( a -- )
case 72: // s. ( -- ) \ print stack contents, TOS on right
{ // addr is strictly local to this block
int16_t *addr;
- addr = (int16_t *)config->mathStackStartAddress;
+ addr = mathStackStartAddress;
while (addr >= mathStackPtr) {
printNumber(*addr);
addr--;
case 73: // sh. ( -- ) \ print stack contents in hex, TOS on right
{ // addr is strictly local to this block
int16_t *addr;
- addr = (int16_t *)config->mathStackStartAddress;
+ addr = mathStackStartAddress;
while (addr >= mathStackPtr) {
printHexWord(*addr);
msp4th_putchar(' ');
*/
mathStackPtr = c->mathStackStartAddress;
addrStackPtr = c->addrStackStartAddress;
+ mathStackStartAddress = c->mathStackStartAddress;
+ addrStackStartAddress = c->addrStackStartAddress;
prog = c->prog;
progOpcodes = c->progOpcodes;
cmdList = c->cmdList;