#include "msp430.h" ; #define controlled include file
NAME main ; module name
PUBLIC main ; make the main label vissible
; outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE' segment
init: MOV #SFE(CSTACK), SP ; set up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer
mov #32h,r4
mov #42h,r5
mov #52h,r6
clr r9
mov.w @r4,r7
add.w @r5,r7
mov.w r7,0(r6)
jc skp
mov #1h,r9
skp: decd.w r4
decd.w r5
decd.w r6
mov.w @r4,r7
add r9,r7
addc.w @r5,r7
mov.w r7,0(r6)
JMP $ ; jump to current location '$'
; (endless loop)
END
Comments
Post a Comment