ack/mach/i386/libem/inn.s

33 lines
437 B
ArmAsm
Raw Permalink Normal View History

1989-01-19 16:43:32 +00:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .inn
! #bytes in ecx
! bit # in eax
.inn:
xor edx,edx
mov ebx,8
div ebx
mov ebx,esp
add ebx,4
add ebx,eax
cmp eax,ecx
jae 1f
movb al,(ebx)
mov ebx,edx
testb al,bits(ebx)
jz 1f
mov eax,1
jmp 2f
1:
xor eax,eax
2:
pop ebx
add esp,ecx
! eax is result
jmp ebx
.sect .rom
bits:
.data1 1,2,4,8,16,32,64,128