Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this task, students will improve the Str_copy procedure in Chapter 9 in textbook. Specifically, students are encouraged to look at the Str_copy and Str_length

image text in transcribed

image text in transcribed

In this task, students will improve the Str_copy procedure in Chapter 9 in textbook. Specifically, students are encouraged to look at the Str_copy and Str_length procedures in Chapter 9.3.2 and 9.3.3. The Str_copy procedure copies a null-terminated string from a source location to a target location. But, the Str_copy procedure does not limit the number of characters to be copied. In this task, it has to program to only allow to copy the specific number of characters Make a file "hw6_1 inc" and declare only following data in hw6_1.inc. The values of data will be changed when TAs test your code. strSrc BYTE "Assembly homework6", 0 strDest BYTE 41 dup(0) copyNum BYTE 10 NOTE: 1. The length of source string does not exceed 40 characters. 2. Source string should be NULL terminated. 3. If input string does not exceed 40 characters, copy the string to "strDest" and print it. 4. If input string is larger than 40 characters, do not print any output. 5. "copyNum" variable indicates the number of characters to copy. 6. Copying starts from the beginning of the "strSrc" string. 7. You can freely define procedures in your convenience. e.g) strSrc: "Assembly homework6", copyNum 10 C:W> s171234J In this task, students will improve the Str_copy procedure in Chapter 9 in textbook. Specifically, students are encouraged to look at the Str_copy and Str_length procedures in Chapter 9.3.2 and 9.3.3. The Str_copy procedure copies a null-terminated string from a source location to a target location. But, the Str_copy procedure does not limit the number of characters to be copied. In this task, it has to program to only allow to copy the specific number of characters Make a file "hw6_1 inc" and declare only following data in hw6_1.inc. The values of data will be changed when TAs test your code. strSrc BYTE "Assembly homework6", 0 strDest BYTE 41 dup(0) copyNum BYTE 10 NOTE: 1. The length of source string does not exceed 40 characters. 2. Source string should be NULL terminated. 3. If input string does not exceed 40 characters, copy the string to "strDest" and print it. 4. If input string is larger than 40 characters, do not print any output. 5. "copyNum" variable indicates the number of characters to copy. 6. Copying starts from the beginning of the "strSrc" string. 7. You can freely define procedures in your convenience. e.g) strSrc: "Assembly homework6", copyNum 10 C:W> s171234J

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why do countries trade? What are the benefits and costs of trade?

Answered: 1 week ago