Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ARM assembly language cortex-m0 Extract Alphabetical characters from a String Array and Sort them in ascending order Create your own string array as follows: Full

ARM assembly language cortex-m0

Extract Alphabetical characters from a String Array and Sort them in ascending order

  • Create your own string array as follows:

Full name : StarID

Example: Arm Assembly: ab7328cd

  • Extract alphabetical characters from the string array and store them into memory with its first element pointed by R5 (R5=0x40000100)
    • Look at ASCII table to find the ASCII value for different characters.
  • Using the insertion sort algorithm, sort the alphabetical characters stored in the memory pointed by R5 in ascending order (min to max).
    • The sorted characters must be stored in memory with its first element pointed to by R5 and should not contain numeric characters.
    • The program must be able to work for ANY size array

Code template:(you can modify the template if needed)

AREA FLASH, CODE, READONLY ENTRY EXPORT __main EXPORT SystemInit ; System Init routine SystemInit

sizeOfItem EQU 1 ;sizeOf(byte) = 1

srcArrayAddr RN 7 lenAddr RN 5

destArrayAddr RN 6

__main

init

LDR lenAddr, =len3 ;length of the given array LDR srcArrayAddr, =array3 ;the memory address of ;the first element (number) of the given array

LDR destArrayAddr, =0x40000100 ;memory location (address) used ;for keeping the SORTED array

;;; More initialization here ;;; copyArray LDRB R0, [R7] ;load R0 with 1 character from string array ADDS R7, R7, #1 ; increase the address pointed by R7 STRB R0, [R6] ;STORE one-byte from R0 (last 8 bits) into memory at the ;address pointed to by R6 ADDS R6, R6, #1

;;; Copy data in srcArrayAddr to destArrayAddr ;;; Only need to perform this once doWork

;;; Your code goes here

done B done ;Done

;;;;;;;;;;;;;;; The given array (at the lab check-off, your code should work for both arrays) len1 DCB 8 array1 DCB -87, 69, 0, -128, -1, 100, 43, 12

len2 DCB 8 array2 DCB 54, -119, 8, -39, 1, -93, 21, 127

Len3 DCB 22 Array3 DCB "Arm Assembly: ab7328cd",0

END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

To find integral of sin(logx) .

Answered: 1 week ago

Question

What is Centrifugation?

Answered: 1 week ago