Mail Archives: djgpp/1997/11/16/10:40:04
I have tryed to compile and link following source files using Nasm and DJGPP. So far I have got only error messages. What the heck is wrong?? Someone help me out please!
Fillscrn.ASM:
[BITS 32]
[EXTERN _color]
[GLOBAL _Fillscrn(int color)]
[SECTION .text]
;prototype: Fillscrn(int color);
_Fillscrn:
push ebp
mov ebp, esp
mov ax, 0A000h
mov es, ax
xor di, di
mov cx, 320*200/2
mov al, _color
mov ah, al
rep rep stosw
pop ebp
ret
[SECTION .data]
FllScrnc.cpp:
#include <go32.h>
#include <sys/farptr.h>
#include <conio.h>
#include <stdio.h>
#define VGA256 0x13
#define TEXT_MODE 0x03
extern void Fillscrn(int color);
void main(void)
{
int t;
// Aseta n?ytt"tila 320*200*256
textmode(VGA256);
// T?yt? n?ytt" 1:ll?
for (t=0; t<1000; t++)
void Fillscrn(t);
// Odota n?p?imen painallusta
while(!kbhit()) {}
// Palaa tekstitilaan
textmode(TEXT_MODE);
}
- Raw text -