Lab0 - Code for lab 0 PDF

Title Lab0 - Code for lab 0
Course Intro Microprocessor Systems
Institution Florida Atlantic University
Pages 3
File Size 38 KB
File Type PDF
Total Downloads 99
Total Views 145

Summary

Code for lab 0...


Description

;------------------------------------------------------------------------------; MSP430 Assembler Code Template for use with TI Code Composer Studio ; ; ;------------------------------------------------------------------------------.cdecls C,LIST,"msp430.h"

; Include device header file

;------------------------------------------------------------------------------.def

RESET

; Export program entry-point to ; make it known to linker.

;------------------------------------------------------------------------------.text

; Assemble into program memory.

.retain

; Override ELF conditional linking ; and retain current section.

.retainrefs

; And retain any sections that have ; references to current section.

;------------------------------------------------------------------------------RESET StopWDT

mov.w mov.w

#__STACK_END,SP

; Initialize stackpointer

#WDTPW|WDTHOLD,&WDTCTL

;------------------------------------------------------------------------------; Main loop here ;-------------------------------------------------------------------------------

; Stop watchdog timer

LAB1

LINEA

LINEB

LINEC

mov.w

#01,&0200h

;set a number on location $0200

mov.w

#02,&0202h

;set a number on location $0202

mov.w

#03,&0204h

;set a number on location $0204

clr

R7

;clear the entire R7 register

clr

R8

;clear the entire R8 register

clr

R9

;clear the entire R9 register

clr

R10

;clear the entire R10 register

mov.w &0200h, R7

;copy a word from &0200h to R7

mov.w &0202h, R8

;copy a word from &0202h to R8

mov.w &0204h, R9

;copy a word from &0204h to R9

mov.b R7, R10

;Start accumulatior R10 with R7 value

add.b R8, R10

;add to it the content R8

add.b R9, R10

;add to it the content R9

mov.b R10,&0206h

Mainloop

jmp

Mainloop

;now store the sum in L

;Infinite Loop

;------------------------------------------------------------------------------; Stack Pointer definition ;-------------------------------------------------------------------------------

.global __STACK_END .sect

.stack

;------------------------------------------------------------------------------; Interrupt Vectors ;------------------------------------------------------------------------------.sect

".reset"

.short

RESET

; MSP430 RESET Vector...


Similar Free PDFs