ASSEMBLY LANGUAGE PROGRAMMING
Write the program for the 8th exercise ( copy string backwards) on page 138 of your book:
8. Copy a String Backwards
Write a program using the LOOP instruction with indirect addressing that copies a string from
source to target, reversing the character order in the process. Use the following variables:
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#')
Insert the following statements immediately after the loop to display the hexadecimal contents
of the target string:
mov esi,OFFSET target ; offset of variable
mov ebx,1 ; byte format
mov ecx,SIZEOF target ; counter
call DumpMem
If your program works correctly, it will display the following sequence of hexadecimal bytes:
67 6E 69 72 74 73 20 65 63 72 75 6F 73 20 65 68
74 20 73 69 20 73 69 68 54
(The DumpMem procedure is explained in Section 5.3.2.) (A VideoNote for this exercise is posted
on the Web site.)
Also count the number of words in the string. You must display the reversed string and the number of words. To display a string and a number, you can use the The Irvine library functions as explained in the chapter 5 section 4.
Hint: You can look for Ascii value 32 which represents the space in the string.
9 years ago
10
- statistics questions 4
- You currently work as a coordinator for New City Home Care, a private home health company offering nursing care and therapy services to the elderly residents of a medium-sized Midwestern city with a population of about 55,000 people. The neighboring town,
- Week 3-Let's Talk Money Interview Transcript
- Cause and effect essay in Engl
- i have to answer 4 essay questions (250-350 words) in ethics for my midterm for example What is just war therory...
- POS 371 Week 3 Learning Team Assignment Pseudocode
- NTC 362 Week 3 Learning Team Assignment- Protocol Paper - Copy
- MGT 437 Week 4 Individual Assignment - Team Creation Paper
- Critical Thinking Explained
- Who Need Theology? " Ken Man only"