Subj : BIOS interrupt To : borland.public.cpp.borlandcpp From : "Rob C." Date : Fri Aug 22 2003 04:28 pm In addition to reading and saving the character at any x/y position on the screen (int = getch()?), I also need to read and save the foreground/background colors. According to the book, BIOS 08h will do this. It should return a two digit number, which reflects the two different colors. For my example below, it should return 37; 3 for red and 7 for white: red on white. This program returns 32, which is red on green. #include #include #include void window(int left, int top, int right, int bottom); void textbackground(int newcolor); void clrscr(void); void gotoxy(int x, int y); int readattr( int col, int row ) { struct REGPACK rp = {0}; gotoxy( col, row ); rp.r_ax = 0x0800; intr(0x10, &rp); return rp.r_ax & 0x00ff; } int main() { int results, col=11, row=2; char conv[10]; window( col-1, col-1, col+29, row+15 ); textcolor(RED); textbackground(WHITE); clrscr(); results = readattr( col, row ); //sprintf( conv, "%s", results ); //sprintf() compiles and links fine, but screws up when run, why? gotoxy( col, row ); cprintf( "results = %d hex = %x conv = -%s- \n", results, results, conv ); return; } .