Real mode assembly appendix A

From OSDev.wiki
Revision as of 00:00, 19 February 2009 by osdev>Troy martin (added 80x60 text mode trick)
Jump to navigation Jump to search

This is the appendix of the real mode assembly bare bones series, containing nifty tidbits of information, code, and ideas.

Links to other articles with code

Code

Text in 640x480 16-colour graphics mode

VGA video mode 12h is a 640x480 resolution, in which (with a little tweaking) can be used with your string printing function. All you have to do is add a mov bh,07h to allow regular coloured printing in graphics mode. At the moment, the cursor is disabled. You must find a way to eliminate it or do up a function specifically for printing in graphics mode.

80x60 text mode

Follow the steps outlined above to set up 640x480 (8x16 font) "text mode" first. After that, use the following code snippet:

mov ax, 1123h   ; 8x8 chars in graphics mode
mov bl, 0       ; Row = 0 (don't ask cause I don't know)
int 10h         ; BIOS video interrupt

You should have 80x60 text mode in a 640x480 environment. Note that I haven't tested it (I'm writing it away from my dev box) on either emulated hardware or real hardware. So be careful.