Re: Assembler in C

Search this archive.

From: Ryan Rubley (rubleyr@csis.gvsu.edu)
Date: Wed 06 Jun 2001 - 06:13:12 IDT


Here is a hint:

__asm__("movl %0,%%eax" : : "g" (line[l].word[0]) );

that is inline for "mov eax,line[l].word[0]"




>
>   loop0:
>
> 	in      al, dx
> 	and     al, 0x08
> 	jz      loop0
>
> 	mov     dx, 0x3C8		// Send the palette
> 	mov     al, 0
> 	out     dx, al
> 	mov     cx, 768
> 	lds     si, pal
> 	mov     dx, 0x3C9
> 	rep     outsb
> 	pop     ds
>
> I've translated it to:
>
> void setPalette( uchar *thePalette )
>   {
>     uchar   stat;
>
>     outb( 0x3D6, 0x14 );                // Select XR14
>     stat    = inb( 0x3D7 ) & 0x8F;      // Enable VSYNC, Retrace, and HSYNC
>     outb( 0x3D7, stat | 0x50 );
>
>     while ( inb( 0x3D7 ) & 0x08 )
>         continue;
>
>     outb( 0x3C8, 0 );                   // Send the palette
>
>     /* How do I put in the in-line assembly here? */
>
>   }
>
>
>
>


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST