MSX-DOS TPA Question

Página 2/2
1 |

Por Grauw

Ascended (10699)

Imagen del Grauw

20-12-2018, 09:36

If the aforementioned check passes, you can also write a magic value word x bytes below the stack (say 100H), and on program termination check if it hasn't changed. That way you will get an early warning if your stack grows large.

(By the way, for C maybe 100H is too little an amount, since it uses the stack so much. Would have to try it and see.)

Por ericb59

Paragon (1098)

Imagen del ericb59

20-12-2018, 21:45

Is this supposed to give me the current adress of the Stack ?

unsigned int ReadSP(void)
{
__asm

  ld   HL,#0
  add  HL,SP 

__endasm;
}

Por Pencioner

Scribe (1542)

Imagen del Pencioner

20-12-2018, 22:24

SDCC seems to handle int return from functions via HL - so yes, with SDCC compiler it should work fine

Página 2/2
1 |