Write this ARM assemble language program, Basic Computer Science

Assignment Help:
Programming Assignment
CS252 Spring 2014

Write an ARM assembly language subroutine that performs according to the following specification (Caesar cypher).

Given a mixed case alphabetic string from the C driver program, convert it to all upper case and create a new string for return to the C program. The new string has the characters from the old string replaced by upper case characters from the alphabet offset by the given amount in the alphabet.

If the character string is ‘Abc’ with an offset of -3 the new string would be ‘XYZ’. For characters in the alphabet such as ‘mno’, the alphabet is ‘JKL’. The beginning of the alphabet is wrapped to the end.

To convert a character to upper case, AND the character with 0xDF. Do not process the space character (leave it as a space) or the NULL byte terminator but be sure to include the NULL byte in the new string.

The C driver code:
/* C code for cipher */
#include
#include

extern char * cypher( char * s, int offset ) ;

int main( int argc, char * argv[] )
{
?char string[] = "The quick brown fox jumped over the lazy dog" ;
?char * result ;
?int offset = -5 ;

?result = cypher( string, offset ) ;
?printf( "Original:%s\n", string ) ;
?printf( "Coded: %s\n", result ) ;
?
?exit( 0 ) ;
}

The assembly routines definition is:
?extern char * cypher( char * s, int offset )
?where?char * s is the pointer to the string,
?int offset is the integer distance to move
?returns a pointer to a string.

To determine the length of the string in order to reserve space for the new string use the library routine strlen. Register a1 contains a pointer to the string to measure and on return register a1 has the number of characters in the string. You need to add one to this result since strlen does not account for the null byte at the end.
You can pass this length to the malloc library routine to obtain space for the new string.

Related Discussions:- Write this ARM assemble language program

Accessing folders and printers, Accessing Folders and Printers Accessi...

Accessing Folders and Printers Accessing folders, files and printers of another computer is as easy as accessing another computer. To access folders and printers of another c

Algorithms and flowcharts, write algorithm and draw flowchart to check whet...

write algorithm and draw flowchart to check whether the given number is palindrome or not

Technology partnerships, Technology Partnerships: Such agreements prov...

Technology Partnerships: Such agreements provide the consumer un-limited access to vendor's technology. Such contracts are typically multi-year in nature where the consumer pa

Introduction to FCB , There are two kinds of FCB, the normal, whose length...

There are two kinds of FCB, the normal, whose length is 37 bytes and the expanded one of 44 bytes. The FCB is created of data given by the programmer and by data which it takes dir

Turn-around, The term ‘page traffic’ describes

The term ‘page traffic’ describes

Powerpoint presentation of qualitative analysis approaches, Compare and con...

Compare and contrast two qualitative analysis approaches. You must select two that are a true contast eg  CAQADS (say leximancer ) v discourse analysis or thematic analysis by hand

Assembly language, Assembly language : Assembly language is a low level...

Assembly language : Assembly language is a low level programming language similar to machine language, but far easier to write and understand because machine language binary in

Subroutine and functions, Subroutine and Functions:  In a program, it ...

Subroutine and Functions:  In a program, it is often necessary to repeat a statement or group of statements at several points to accomplish a particular task. Repeating the sa

CIS247 week6 Lab., Modify the class declaration of the Employee class to sp...

Modify the class declaration of the Employee class to specify that the Employee class is an abstract class Declare an abstract method called CalculateNetPay that returns a double v

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd