assemblyx86x86-16biosvga

Is the current video buffer segment address recorded in a memory location?


By using - for example - an interrupt to change the current page, the segment address of the video buffer will be changed too like after:

mov ah, 5
mov al, 1
int 10h

For example, I'm now in text mode, the segment of my VGA at page 0 is 0B800h, now after previous interrupt the segment will be 0B900, where it is recorded in memory or we have to calculate it because these addresses are fixed ones?


Solution

  • The current video buffer segment address is not recorded in memory. BIOS doesn't use it that way.

    BIOS records this info about pages in the BIOS Data Area

                                                                  80x25
                                                                  -----
    word 0040:004C  Size in bytes of the display memory page    = 4000
    word 0040:004E  Offset to the current display page          = 4096
    byte 0040:0062  Number of the active display page           = 1
    

    In the 80x25 text video mode BIOS only deals with the segment value B800h and varies the offset to arrive at the correct output page. BIOS first calculates the offset within the requested page, and then adds the word from address 0040:004E.