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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background 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

This note was uploaded on 12/30/2009 for the course COS 231 taught by Professor Jasonlitz during the Summer '09 term at Thomas Edison State.

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online