can you check if the following code is correct for the following question and can you show me the screen shot of the out put. Thank you so much
; include the irvine library
INCLUDE Irvine32.inc
;Data section declare all the variables
.data
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#')
;Code section
.code
main PROC
;assign value o to esi
mov esi,0
;find the length of the source
;subtract with 2 and assign to edi
mov edi,LENGTHOF source - 2
;find the number of bytes used source
;assign to ecx
mov ecx,SIZEOF source
;iterate a loop
L1:
;get the value of source at index esi
;and move into register al.
mov al,source[esi]
;move the value of al into target array
;at index edi.
mov target[edi],al
;increment the value of esi
inc esi
;decrement the value of edi.
dec edi
loop L1
;get the address value of the target
;into edx.
mov edx, OFFSET target
;print the string
call WriteString
exit
main ENDP
END main
In the Assembly language, to copy a string in reverse order by using any of the assembly language, you will need to use a loop to iterate over the characters in the string and copy them into a new string in reverse order. You will also need to use a couple of registers to keep track of the current index in both the source and destination strings.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- // Declare data fields: a String named customerName, // an int named numItems, and // a double named totalCost.// Your code here... // Implement the default contructor.// Set the value of customerName to "no name"// and use zero for the other data fields.// Your code here... // Implement the overloaded constructor that// passes new values to all data fields.// Your code here... // Implement method getTotalCost to return the totalCost.// Your code here... // Implement method buyItem.//// Adds itemCost to the total cost and increments// (adds 1 to) the number of items in the cart.//// Parameter: a double itemCost indicating the cost of the item.public void buyItem(double itemCost){// Your code here... }// Implement method applyCoupon.//// Apply a coupon to the total cost of the cart.// - Normal coupon: the unit discount is subtracted ONCE// from the total cost.// - Bonus coupon: the unit discount is subtracted TWICE// from the total cost.// - HOWEVER, a bonus coupon only applies if the…arrow_forwardplease help fix the following Scenario: Your team is working with data where dates are caputred as a string, "9/15/2019". You are tasked to create a python function named 'mdy_date' that will accept a string input, convert it to a python datetime object, and return the datetime object. Create the function in the cell below.arrow_forwardYou have more flexibility to implement your own function names and logic in these programs. The data files you need for this assignment can obtained from:Right-click and "Save Link As..." HUGO_genes.txt (Links to an external site.) chr21_genes.txt (Links to an external site.) Create an output directory inside your assignment4 directory called "OUTPUT" for result files, so that they will not mix with your programs. Output from your programs will be here! Your program must implement command line options for the infiles it must open, but for testing purposes it should run by default, so if no command line option is passed at the command line, the program will still run. This will help in the grading of your program. Create a Python Module called called my_io.py - You can use the same code from assignment 3's solution. Put this my_io.py Module in a subdirectory named assignment4 inside your assignment4 top-level directory (see the tree below, and see Lecture 7 on how to implement a…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education