1989-01-19 16:43:32 +00:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
|
|
|
.sect .text
|
|
|
|
.define .loi
|
|
|
|
.define .los
|
|
|
|
|
|
|
|
! #bytes in ecx
|
|
|
|
! address in ebx
|
|
|
|
! save esi/edi. they might be register variables
|
|
|
|
.los:
|
|
|
|
pop edx
|
|
|
|
mov eax,ecx
|
|
|
|
sar ecx,1
|
|
|
|
jnb 1f
|
1989-10-10 11:38:18 +00:00
|
|
|
movsxb eax,(ebx)
|
1989-01-19 16:43:32 +00:00
|
|
|
push eax
|
|
|
|
jmp edx
|
|
|
|
1:
|
|
|
|
sar ecx,1
|
|
|
|
jnb 1f
|
1989-10-10 11:38:18 +00:00
|
|
|
movsx eax,(ebx)
|
1989-01-19 16:43:32 +00:00
|
|
|
push eax
|
|
|
|
jmp edx
|
|
|
|
1:
|
1989-10-10 11:38:18 +00:00
|
|
|
push edx
|
1989-01-19 16:43:32 +00:00
|
|
|
mov edx,esi
|
1989-10-10 11:38:18 +00:00
|
|
|
mov esi,ebx
|
|
|
|
pop ebx
|
1989-01-19 16:43:32 +00:00
|
|
|
sub esp,eax
|
|
|
|
jmp 1f
|
|
|
|
|
|
|
|
.loi:
|
|
|
|
! only called with size >= 4
|
|
|
|
mov edx,esi
|
|
|
|
mov esi,ebx
|
|
|
|
pop ebx
|
|
|
|
sub esp,ecx
|
|
|
|
sar ecx,2
|
|
|
|
1:
|
|
|
|
mov eax,edi
|
|
|
|
mov edi,esp
|
|
|
|
rep movs
|
|
|
|
mov esi,edx
|
|
|
|
mov edi,eax
|
|
|
|
jmp ebx
|