Find Jobs
Hire Freelancers

Assembly language code in ARC

$-1-4 USD

Closed
Posted about 22 years ago

$-1-4 USD

Paid on delivery
Assembly language code in ARC (simplified SPARC code). ## Deliverables In the main program, you CAN NOT load all of the array into the registers. You can only work with two elements of the array at a time. You can shorten the swap subroutine, by skipping the temporary (called temp) variable (since registers act as temporary variables anyway), if you want to. You must comment your code. Lastly, the swap subroutine must store the value of register 15 into a variable, as shown in class and store the array elements back into memory in the subroutine. main () { int a[10] = {10,8,6,4,2,9,7,5,3,1}; int I,j; for (I=0; I<10; ++I) { for (j=0; j<9; ++j) { if (a[ j ] > a[ j+1 ]) { swap (); } } } } swap () { int temp; temp = a[ j ]; a[ j ] = a[ j+1]; a[ j+1] = temp; } Part 2: main () { int a[10], I, j; for (I=0; I<10; I++) { if (I==0) { j =I; sub3; } else if (I <=5){ sub2; } else { sub1; } } } sub1 () { j = I *2; if ( j>=2 ) { sub3; } else { j = 0; sub3; } } sub2 () { j = I/2; if (j <3) { j = 0; sub3; } else { sub3; } } sub3 () { a[I] = I +j; } ## Platform Assembly language code in ARC (simplified SPARC code).
Project ID: 2847884

About the project

Remote project
Active 22 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED STATES
United States
4.9
6
Member since Sep 13, 2001

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.