On 6/19/2012 11:58 PM, Dave McGuire wrote:
> On 06/19/2012 11:10 PM, Dan Roganti wrote:
>> I'm trying to learn how to implement interrupts in C code for a Z80
>> controller board I made with a CTC and SIO/0 to get the console port
>> running. I'm not having much success to figure out how to code th
Hi,
Looking in the code generator it seems that __interrupt should turn a
normal function into an ISR and generates some PUSHes/POPs and a RETI. But
it also seems that unless you make it callee-saves it forgets half of the
registers.
If the __interrupt function is also __critical it will use RETN
Personally, so far, I just use some asm code in my own crt0.s for the
interrupts, e.g. for the NMI:
push af
push bc
push de
push hl
;push ix ; saved by callee
push iy
call _cv_vint
pop iy
;pop ix
pop hl
pop de
pop bc
pop af
retn
where
void cv_vint(void);
is just an ordinary C function like any
On 06/19/2012 11:10 PM, Dan Roganti wrote:
> I'm trying to learn how to implement interrupts in C code for a Z80
> controller board I made with a CTC and SIO/0 to get the console port
> running. I'm not having much success to figure out how to code this. I
> was wondering if there were any C cod
I'm trying to learn how to implement interrupts in C code for a Z80
controller board I made with a CTC and SIO/0 to get the console port
running. I'm not having much success to figure out how to code this. I
was wondering if there were any C code examples for the Z80 that I could
use as a refer