Subj : Re: BIOS interrupt To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Sat Aug 23 2003 11:21 am Rob C. wrote: >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, Yep, it will. Actually, it will return a 4 hex digit number. AH is the attribute, AL is the character. You are throwing away the attribute before you return the value. >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. 32 is a space (you did a clear-screen, so spaces are what's there) Ignore the %d output. Look at the %x. That is the one thout would show the 37. >rp.r_ax = 0x0800; >intr(0x10, &rp); >return rp.r_ax & 0x00ff; Here, you are returning only AL. If you want to return both values, return AX. .