From: earnie_boyd AT hotmail DOT com (Earnie Boyd) Subject: Re: Accessing hardware -- nasm and gcc 12 Mar 1998 23:13:29 -0800 Message-ID: <19980312132036.2418.qmail.cygnus.gnu-win32@hotmail.com> Content-Type: text/plain To: M DOT H DOT M DOT Michels AT kub DOT nl Cc: gnu-win32 AT cygnus DOT com >From: "Tijs Michels" >To: "Paul Garceau" >Date: Wed, 11 Mar 1998 12:22:21 MET >Subject: Accessing hardware -- nasm and gcc >Reply-to: M DOT H DOT M DOT Michels AT kub DOT nl >CC: gnu-win32 AT cygnus DOT com > >I have a simple .c file mijn.c consisting of four lines: > > extern void tijs(void); > int main(void) { > tijs(); > } > >I have a simple .asm file mijn.asm like this: > > BITS 32 > GLOBAL _tijs > > SECTION .text > >; prototype: void tijs(void); >_tijs mov dx,0x3C8 ; Port 3C8h to switch to PEL address write mode. > mov al,1 ; By default palette register 01h is mapped to > out dx,al ; PEL data register 01h. So to change the color > inc dx ; of attribute 1.h address PEL data register 01h. > xor al,al ; To compose a color set the intensity of red, > out dx,al ; green, and blue on a scale from 0h to 3Fh (63). > out dx,al ; bright blue (00_00_FFh) corresponds to 00_00_ > mov al,0x3F ; 3Fh. > out dx,al ; > ret > > SECTION .data > SECTION .bss > >Next I issue the following two commands: > > nasm -f coff mijn.asm I'm not claiming to know anything here, but, I would like to suggest that you try this: mv mijn.asm mijn.s gcc -c mijn.s > gcc -o mijn mijn.c mijn.o > - \\||// ---o0O0--Earnie--0O0o---- -earnie_boyd AT hotmail DOT com- ------ooo0O--O0ooo------- ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".