Date: Mon, 12 Mar 2001 10:33:15 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: James Allan Ventura cc: djgpp AT delorie DOT com Subject: Re: Problem with __asm and far* keywords In-Reply-To: <001301c0aac3$843cdde0$72272a42@james> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 11 Mar 2001, James Allan Ventura wrote: > I have a source code written in Microsoft C. I tried to compile it using the > GCC compiler and I get an error in the __asm and far* keywords. Is there a way > to modify the code so I can compile it in GCC? Sections 18.12 and 17.8 of the DJGPP FAQ list deal with these problems; please read them. > 62. void clearscreen() { > 63. __asm { > 64. mov ax,0f00h > 65. int 010h > 66. mov ah,0 > 67. int 010h > 68. } > 69. } It's much easier to use the library function clrscr(). > 128. word portaddr(int n) { // base address of port LPTn > 129. return(*(word far*)(0x00000408+2*n-2)); > 130. } You should throw away `far', but your real problem here is that this code accessed absolute addresses in the BIOS data area. The equivalent DJGPP code should use the _farpeekw library function. See its documentation in the library reference manual.