Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives: 1. Declare and initialize null-terminated string 2. Apply indirect address 3. Write loop 4. Apply Irvine.inc library functions to display a string Problem Description:

image text in transcribed
image text in transcribed
Objectives: 1. Declare and initialize null-terminated string 2. Apply indirect address 3. Write loop 4. Apply Irvine.inc library functions to display a string Problem Description: Write a program with a loop and indirect address that copies a string from source to target. Revising the character order in the process. Use the following variables: source BYTE "This is the string that will be reversed", o target BYTE SIZEOF source DUP('#') You may refer to the Programming Exercise #7 on Page 138 of the textbook. Hint: You may study the book example "Copying a String" on page 127 first. However, this project has three different things from the book's example. 1. You need two index register. One for the index of source, another for index of target. You can use Register ESI for index of source and Register EDI for index of target 2. You will not copy the last character in source, which is null character the terminator of source string). So the initial value of ESI shall be set as OFFSET target - 2 since the target string is stored right after the source string in memory 3. After the loop, you need add null character to the end of the target string How to View Output: After Chapter Five, you will be able to write statement to print out the output on screen. So far, you need to see output in memory. After your project can be assembled and run successfully, you may do following things: 1. Click on the grey bar located on the left of side of the "invoke Exit Process, 0" statement to set up the Break Point I. S Invoke Excitrocess, 2. Go to Debug and click on Start Debugging 3. Go to Debug -> Windows -> Memory -> Memory 1 (or: ALT + 6). You will see a window on the right side of your code. Type 0x004068D0 in Address field and you will see the following window (next page). If you don't see the source string, then your computer may store data section in difference memory location. You may need to search to find it. If you see the source string but the string after it is urce string, then your program has logic errors. 4. After check the result, press F10 to continue and finish the program execution. Due Date: You need to turn in YourNameProj4.asm via Blackboard. Due date will be announced on Blackboard. [Memory 1 [ 4 X Address: 0x004068DO x468 54 68 69 73 20 69 73 20 74 68 65 20 73 This is the s x468D 74 72 69 6e 67 20 74 68 61 74 2 77 59 tring that wi x468A 6c 6c 2 62 65 2 72 65 76 65 72 73 65 ll be reverse x468F7 64 64 65 73 72 65 76 65 72 2 65 62 d.desrever eb x4694 20 6c 6c 69 77 20 74 61 68 74 2 67 6e 1liw taht gn 46911 69 72 74 73 20 65 68 74 20 73 69 20 73 irts eht si s 4691 69 68 54 ih......... . x4692 x46938 46945 x46952 x4695 x4696 [x46979 x46986 [46993 [x469 x469A x469 4697 x469 x4691 x469 x469F xx426A8 _ Autos Locals Memory 1 Registers Threads Modules Watch 1 Diagnostic Tools Objectives: 1. Declare and initialize null-terminated string 2. Apply indirect address 3. Write loop 4. Apply Irvine.inc library functions to display a string Problem Description: Write a program with a loop and indirect address that copies a string from source to target. Revising the character order in the process. Use the following variables: source BYTE "This is the string that will be reversed", o target BYTE SIZEOF source DUP('#') You may refer to the Programming Exercise #7 on Page 138 of the textbook. Hint: You may study the book example "Copying a String" on page 127 first. However, this project has three different things from the book's example. 1. You need two index register. One for the index of source, another for index of target. You can use Register ESI for index of source and Register EDI for index of target 2. You will not copy the last character in source, which is null character the terminator of source string). So the initial value of ESI shall be set as OFFSET target - 2 since the target string is stored right after the source string in memory 3. After the loop, you need add null character to the end of the target string How to View Output: After Chapter Five, you will be able to write statement to print out the output on screen. So far, you need to see output in memory. After your project can be assembled and run successfully, you may do following things: 1. Click on the grey bar located on the left of side of the "invoke Exit Process, 0" statement to set up the Break Point I. S Invoke Excitrocess, 2. Go to Debug and click on Start Debugging 3. Go to Debug -> Windows -> Memory -> Memory 1 (or: ALT + 6). You will see a window on the right side of your code. Type 0x004068D0 in Address field and you will see the following window (next page). If you don't see the source string, then your computer may store data section in difference memory location. You may need to search to find it. If you see the source string but the string after it is urce string, then your program has logic errors. 4. After check the result, press F10 to continue and finish the program execution. Due Date: You need to turn in YourNameProj4.asm via Blackboard. Due date will be announced on Blackboard. [Memory 1 [ 4 X Address: 0x004068DO x468 54 68 69 73 20 69 73 20 74 68 65 20 73 This is the s x468D 74 72 69 6e 67 20 74 68 61 74 2 77 59 tring that wi x468A 6c 6c 2 62 65 2 72 65 76 65 72 73 65 ll be reverse x468F7 64 64 65 73 72 65 76 65 72 2 65 62 d.desrever eb x4694 20 6c 6c 69 77 20 74 61 68 74 2 67 6e 1liw taht gn 46911 69 72 74 73 20 65 68 74 20 73 69 20 73 irts eht si s 4691 69 68 54 ih......... . x4692 x46938 46945 x46952 x4695 x4696 [x46979 x46986 [46993 [x469 x469A x469 4697 x469 x4691 x469 x469F xx426A8 _ Autos Locals Memory 1 Registers Threads Modules Watch 1 Diagnostic Tools

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions