How to I indicate in the C code that a routine is the NMI handler ?
I have spent some time in the bowels of https://github.com/z88dk/z88dk/wiki without finding that info. I am using #pragma output CRT_ENABLE_NMI = -1 and I see that it did put a hook at 66h but where it points has only a retn where I need my NMI handler to be or pointed to.
Standalone Z80 bd.
C code inicator of NMI handler
Re: C code inicator of NMI handler
This does work for me:
Then compile with (for newlib):
and for classic:
And the nmi routine is correctly bound.
Code: Select all
void z80_nmi() __critical __interrupt
{
}
void main( void ) {
}
Code: Select all
zcc +z80 eg.c -pragma-define:CRT_ENABLE_NMI=2 -m
Code: Select all
zcc +z80 eg.c -clib=classic -pragma-define:CRT_ENABLE_NMI=2 -m
Re: C code inicator of NMI handler
Yes, thank you, that does it. Are there other places for info that I should be looking at ?
Re: C code inicator of NMI handler
For classic, the pragma page is here: https://github.com/z88dk/z88dk/wiki/Classic--Pragmas
They're mostly the same for newlib but, of course, CRT_ENABLE_NMI varies slightly to cope with some of the classic targets that need NMI hooked by the CRT.
They're mostly the same for newlib but, of course, CRT_ENABLE_NMI varies slightly to cope with some of the classic targets that need NMI hooked by the CRT.