. service tells you which device it couldn't stat
[minix3.git] / lib / i386 / em / em_inn.s
blob95d8ac01b2029bb619288c60dcb9fdcba840b053
1 .sect .text; .sect .rom; .sect .data; .sect .bss
2 .sect .text
3 .define .inn
5 ! #bytes in ecx
6 ! bit # in eax
7 .inn:
8 xor edx,edx
9 mov ebx,8
10 div ebx
11 mov ebx,esp
12 add ebx,4
13 add ebx,eax
14 cmp eax,ecx
15 jae 1f
16 movb al,(ebx)
17 mov ebx,edx
18 testb al,bits(ebx)
19 jz 1f
20 mov eax,1
21 jmp 2f
23 xor eax,eax
25 pop ebx
26 add esp,ecx
27 ! eax is result
28 jmp ebx
30 .sect .rom
31 bits:
32 .data1 1,2,4,8,16,32,64,128