Курсовая работа: Конкатенація строк Assembler
LOCAL hOutPut :DWORD ;handle of output
LOCAL nRead1 :DWORD ;number of bytes read
LOCAL nRead2 :DWORD ;the same
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hOutPut, eax
invoke WriteConsole, hOutPut, offset strType1, 24d, NULL, NULL
invoke GetStdHandle, STD_INPUT_HANDLE
mov hInput, eax
invoke ReadConsole, hInput, ADDR str1, 64d, ADDR nRead1, NULL
invoke WriteConsole, hOutPut, offset strType2, 25d, NULL, NULL
invoke ReadConsole, hInput, ADDR str2, 64d, ADDR nRead2, NULL
invoke strCat, offset buff, offset str1
invoke strCat, offset buff, offset str2
xor eax, eax
invoke szLen, offset buff
mov nRead2, eax
invoke WriteConsole, hOutPut, offset strResult, 31d, NULL, NULL
invoke WriteConsole, hOutPut, offset buff, nRead2, NULL, NULL
ret
string endp
strCat proc lpszSource:DWORD, lpszAdd:DWORD
push edi
invoke szLen, lpszSource
mov edi, lpszSource
mov ecx, lpszAdd
add edi, eax ; set write starting position
xor edx, edx ; zero index
xor eax, eax ; avoid stall with following AL reads and writes
mov [edi-2], byte ptr 20h