Function 00h reprograms the whole card for the mode in AL: resolution and timing, the memory layout, the font for a text mode and the default palette. Then it clears video memory (spaces in attribute 07h in text modes, colour 0 in graphics modes), shows page 0, puts every page's cursor at the top left and sets the usual cursor shape. It records all of this in the BIOS data area, so afterwards INT 10h AH=0Fh and every other service know the new mode.
Usually it is written MOV AX, 0013h / INT 10h: AH = 00h and AL = the mode in one instruction. The modes are listed in the INT 10h article. Here the screen switches to 40-column text; DOS output follows the new mode, since DOS writes through the BIOS:
MOV AX, 0001h ; AH = 00h: set the mode; AL = 01h: 40x25 colour textINT 10hMOV AH, 09hMOV DX, OFFSET MSG1 ; DOS output, now in double-width lettersINT 21hMOV CX, 001Eh ; wait 2 s: CX:DX = 1E8480h microsecondsMOV DX, 8480hMOV AH, 86h ; BIOS: waitINT 15hMOV AX, 0003h ; mode 03h again: 80x25 text, clears the screenINT 10hMOV AH, 09hMOV DX, OFFSET MSG2INT 21hMSG1 DB "Forty columns: big letters", 13, 10, "$"MSG2 DB "Back in mode 03h", 13, 10, "$"
Setting the old mode back
A program that changes the mode must set the old one again before it exits. Otherwise DOS is left in, say, a graphics mode, where the BIOS draws its text slowly dot by dot and the command line is hard to use. Ask for the mode first with function 0Fh and restore exactly that:
MOV AH, 0Fh ; get the mode: ALINT 10hMOV [OLDMODE1], AL ; keep it; ... set another mode, draw ...MOV AH, 00h ; set the modeMOV AL, [OLDMODE1] ; the one we foundINT 10h
Keeping the screen
On the EGA and later, bit 7 of AL asks the BIOS not to clear video memory: MOV AX, 0083h sets mode 03h and leaves the text where it is. Programs use it to reset the card, or the font, without wiping what the user was looking at. Function 0Fh may then report the mode with bit 7 set.
Pitfalls
A mode set is slow by video standards, since the card is reprogrammed and its memory cleared, and the monitor may blink while it resynchronises; to clear the screen use INT 10h AH=06h instead. It also undoes everything a program changed: palette and DAC colours, a loaded font, 43 or 50 lines, bright backgrounds, the cursor shape. That makes "set mode 03h" the simple way to put everything back at the end. A mode the card does not support is ignored by most BIOSes and produces a garbled screen on others, so check what card is present (INT 10h AH=1Ah, INT 10h AH=12h) before asking for EGA or VGA modes.