source: trunk/minix/lib/ack/i386/em/em_inn.s@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 437 bytes
Line 
1.sect .text; .sect .rom; .sect .data; .sect .bss
2.sect .text
3.define .inn
4
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
221:
23 xor eax,eax
242:
25 pop ebx
26 add esp,ecx
27 ! eax is result
28 jmp ebx
29
30 .sect .rom
31bits:
32 .data1 1,2,4,8,16,32,64,128
Note: See TracBrowser for help on using the repository browser.