"> (Answered) ;- ; MSP430 Assembler Code Template for use with TI Code Composer... - Tutorials Prime

Question Details

(Answered) ;------------------------------------------------------------------------------- ; MSP430 Assembler Code Template for use with TI Code Composer...


;------------------------------------------------------------------------------- ; MSP430 Assembler Code Template for use with TI Code Composer...


lowest to highest value array MSP430 Assembly I"m trying to build a code that sorts the arrays from lowest to highest value using an algorithmCan't get the whole array to organize into least to greatest;-------------------------------------------------------------------------------

 

; MSP430 Assembler Code Template for use with TI Code Composer Studio

 

;-------------------------------------------------------------------------------

 

.cdecls C,LIST,"msp430.h"

 

; Include device header file

 

.def RESET

 

.text

 

; Assemble into program memory

 

.retain

 

; Override ELF conditional linking and

 

retain current section

 

.retainrefs

 

; Additionally retain any sections that have

 

references to current section

 

;-------------------------------------------------------------------------------

 

RESET

 

mov.w

 

#__STACK_END,SP

 

; Initialize stackpointer

 

StopWDT

 

mov.w

 

#WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer

 

;-------------------------------------------------------------------------------

 

;-----

 

Your Sorting lab starts here -------------------------------------------

 

;Memory allocation of arrays must be done prior to the RESET & StopWDT ARY1 .set 0x0200 ;Memory allocation

 

ARY1

 

ARY1S

 

.set

 

0x0210

 

;Memory allocation

 

ARYS

 

ARY2

 

.set

 

0x0220

 

;Memory allocation

 

ARY2

 

ARY2S

 

.set

 

0x0230

 

;Memory allocation

 

AR2S

 

clr

 

R4

 

;Clear Register

 

clr

 

R5

 

;Clear Register

 

clr

 

R6

 

;Clear Register

 

SORT1

 

mov.w #ARY1,

 

R4

 

;Intialize R4 to poin to ARY1

 

in the

 

memory

 

mov.w #ARY1S,

 

R6

 

;Intialize R6 to poin to ARY1S in

 

the memory where the sorted ARY1 will be stored

 

call

 

#ArraySetup1

 

;Creat elements are store them in ARY1

 

call #COPY

 

;Copy the elements from the ARY1 space

 

to ARY1S space

 

mov.b

 

@R4+, R7

 

call

 

#SORT

 

;Calling Subroutine Sort with

 

parameter passing in R4 abd R6

 

SORT2

 

mov.w #ARY2,

 

R4

 

;Intialize R4 to poin to ARY2

 

in the

 

memory

 

mov.w #ARY2S,

 

R6

 

;Intialize R6 to poin to ARY2S in

 

the memory where the sorted ARY2 will be stored

 

call

 

#ArraySetup2

 

;Creat elements are store them in ARY2

 

call #COPY

 

;Copy the elements from the ARY2 space

 

to ARY1S space

 

call

 

#SORT

 

;Calling Subroutine Sort with

 

parameter passing in R4 abd R6

 

Mainloop

 

jmp

 

Mainloop

 

;loop in place for ever

 

;Array element intitialization Subroutine

 

ArraySetup1 mov.b #10,

 

0(R4) ;Define the number of elements in the array

 

mov.b #20, 1(R4) ;store an element

 

mov.b #89, 2(R4) ;store an element

 

mov.b #-5, 3(R4) ;store an element

 

mov.b #13, 4(R4) ;store an element

 

mov.b #63, 5(R4) ;store an element

 

mov.b #-1, 6(R4) ;store an element

 

mov.b #-88, 7(R4) ;store an element

 

mov.b #2,

 

8(R4) ;store an element

 

mov.b #-88, 9(R4) ;store an element

 

mov.b #-1, 10(R4)

 

;store an element

 

ret

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Jan 02, 2020

EXPERT

Tutor

ANSWER RATING

YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now
WP2Social Auto Publish Powered By : XYZScripts.com