| 123456789101112131415161718192021222324252627282930313233 |
- ;export symbols
- XDEF RTI_ISR
- XREF __SEG_END_SSTACK,TON,TOFF,PRESSED,PORT_T,COUNTER
-
- RTI_ISR:
- TheInterruptMain:
- LDAA COUNTER ;load the counter from the instructions into Acc. A
- INCA ;increment A
- STAA COUNTER ;now the counter has been incremented
- CMPA TON ;compare the (already incremented) counter to TON
- BLE SetTAndReturn ;branch if less than or equal to TON
- ;continue if the count is greater then TON
- CMPA #15 ;check if the count (still in A) is less than or equal to 15
- BLE ClearTAndReturn ;branch if Acc. A (the count) is less than or equal to 15
- ;continue if the count is greater than 15
- BCLR COUNTER,#$FF ;clear the count
- BRA Return ;exit the interrupt routine
-
- ClearTAndReturn:
- BCLR PORT_T,#%00001000 ;clear bit 3 of Port T
- BRA Return ;exit the interrupt
- SetTAndReturn:
- BSET PORT_T,#%00001000 ;set bit 3 of Port T
- BRA Return ;exit the interrupt routine
-
- Return:
- RTI
-
-
-
|