Vesa BIOS Example. Page 2:

VESA BIOS Example

Page 2:


Read list of mode numbers

Now we have to take the list of modes available and check to see if we can switch to a 256 colour mode.

   ModePtr = DataBuffer.VidModePtr

   loop
      if the word pointed at [ModePtr] not= -1 then
         add this number to ModeList
      else
	 exit the loop
      end if
      add 2 to ModePtr			; point to next word
   end loop

   loop through the list of numbers in ModeList
      AX = 4F01h			; function 01h, Get Mode Information
      CX = mode number
      ES = SegmentOf (ModeInfoBlock)	;es:[di] points to ModeInfoBlock
      DI = OffsetOf (ModeInfoBlock)	;
      
      call interrupt 10h		

      make a list of all the mode numbers whose ModeInfoBlock.BitsPerPixel = 8
   end loop
   and let the user choose one of those modes