.global main main: /* disable watchdog */ mov.w #23168, &WDTCTL /* initialisation de la diode rouge */ mov.b #1, &34 mov #1, R5 /* boucle principale: changement etat LED */ loop: xor #1, R5 mov.b R5, &33 mov #65450, R4 /* appel à la fonction wait */ call #wait jmp loop ;; wait function /* uses R4 and R5 pour attendre 5*60000 cycle*/ wait: push R4 push R5 mov #60000, R4 mov #0, R5 wait2: inc R5 wait1: dec R4 jnz wait1 cmp #5, R5 jne wait2 /* restaure R4 et R5 */ pop R5 pop R4 ret