.text ; program start
.global _main ; define entry point
_main:
NOP
mov.w #WDTPW+WDTHOLD,&WDTCTL ; stop watchdog timer
;Set the I/O port that controls the RED LED to an output.
; To do this set bit 0 in the P1DIR register. Leave all
; all other I/O lines as inputs
bis.b #0000001b,&P1DIR
mov.a #1000000, R5
Mainloop:
NOP
bic.b #00000001b,&P1OUT ; clear P1.0 which will turn off
; the RED LED.
call #HalfSecondDelay
bis.b #00000001b,&P1OUT ; set P1.0 which will turn on the
; RED LED.
jmp Mainloop; jump to the Mainloop label
nop
HalfSecondDelay:
sub.a #1, R5
jnz HalfSecondDelay
ret