21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Address Match InterruptMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER2.12 Address Match Interrupt2.12.1 OverviewThe address match interrupt is used for correcting a ROM or for a simplified debugging-purpose monitor.The following is an overview of the address match interrupt.(1) Enabling/disabling the address match interruptThe address match interrupt enable bit can be used to enable and disable an address match interrupt.It is affected neither by the processor interrupt priority level (IPL) nor the interrupt enable flag (I flag).(2) Timing of the address match interruptAn interrupt occurs immediately before executing the instruction in the address indicated by the addressmatch interrupt register. Set the first address of the instruction in the address match interruptregister. Setting a half address of an instruction or an address of tabulated data does not generate anaddress match interrupt.The first instruction of an interrupt routine does not generate an address match interrupt either.(3) Returning from an address match interruptThe return address put in the stack when an address match interrupt occurs depends on the instructionnot yet executed (the instruction the address match interrupt register indicates). The return addressis not put in the stack. For this reason, to return from an address match interrupt, either rewritethe content of the stack and use the REIT instruction or use the POP instruction to restore the stack tothe state as it was before the interrupt occurred and return by use of a jump instruction.Figure 2.12.1 shows unexecuted instructions and corresponding the stacked addresses.• 16-bit operation code instructions• 8-bit operation code instructions given belowADD.B:S #IMM8,dest SUB.B:S #IMM8,dest AND.B:S #IMM8,destOR.B:S #IMM8,dest MOV.B:S #IMM8,dest STZ.B:S #IMM8,destSTNZ.B:S #IMM8,dest STZX.B:S #IMM81,#IMM82,destCMP.B:S #IMM8,dest PUSHM src POPM destJMPS #IMM8 JSRS #IMM8MOV.B:S #IMM,dest (However, dest = A0/A1)• Instructions other than those listed aboveFigure 2.12.1. Unexecuted instructions and corresponding stacked addresses(4) How to determine an address match interruptAddress match interrupts can be set at two different locations. However, both location will have thesame vector address. Therefore, it is necessary to determine which interrupt has occurred; addressmatch interrupt 0 or address match interrupt 1. Using the content of the stack, etc., determine whichinterrupt has occurred according to the first part of the address match interrupt routine.430

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

Saved successfully!

Ooh no, something went wrong!