Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 (50 marks) A string is an array representing a sequence of characters. To store a string of n characters in your program, you

image text in transcribedQUESTION 1 (50 marks) A string is an array representing a sequence of characters. To store a string of n characters in your program, you need to set aside n+1 bytes of memory. This allocated memory will contain the characters in the string, plus one extra special characterthe null characterto mark the end of the string. The null character is a byte whose bits are all zeros (0x00). The actual string consists of any group of characters, which none of them can be the null character. Draw a detailed flowchart and write an ARM assembly language program to copy a null terminated STRING1 to a null terminated STRING2, after removing any occurrences of the word the in STRING1. I.e., if STRING1 is the woman and The man said the then STRING2 would become woman and The man said . However, if STRING1 is and they took breathe then STRING2 would become and they took breathe without any change. You can assume that STRING2 will be less than 255 characters. Your code should be highly optimized. Use as few instructions as possible (as little as 30 assembly instructions only, NOT including assembly directives or data definitions)!!. Define the data of this program in a separate DATA area. Define the strings as follow: STRING1 DCB "and the man said they must go" EoS DCB 0x00 STRING2 space 0xFF ;String1 ;end of string1 ;just allocating 255 bytes More test cases: "the the the 123 """" "the" "" the"" 123 " "The" "The" "them the the1" "them the1"

QUESTION 1 59 marsn asequences ntain the characters in he eas (0xo) The A string is an array representing a sequence of characters. To store a string of n characters in your program, you need to set aside n+1 bytes of memory. This allocated memory will contain the characters in the string, plus one extra special characterthe null character-to mark the end of the string. The null character is a byte whose bits are all zeros (0x00). The actual string consists of any group of characters, which none of them can be the null character Draw a detailed flowchart and write an ARM assembly language program to copy a null terminated STRING1 to a null terminated STRING2, after removing any occurrences of the word "the" in STRINGI. 1.., if STRING! S "the woman and The man said the" then STRING2 would become"woman and The man said However, if STRING1 is "and they took breathe" then STRING2 would become "and they took breathe" without any change. You can assume that STRING2 will be less than 255 characters Your code should be highly optimized. Use as few instructions as possible (as little as 30 assembly instructions only. including assembly directives or data finitions)!! Define the data of this program in a separate DATA area. Define the strings as follow: STRING1 DCB "and the man said they must go" EoS STRING2 space 0xFF ;Stringl DCB Ox00 end of stringl ;just allocating 255 bytes More test cases: "the the the 123 the" - " 123 11 T "the" "The" The" "them the the1" "them thel" QUESTION 1 59 marsn asequences ntain the characters in he eas (0xo) The A string is an array representing a sequence of characters. To store a string of n characters in your program, you need to set aside n+1 bytes of memory. This allocated memory will contain the characters in the string, plus one extra special characterthe null character-to mark the end of the string. The null character is a byte whose bits are all zeros (0x00). The actual string consists of any group of characters, which none of them can be the null character Draw a detailed flowchart and write an ARM assembly language program to copy a null terminated STRING1 to a null terminated STRING2, after removing any occurrences of the word "the" in STRINGI. 1.., if STRING! S "the woman and The man said the" then STRING2 would become"woman and The man said However, if STRING1 is "and they took breathe" then STRING2 would become "and they took breathe" without any change. You can assume that STRING2 will be less than 255 characters Your code should be highly optimized. Use as few instructions as possible (as little as 30 assembly instructions only. including assembly directives or data finitions)!! Define the data of this program in a separate DATA area. Define the strings as follow: STRING1 DCB "and the man said they must go" EoS STRING2 space 0xFF ;Stringl DCB Ox00 end of stringl ;just allocating 255 bytes More test cases: "the the the 123 the" - " 123 11 T "the" "The" The" "them the the1" "them thel

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago