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

Features of python, • Easy-to-learn: Python has comparatively few keywords,...

• Easy-to-learn: Python has comparatively few keywords, easy structure, and a clearly distinct syntax. This permits the student to pick up the language in a comparatively short per

Explain briefly about das, Question 1 What is Content Addressable Storage?...

Question 1 What is Content Addressable Storage? Explain the elements of Content Addressable Storage Question 2 Explain briefly about DAS Question 3 Explain about N

What are the three basic security provided by ssl, QUESTION (a) Can SSL...

QUESTION (a) Can SSL be used to encrypt email data? Justify your answer (b) What are the three basic security provided by SSL? (c) State the port number used by applicati

Science, Ask question #Minimum 100 words accepted/

Ask question #Minimum 100 words accepted/

Data buses, Data buses: The availability of reliable digital semi-condu...

Data buses: The availability of reliable digital semi-conductor technology has enabled the inter-communication task between different equipment to be significantly improved. P

Language of digital computers, Language of Digital Computers: Digital ...

Language of Digital Computers: Digital computers are electronic devices which operate on two valued logic (On and OFF). The ability of a transistor to act as a switch is the k

Constant bit rate atm theory, For the connections that request a static amo...

For the connections that request a static amount of bandwidth that is continuously available during the connection lifetime. Is intended to support real time applications requiring

TREES, construct a tree where preorder is ABCDFGE

construct a tree where preorder is ABCDFGE

What are anti-patterns, QUESTION Developers spend much more time extend...

QUESTION Developers spend much more time extending and changing code than they did originally while developing it. (a) As a team leader, illustrate how you will introduce to

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