Project
INEL 4206 Fall 2018
Project INEL 4206 Fall 2018 Project Description Ultimate - - PowerPoint PPT Presentation
Project INEL 4206 Fall 2018 Project Description Ultimate objective: build an arithmetic operations server that receives an ASCII string (through a serial port) that describes the desired operations. The server performs the math calculations and
INEL 4206 Fall 2018
Ultimate objective: build an arithmetic operations server that receives an ASCII string (through a serial port) that describes the desired operations. The server performs the math calculations and return the result in another string. Project: put together an early prototype of this server an MSP430 micro-controller using assembly language.
scope of the course, it will be stored in RAM.
calculation.
+, -, * or /.
reasonable number of instructions for each task.
A preliminary report outline follows. New sections may be added to satisfy ABET requirements.
detail using text, flow-charts, pseudo-code
#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 ORG 0200h mystr DB "This is a test"
newch DB 'I'
9
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 #mystr, R12 mov.b oldch, R13 mov.b newch, R14 call #chrep JMP $ ; jump to current location '$' NOP
10
; On string pointed by R12, replace character in R13 with ; that on R14 chrep: mov R12, R15 ; R12 = number of instances found mov #0, R12 ; initialize again: cmp.b #0, 0(R15) jeq done cmp.b @R15,R13 jeq rep jmp nextch rep: mov.b R14, 0(R15) inc r12 nextch: inc R15 jmp again done: ret
11