source: golgotha/src/i4/loaders/mp3/get1bit.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 980 bytes
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9
10
11#ifdef I386_ASSEM
12static inline int get1bit(void) {
13        extern int bitindex;
14        extern unsigned char *wordpointer;
15        int ret;
16
17        asm("\n\t"
18                "movl   %1,%%ecx\n\t"
19                "movzbl (%%ecx),%%eax\n\t"
20                "movl   %2,%%ecx\n\t"
21                "incl   %%ecx\n\t"
22                "rolb   %%cl,%%al\n\t"
23                "andb   $1,%%al\n\t"
24                "movl   %%ecx,%2\n\t"
25                "andl   $7,%2\n\t"
26                "sarl   $3,%%ecx\n\t"
27                "addl   %%ecx,%1\n"
28                : "=a" (ret)
29                : "m" (wordpointer) , "m" (bitindex)
30                : "eax" , "ecx" , "memory" );
31        return ret;
32}
33#endif
34
35
36
Note: See TracBrowser for help on using the repository browser.