Here's the simple program I wrote to learn how RTIs work in assembly and is giving me such a fit. Maybe someone can see where I'm going wrong? I started with the ASM template CW provides and I added some to it. Once I get it to compile I will add more meat but for now I just want to learn how to make assignments.
; Include derivative-specific definitions
INCLUDE 'derivative.inc'
; export symbols
XDEF _Startup, main
; we export both '_Startup' and 'main' as symbols. Either can
; be referenced in the linker .prm file or from C/C++ later on
XREF __SEG_END_SSTACK ; symbol defined by the linker for the end of the stack
;******************************************************************************************
; variable/data section
LOOP EQU $64
LED1 EQU PTCD_PTCD0
LED2 EQU PTCD_PTCD1
SW1 EQU PTAD_PTAD2
ORG $FFCE
DC.W IRQT
MAIN_INIT:
;Initialize Micocontroller
LDA #$22
STA SOPT1
MOV #$FB, PTADD
MOV #$FF, PTBDD
MOV #$FF, PTCDD
MOV #$FF, PTDDD
MOV #$FF, PTCD
LDA #$04
STA PTAPE
LDA #$92
STA RTCSC
LDA #$7E
STA RTCMOD
RTS
; RTC Interrupt Routine
IRQT:
NOP
rti
main:
_Startup:
BSR MAIN_INIT
mainLoop:
SEI ; Disable Interrupts
CLR LOOP
CLI ; enable interrupts
BCLR PTCD_PTCD0,PTCD ; Turns on LED
LOOP1:
DEC LOOP
NOP
BNE LOOP1
BRA mainLoop