WA5 Part1 - call WriteString c call Crlf c exit main ENDP m...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
TITLE WA5 Concatinate two strings. (main.asm) ( ; Description: ; ; Write a procedure named Str_concat that concatenates a source string ; to the end of a target string. Sufficient space must be available in ; the target string before this procedure is called. Pass pointers to ; the source and target strings. ; INCLUDE Irvine32.inc INCLUDE Bsearch.inc I STRING_SIZE = 6 S Str_concat PROTO, source:PTR BYTE, target:PTR BYTE S .data targetStr BYTE "ABC",6 DUP(0) sourceStr BYTE "XYZ",0 s .code main PROC m mov edx,OFFSET targetStr call WriteString call Crlf c mov edx,OFFSET sourceStr call WriteString call Crlf c mov ecx,LENGTHOF sourceStr m INVOKE Str_concat, ADDR sourceStr, ADDR targetStr I mov edx,OFFSET targetStr
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: call WriteString c call Crlf c exit main ENDP m m Str_concat PROC USES eax ecx esi edi, source:PTR BYTE, target:PTR BYTE S ;mov edx, source ;mov eax,LENGTHOF edx ; ; call WriteString ; call Crlf c cld ; clear direction mov esi,source mov edi,target ;mov ecx, 3 ;set (dynamically) in main program. add edi,3 rep movsb r ret r Str_concat ENDP S FillString PROC USES eax edi ecx edx, myStringPointer:PTR DWORD, count:DWORD, mystring1:SDWORD, mystring2:SDWORD m mov edi,myStringPointer mov ecx,count mov edx,mystring1 sub edx,mystring2 s L1: mov eax,edx add eax,mystring2 stosd loop L1 l ret FillString ENDP F END main...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern