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
|
---|
22 | 1:
|
---|
23 | xor eax,eax
|
---|
24 | 2:
|
---|
25 | pop ebx
|
---|
26 | add esp,ecx
|
---|
27 | ! eax is result
|
---|
28 | jmp ebx
|
---|
29 |
|
---|
30 | .sect .rom
|
---|
31 | bits:
|
---|
32 | .data1 1,2,4,8,16,32,64,128
|
---|
Note:
See
TracBrowser
for help on using the repository browser.