Question: 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


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
Get step-by-step solutions from verified subject matter experts
