Motorola HC12 User Manual

Page of 328
User’s Manual
MCUez HC12 Assembler
226
Operating Procedures
MOTOROLA
Operating Procedures
Example:
          XDEF ResetFunc
DataSec: SECTION
Data:DS.W 5
;Each interrupt increments an element of table
CodeSec: SECTION
; Implementation of the interrupt functions
IRQFunc:
LDAB #0
BRA  int
XIRQFunc:
LDAB #2
BRA  int
SWIFunc:
LDAB #4
BRA  int
OpCodeFunc:
LDAB #6
BRA  int
ResetFunc:
LDAB #8
BRA  entry
DummyFunc:
RTI
int:
LDX  #Data
ABX
INC  0, X
RTI
entry:
LDS #$AFE
loop:BRA loop
VectorTable:SECTION
; Definition of the vector table
IRQInt:
DC.W IRQFunc
XIRQInt:
DC.W XIRQFunc
SWIInt:
DC.W SWIFunc
OpCodeInt:
DC.W OpCodeFunc
COPResetInt:
DC.W DummyFunc; No function attached to COP Reset
ClMonResInt:
DC.W DummyFunc; No function attached to Clock
; MonitorReset
ResetInt     : DC.W ResetFunc