A
Size: a a a
A
A
A
АШ
rep stosb/movsbA
АШ
A
АШ
pushАШ
push тоже можно подправить, если отнимать смещение стека на 2 байта, и класть туда по байту в циклеrep stosb/movsbd
АШ

str1: db 'Hello to my friends,', 0
str1.sz = $ - str1
str2: db ' brothers and sisters!', 0
str2.sz = $ - str2
sub esp, str1.sz+str2.sz
xor ecx, ecx
@lpConcat:
xor eax, eax
mov al, byte[str1+ecx]
push eax
add esp, 0x5
inc ecx
cmp byte[str1+ecx], 0x0
jne @lpConcat
xor ecx, ecx
@lpConcat2:
xor eax, eax
mov al, byte[str2+ecx]
push eax
add esp, 0x5
inc ecx
cmp byte[str2+ecx], 0x0
jne @lpConcat2
push 0
sub esp, str1.sz+str2.sz-2
push esp
Вот теперь не надо волноваться за размер строкA
sub esp,str1.sz+str2.sz
mov eax,str1.sz+str2.sz
and eax,3
jz @f
mov ecx,4
sub ecx,eax
sub esp,ecx
@@:
mov edi,esp
mov esi,str1
mov ecx,str1.sz
rep movsb
mov esi,str2
mov ecx,str2.sz
rep movsb
ret
str1: db 'Hello to my friends,', 0
str1.sz = $ - str1 - 1
str2: db ' brothers and sisters!', 0
str2.sz = $ - str2
здесь тоже не надо волноваться о выравнивании стекаАШ
АШ
rep movsb берёт больше тиков, чем push+addA
A
АШ
A
d
d