Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Translate the pseudo-code shown below into ARM Assembly Language. The pseudo-code describes an algorithm that will sort the elements of an array do swapped =

Translate the pseudo-code shown below into ARM Assembly Language. The pseudo-code describes an algorithm that will sort the elements of an arrayimage text in transcribedimage text in transcribed

do swapped = false; for (i = 1; i array[i]). tmpswap = array[i-1]; array[i 1] = array[i]; array[i] = tmpswap; swapped = true; } while (swapped); N EQU 10 AREA globals, DATA, READWRITE ; N word-size values SORTED SPACE N*4 ; N words (4 bytes each) AREA ENTRY RESET, CODE, READONLY ; copy the test data into RAM LDR R4, =SORTED LDR RS, UNSORT LDR R6, =0 whInit CMP R6, #N BHS eWhInit LDR R7, [R5, R6, LSL #2] STR R7, [R4, R6, LSL #2] ADD R6, R6, #1 B whInit eWhInit LDR R4, =SORTED LDR R5, =UNSORT ; your sort subroutine goes here UNSORT DCD 9,3,0,1,6,2,4,7,8,5 STOP B STOP END do swapped = false; for (i = 1; i array[i]). tmpswap = array[i-1]; array[i 1] = array[i]; array[i] = tmpswap; swapped = true; } while (swapped); N EQU 10 AREA globals, DATA, READWRITE ; N word-size values SORTED SPACE N*4 ; N words (4 bytes each) AREA ENTRY RESET, CODE, READONLY ; copy the test data into RAM LDR R4, =SORTED LDR RS, UNSORT LDR R6, =0 whInit CMP R6, #N BHS eWhInit LDR R7, [R5, R6, LSL #2] STR R7, [R4, R6, LSL #2] ADD R6, R6, #1 B whInit eWhInit LDR R4, =SORTED LDR R5, =UNSORT ; your sort subroutine goes here UNSORT DCD 9,3,0,1,6,2,4,7,8,5 STOP B STOP 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_2

Step: 3

blur-text-image_3

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions