REM This is test program
REM I wrote it to test if the compiler works
REM Run mode13h.com under DOS

DIM tablica(900)
GMODE()
FOR I=1 TO 30
 FOR J=1 TO 30
  tablica[((J-1)*30)+(I-1)]=BXOR(I,J)
  PUTPIXEL(I,J,tablica[((J-1)*30)+(I-1)])
 NEXT
NEXT
WKEY()
TMODE()
END

FUNCTION GMODE(0)
ASMBEGIN
 mov ax,0x0013
 int 0x10
ASMEND
END

FUNCTION TMODE(0)
ASMBEGIN
 mov ax,3
 int 0x10
ASMEND
END

FUNCTION PUTPIXEL(3)
PIXPOS=($2*320)+$1
PIXCOLOR=$3
ASMBEGIN
 push ax
 push di
 push es
 mov ax,0xA000
 mov es,ax
 mov bl,byte [PIXCOLOR]
 mov di,word [PIXPOS]
 mov byte [es:di],bl
 pop es
 pop di
 pop ax
ASMEND
END

FUNCTION WKEY(0)
LABEL LWKEY1
ASMBEGIN
 xor ax,ax
 int 0x16
 cmp al,0
 jne www1
ASMEND
 GOTO LWKEY1
ASMBEGIN
 www1:
ASMEND
END

FUNCTION BXOR(2)
ASMBEGIN
 mov eax,dword [ebp+4]
 xor eax,dword [ebp+8]
ASMEND
END

ENDS
