source: trunk/minix/lib/ack/i386/em/em_set.s@ 15

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

Minix 3.1.2a

File size: 597 bytes
Line 
1.sect .text; .sect .rom; .sect .data; .sect .bss
2.sect .text
3.define .set
4
5 ! #bytes in ecx
6 ! bit # in eax
7.set:
8 pop ebx ! return address
9 xor edx,edx
10!ifdef create set
11 sub esp,ecx
12 push ebx
13 push edi
14 mov ebx,esp
15 xor edi,edi
16 sar ecx,2
171:
18 mov 8(ebx)(edi),edx
19 add edi,4
20 loop 1b
21!endif
22 mov ebx,8
23 div ebx
24 cmp eax,edi
25 jae 2f
26 mov edi,edx
27 movb dl,bits(edi)
28 mov edi,esp
29 add edi,eax
30 orb 8(edi),dl
31 pop edi
32 ret
332:
34.extern ESET
35.extern .trp
36 pop edi
37 mov eax,ESET
38 jmp .trp
39
40 .sect .rom
41bits:
42 .data1 1,2,4,8,16,32,64,128
Note: See TracBrowser for help on using the repository browser.