|
From: Per W. <pw...@ia...> - 2005-11-22 21:48:33
|
First of all - to inline assembly using gcc, you should read this article: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html gcc uses Motorola-style assembly instructions, while your example is using Intel-style assembly instructions. Second: Most old assembly code you find on the net playing with graphics and sound on the PC are only for 16-bit MS-Dos applications. gcc produces 32-bit protected mode code, and then you can't access hardware directly and most BIOS functions are not possible to use. If you want to use gcc to create 32-bit console applications that accesses the hardware I would recommend that you look at the old djgpp port of gcc. It is a port that uses a dos extender and gives a lot of functionality using DPMI and similar interfaces to either run together with QEMM or similar on a MS-Dos machine or to interact with the Win32 OS. There are a lot of code on the net that describes how to use the VESA standard to access the graphics card - with or without assembler instructions. /Per W On Tue, 22 Nov 2005, Jarren Long wrote: > Hey all, > Can anyone help me out with this? I want to add some assembly into my > console app, but I can't get it to compile right. Here's a sample: > //normal code stuff > void SetGraphicsMode(int mode) > { > __asm{ > MOV AX,00h > MOV AL,mode > INT 10h > } > } > //other stuff > Now, I'm not at my home comp right now, so I can't give you the error > messages, but I can tell you that it won't compile. Can anyone help? > Thanks in advance > -- > Jarren L. > |