21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

InterruptMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER4.1.2 Software InterruptsA software interrupt occurs when executing certain instructions. Software interrupts are non-maskableinterrupts.• Undefined instruction interruptAn undefined instruction interrupt occurs when executing the UND instruction.• Overflow interruptAn overflow interrupt occurs when executing the INTO instruction with the overflow flag (O flag) set to“1”. The following are instructions whose O flag changes by arithmetic:ABS, ADC, ADCF, ADD, CMP, DIV, DIVU, DIVX, NEG, RMPA, SBB, SHA, SUB• BRK interruptA BRK interrupt occurs when executing the BRK instruction.• INT interruptAn INT interrupt occurs when assiging one of software interrupt numbers 0 through 63 and executingthe INT instruction. Software interrupt numbers 0 through 31 are assigned to peripheral I/O interrupts,so executing the INT instruction allows executing the same interrupt routine that a peripheral I/Ointerrupt does.The stack pointer (SP) used for the INT interrupt is dependent on which software interrupt number isinvolved.So far as software interrupt numbers 0 through 31 are concerned, the microcomputer saves the stackpointer assignment flag (U flag) when it accepts an interrupt request. If change the U flag to “0” andselect the interrupt stack pointer (ISP), and then execute an interrupt sequence. When returning fromthe interrupt routine, the U flag is returned to the state it was before the acceptance of interrupt request.So far as software numbers 32 through 63 are concerned, the stack pointer does not make ashift.487

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!