MSX-DOS TPA Question

Страница 2/2
1 |

By Grauw

Ascended (10699)

Аватар пользователя 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.)

By ericb59

Paragon (1098)

Аватар пользователя 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;
}

By Pencioner

Scribe (1542)

Аватар пользователя 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

Страница 2/2
1 |