source: trunk/minix/lib/i86/em/em_inn.s@ 10

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

Minix 3.1.2a

File size: 357 bytes
RevLine 
[9]1.define .inn
2.text
3
4 ! #bytes in cx
5 ! bit # in ax
6.inn:
7 xor dx,dx
8 mov bx,#8
9 div bx
10 mov bx,sp
11 add bx,#2
12 add bx,ax
13 cmp ax,cx
14 jae 1f
15 movb al,(bx)
16 mov bx,dx
17 testb al,bits(bx)
18 jz 1f
19 mov ax,#1
20 jmp 2f
211:
22 xor ax,ax
232:
24 pop bx
25 add sp,cx
26 ! ax is result
27 jmp (bx)
28
29 .data
30bits:
31 .data1 1,2,4,8,16,32,64,128
Note: See TracBrowser for help on using the repository browser.