Warm tip: This article is reproduced from serverfault.com, please click

Where the current text mode page address is recorded?

发布于 2020-12-22 15:37:35

I read that we can know the current text mode page directly by an interrupt like this code:

mov ah, 15
int 10h

the current page number will be returned into 'bh'. How we can get the current page address or offset without calculating it nor saving all page addresses in constants. Is there a port instruction or memory location that has the current working video buffer?

Questioner
Ahmed Crow
Viewed
0
fuz 2020-12-23 00:17:51

The offset of the current video page from the beginning of the regen buffer is recorded in the BDA at 0040:004e. The text mode regen buffer is found at segment b000 for MDA and HGC cards and at b800 for all other cards. Query the equipment byte using int 11h to find if an MDA card is installed.

Refer to this article for further details.