;=========================================================
;Very poor VGA demo that just puts lines.  Have a look
;and see how VGA graphics are dome.
;=========================================================

TITLE   Crappy VGA graphics demonstration

.MODEL SMALL                           ;Sets it for a SMALL memory model
.386				      ; Use 286 code
.STACK			      ; Set small stack

.DATA

NOVGA		DB	"You need VGA card!",0ah,0dh,24h
AUTHOR          DB      "Made by Dennis Katsonis.",0ah,0dh,24h


.CODE

MAIN    PROC    NEAR          ; Start of program

	MOV     AX,@DATA
	MOV     DS,AX
	
	MOV     AX,1200h        ;Test for VGA card
	MOV     BL,36h
	INT     10h
				 ;Exit if not detected
	.IF     AL != 12h
		MOV     DX,OFFSET NOVGA ;and tell the user
		MOV     AH,09h
		INT     21h
		MOV     AX,4C01h     ; Send exit code to dos
		INT     21h          ; Send command to DOS
	.ENDIF

	XOR     AH,AH
	MOV     AL,13h
	INT     10h                  ;Set 320 x 200 x 256
	PUSH    ES                   ;Save ES
	MOV     AX,0A000h            ;Mov videomem address to AX
	MOV     ES,AX                ;Then to ES
	XOR     DI,DI








	MOV	AL,03h
	INT     10h
	MOV     DX,OFFSET AUTHOR         ;Print my name
	MOV     AH,09h
	INT     21h
	MOV     AX,4C00h         ; Send exit code to dos
	INT     21h             ; Send command to DOS

MAIN    ENDP                    ; Set end of program
	END      MAIN                   ; Set starting address!
                                        ; 
