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

Explain digital multiplexers, Problem 1 Perform the following conversio...

Problem 1 Perform the following conversion a. (ABE) 16 =() 2 b. (101011) 2 =() 10 2 Explain how full adder adds three bits 3 Explain digital multiplexers

What is evaluating information system investments, 1. What is Evaluating In...

1. What is Evaluating Information System Investments? 2. Is IS evaluation different to evaluation of other investments? 3. What approaches are used to evaluate IS investments

Write a program to swap two names between two variables, QUESTION (a) W...

QUESTION (a) Write a program to swap two names between two variables for examples: N1 = "Mary Anne" N2 = "Queen Mary". The program should make use of an appropriate Fu

Digital computer, Digital computer: In the digital computer there are b...

Digital computer: In the digital computer there are basically two types of input, namely Instructions, and Data from the various radio and non-radio sensors, which will be refe

Explain the construction of hard drive, Question 1 Classify and explain th...

Question 1 Classify and explain the different types of computers Question 2 List and explain the commonly used input devices Question 3 What is binary number system? Exp

ToDoMenu, In this assignment, you should create a class called ToDoMenu whi...

In this assignment, you should create a class called ToDoMenu which has a main method that contains the code that implements a command-line menu for managing a collection of ToDoIt

#title.flow chart., akrenda club has just opened their jym and pools servic...

akrenda club has just opened their jym and pools services. They need a system that can keep record of total sales of each. The club has silver and gold members. The silver members

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