printing...
Posted: Sun Sep 15, 2002 1:49 pm
Hey everybody... This will be a new silly question...
void write_string(int colour, char *string)
{
char *video=(char*)0xB8000;
while(*string!=0)
{
*video=*string;
string++;
video++;
*video=colour;
video++;
}
}
I think this function should write text pointed by string onto first line of screen in text mode. But I could not make it run. Is this because DJGPP does not take 0xb8000 as a memory address but a pointer in with a garbage value in it? I am working in pmode, a20 is enabled, code is loaded at 0x5000. Any ideas are welcome. Thanx...
void write_string(int colour, char *string)
{
char *video=(char*)0xB8000;
while(*string!=0)
{
*video=*string;
string++;
video++;
*video=colour;
video++;
}
}
I think this function should write text pointed by string onto first line of screen in text mode. But I could not make it run. Is this because DJGPP does not take 0xb8000 as a memory address but a pointer in with a garbage value in it? I am working in pmode, a20 is enabled, code is loaded at 0x5000. Any ideas are welcome. Thanx...