sayac .equ r10
indeks .equ r11
dizi .equ 0200h
veri .equ r12
.cdecls C,LIST, "msp430g2231.h"
;------------------------------------------------------------------------------
.text ; Program Start
;------------------------------------------------------------------------------
RESET mov.w #0280h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupPx bis.b #001h, &P1DIR
bis.b #040h, &P1DIR
bis.b #008h, &P1IE
bis.b #008h, &P1IES
bis.b #008h, &P1IFG
bis.b #040h, &P1OUT
clr r11
mov #0, r7
mov #7, r5
Mainloop bis.w #GIE,SR
geri nop
jmp geri
P1_ISR; Toggle P1.0 Output
inc r7
cmp r5, r7
jnc dal
bic.b #008h,&P1IFG
reti
dal xor.b #001h,&P1OUT
bic.b #008h,&P1IFG
reti
;------------------------------------------------------------------------------
; Interrupt Vectors
;------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET ;
.sect ".int02"
.short P1_ISR
.end
Ders: MikroişlemcilerProf. Dr. Bekir Tevfik Akgün