; Peter Vince - 80x50VGA

codesg  segment
        assume  cs:codesg, ds:codesg
        org     100h
m50     proc    far
start:
        mov     ax,0500h    ;select page 0
        int     10h
        mov     ax,1200h    ;determine EGA/VGA config
        mov     bl,10h
        xor     cx,cx
        int     10h
        or      cx,cx       ;was EGA/VGA found?
        jz      outahere
        mov     ax,1202h    ;set # of scan lines
        mov     bl,30h
        int     10h
        mov     ax,7        ;preload MONO video mode param
        or      bh,bh       ;did we find MONO monitor
        jnz     set_mode    ;yup: go set it
        mov     al,3        ;nope: change to colour video mode
set_mode:
        int     10h         ;set video mode
        mov     ax,1112h    ;load & activate 8x8 rom font
        mov     bl,0
        int     10h
outahere:
        mov     ax,4C00h    ;exit to DOS
        int     21h
m50     endp
codesg  ends
        end     start
