Programming Exercise 2 :- COPY A STRING IN REVERSE ORDER Write a program with a loop and indirect addressing that copies a string from source to target, reversing the character order in the process. You MUST use the exact data block, memory allocation and initialization, as shown in the followings for testing - for showing that your code would not over-write the original data at the head(4 '$'s) middle(4 '%'s) and tail(4 '^'s): BYTE 4 DUP('S') source BYTE "This is the source string",0 BYTE 4 DUP (*%*) target BYTE SIZEOF source DUP ('#') BYTE 4 DUP (*^*) Hint: Should Not copy the null character, O, at the end of the source string to the front of the target string. And, finish writing the target string by writing the null character, O, to the last byte - replacing the last '#' there. In the output of the program, both the source and target (reversed) strings should be shown, by calling the Irvine peripheral procedure(s). Use the following test code to display the Whole Data Bank: ; display the 4 "S" and source string mov edx, OFFSET source-4 call WriteString mov edx, OFFSET target-4 call WriteString mov edx, OFFSET target+SIZEOF target ; display the 4 "A call WriteString ; display the 4 "%" and target string IMPORTANT: for this exercise, NOT allowable to use any one of these directives: .IF, .ELSE, .ELSEIF, .WHILE, .REPEAT, etc

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

assmbly language please.     Proof of your solutions and test results: To show the operation of your program and to verify results from execution, you should use procedures WriteString, WriteInt, DumpMem and DumpReg, whichever applicable for a particular exerciseto display the results.please Make sure the library file Irvine32.inc is included on top of your program; this .inc file includes all the procedures mentioned above, and more. And ntegrate the calls to these procedures to output the results onto the console.

 

COPY A STRING IN REVERSE ORDER

Write a program with a loop and indirect addressing that copies a string from source to targetreversing the character order in the process. You MUST use the exact data block, memory allocation and initialization, as shown in the followings for testing - for showing that your code would not over-write the original data at the head(4 '$'s) middle(4 '%'s) and tail(4 '^'s):

BYTE 4 DUP('$')
source BYTE "This is the source string",0
BYTE 4 DUP('%')
target BYTE SIZEOF source DUP('#')
BYTE 4 DUP('^')

Hint: Should Not copy the null character, 0, at the end of the source string to the front of the target string. And, finish writing the target string by writing the null character, 0, to the last byte - replacing the last '#' there.

In the output of the program, both the source and target(reversed) strings should be shown, by calling the Irvine peripheral procedure(s). Use the following test code to display the Whole Data Bank:

 

   mov edx, OFFSET source-4      ; display the 4 "$" and source string
   call WriteString
   mov edx, OFFSET target-4      ; display the 4 "%" and target string
   call WriteString
   mov edx, OFFSET target+SIZEOF target   ; display the 4 "^"
   call WriteString

IMPORTANT: for this exercise, NOT allowable to use any one of these directives: .IF, .ELSE, .ELSEIF, .WHILE, .REPEAT, etc

 

 

Programming Exercise 2 :-
COPY A STRING IN REVERSE ORDER
Write a program with a loop and indirect addressing that copies a string from source to target, reversing the character order in the process. You MUST use the
exact data block, memory allocation and initialization, as shown in the followings for testing - for showing that your code would not over-write the original
data at the head(4 '$'s) middle(4 '%'s) and tail(4 '^'s):
BYTE 4 DUP('$')
source BYTE "This is the source string",0
BYTE 4 DUP ('%')
SIZEOF
SIZEOF source DUP ('#')
source
target BYTE
BYTE 4 DUP('^')
Hint: Should Not copy the null character, O, at the end of the source string to the front of the target string. And, finish writing the target string by writing the
null character, O, to the last byte - replacing the last '#' there.
In the output of the program, both the source and target(reversed) strings should be shown, by calling the Irvine peripheral procedure(s). Use the following test
code to display the Whole Data Bank:
mov edx, OFFSET source-4
call WriteString
mov edx, OFFSET target-4
call WriteString
mov edx, OFFSET target+SIZEOF target ; display the 4 "^"
call WriteString
; display the 4 "$" and source string
; display the 4 "%" and target string
IMPORTANT: for this exercise, NOT allowable to use any one of these directives: .IF, .ELSE, .ELSEIF, .WHILE, .REPEAT, etc
Transcribed Image Text:Programming Exercise 2 :- COPY A STRING IN REVERSE ORDER Write a program with a loop and indirect addressing that copies a string from source to target, reversing the character order in the process. You MUST use the exact data block, memory allocation and initialization, as shown in the followings for testing - for showing that your code would not over-write the original data at the head(4 '$'s) middle(4 '%'s) and tail(4 '^'s): BYTE 4 DUP('$') source BYTE "This is the source string",0 BYTE 4 DUP ('%') SIZEOF SIZEOF source DUP ('#') source target BYTE BYTE 4 DUP('^') Hint: Should Not copy the null character, O, at the end of the source string to the front of the target string. And, finish writing the target string by writing the null character, O, to the last byte - replacing the last '#' there. In the output of the program, both the source and target(reversed) strings should be shown, by calling the Irvine peripheral procedure(s). Use the following test code to display the Whole Data Bank: mov edx, OFFSET source-4 call WriteString mov edx, OFFSET target-4 call WriteString mov edx, OFFSET target+SIZEOF target ; display the 4 "^" call WriteString ; display the 4 "$" and source string ; display the 4 "%" and target string IMPORTANT: for this exercise, NOT allowable to use any one of these directives: .IF, .ELSE, .ELSEIF, .WHILE, .REPEAT, etc
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education