Writing a char to Video RAM in C
Posted: Sun Aug 18, 2002 2:35 am
Hi
I have now decided to write my stuff in C and so far the Get and Set cursor actions that I wasn having trouble with in asm are now very easy. I am having a little trouble with printing a charachter to video RAM though. With this function, nothing happends:
void Print_Char(UCHAR ascii_char, UCHAR Page)
{
UINT far *video_ram = (UINT*) 0xB8000;
*video_ram = ascii_char;
}
I am writing this in real mode DOS Turbo C++ (it's a C file). At the moment, I am just wanting to write the argument ascii_char to the very top left had corner of the screen.
What am I doing wrong?
BTW I am not particually experienced with using pointers in a HLL, as in Turbo Pascal and Delphi I never used pointers (never got round to it).
Thanks
Steven Graham
I have now decided to write my stuff in C and so far the Get and Set cursor actions that I wasn having trouble with in asm are now very easy. I am having a little trouble with printing a charachter to video RAM though. With this function, nothing happends:
void Print_Char(UCHAR ascii_char, UCHAR Page)
{
UINT far *video_ram = (UINT*) 0xB8000;
*video_ram = ascii_char;
}
I am writing this in real mode DOS Turbo C++ (it's a C file). At the moment, I am just wanting to write the argument ascii_char to the very top left had corner of the screen.
What am I doing wrong?
BTW I am not particually experienced with using pointers in a HLL, as in Turbo Pascal and Delphi I never used pointers (never got round to it).
Thanks
Steven Graham