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

Adding macros to ms word 2010 for a particular format, Project Setting up ...

Project Setting up Microsoft Word 2010 to automatically handle as much as possible of the NDSU Graduate School requirements for a disquisition. Accessible from the Graduate Schoo

Fhtjhnkjfdum, ryby db fgrh herbgh buyh hehg gvo hb bbithbs bgshbshdgbh bu...

ryby db fgrh herbgh buyh hehg gvo hb bbithbs bgshbshdgbh bubfvhb bs v h hjjg jdk jnmnv j

Impact printers and non - impact printers, Impact Printers and non - Impact...

Impact Printers and non - Impact Printers: Impact Printers: These are printers in which the print-head strikes a ribbon, and include the daisywheel and thimble printer

A brief introduction of python, Python is an interpreted, high-level, inter...

Python is an interpreted, high-level, interactive and object oriented-scripting language. Python was designed to be extremely readable which uses English keywords commonly where as

Explain se process model objective, Question 1 Explain attributes, propert...

Question 1 Explain attributes, properties, and characteristics of system Question 2 What do understand from Organizational Aspects of System Life Cycles? Explain Question

Information security, can someone balance between information security and ...

can someone balance between information security and access, if yes,how can they balance?

SG Fuel power supply, Where can I find power supply HIPRO HP-W460GC33 for S...

Where can I find power supply HIPRO HP-W460GC33 for Silicon Graphics Fuel computer

Pep8, Write an Assembly program that reads an integer (-32,768 through 32,7...

Write an Assembly program that reads an integer (-32,768 through 32,767) in decimal and prints its equivalent in binary. The output must show all 16 bits. And you must use a loop

Discrete Math, 3. Let f, g: R?R, where g(x) 1 - x + x2 and f (x)=ax + b. I...

3. Let f, g: R?R, where g(x) 1 - x + x2 and f (x)=ax + b. If (g ? f )(x)= 9x2 - 9x + 3, determine a, b.

Multiplexing, draw the diagram to implement 32*1 mux by using 3 relevant ty...

draw the diagram to implement 32*1 mux by using 3 relevant type of mux

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