Mail Archives: djgpp/2000/05/28/06:00:40
Dogansmoobs wrote:
>Ok, this is the only asm file that I have tried this with. I am
>on a different computer than the one I program on, so if there
>are any mistakes,
(Yes - the first three lines of VGA.ASM should start with a dot.)
>it's not there in the actual code. The code
>compiles fine, with no errors or warnings.
>
>VGA.ASM:::::::::::::::::::::::
>486
>MODEL MEDIUM,C
As I said before, you can't do this. You need a flat memory model.
In particular, medium model code uses far returns, but you need
near returns.
>CODE
>
>PUBLIC _setVga ;I have tried this with and without the undescore
The underscore is necessary.
>_setVga PROC C
> mov ah, 0
> mov al, 13
> int 10
> ret
>_setVga ENDP
>
>PUBLIC _setText
>_setText PROC C
> mov ah, 0
> mov al, 3
> int 10
> ret
>_setText ENDP
You can't call real-mode BIOS interrupts directly from 32-bit protected
mode and expect it work. (You can do it via DPMI though - see the FAQ.)
>END
>And the C file that I have tried to link it with is like so:
The C code looked OK (except that I think you need to use textprintf
instead of printf to print to a graphics screen).
>gcc vgatest.c vga.obj -Wall -g -o vgatest.exe
Probably you need to rename vga.obj to vga.o, as I'm not sure that
gcc recognises .obj as an object file extension.
S.
- Raw text -