I'm calling a C function from an assembly interrupt handler.
The interrupt handler looks like this:
Code: Select all
_isr4:
cli
push byte 0 ; Error code
push byte 4 ; Interrupt number
jmp isrhandler
Code: Select all
isrhandler:
mov eax, _isr
call eax
add esp, 8
iret
Code: Select all
void isr(ubyte isr, ubyte err) {
printf ("Interrupt %c", isr + 48);
}
Is this somehow related to the data in isr is being popped from the stack, or is there more likely something wrong with my printf function?
I have not yet remapped the PIC, and I have not enabled hardware interrupts. It will print '6' a lot before crashing, so it looks like it's generating interrupt 6 (invalid opcode)...
Thankyou