Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | |
2 | |||
3 | #ifdef I386_ASSEM |
||
4 | static inline int get1bit(void) { |
||
5 | extern int bitindex; |
||
6 | extern unsigned char *wordpointer; |
||
7 | int ret; |
||
8 | |||
9 | asm("\n\t" |
||
10 | "movl %1,%%ecx\n\t" |
||
11 | "movzbl (%%ecx),%%eax\n\t" |
||
12 | "movl %2,%%ecx\n\t" |
||
13 | "incl %%ecx\n\t" |
||
14 | "rolb %%cl,%%al\n\t" |
||
15 | "andb $1,%%al\n\t" |
||
16 | "movl %%ecx,%2\n\t" |
||
17 | "andl $7,%2\n\t" |
||
18 | "sarl $3,%%ecx\n\t" |
||
19 | "addl %%ecx,%1\n" |
||
20 | : "=a" (ret) |
||
21 | : "m" (wordpointer) , "m" (bitindex) |
||
22 | : "eax" , "ecx" , "memory" ); |
||
23 | return ret; |
||
24 | } |
||
25 | #endif |
||
26 | |||
27 | |||
28 |