minix/lib/i386/em/em_loi.s

45 lines
600 B
ArmAsm
Raw Normal View History

2005-04-21 16:53:53 +02: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
movsxb eax,(ebx)
push eax
jmp edx
1:
sar ecx,1
jnb 1f
movsx eax,(ebx)
push eax
jmp edx
1:
push edx
mov edx,esi
mov esi,ebx
pop ebx
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