org 100h
                iter:
        push word 0a000h
        pop es
        mov al,13h
        int 10h

main:
        inc word [iter+1]

        xor di,di
        mov bx,-100
ayloop:
        mov cx,-160
axloop:
        mov si,cx
        mov bp,bx

        mov byte [iter],7
repeato:
        dec byte [iter]
        jz outside

        mov ax,si
        imul ax,ax
        mov si,ax

        mov ax,bp
        imul ax,ax
        sub ax,si
        sar ax,7

        add ax,[iter+1]
        xor ah,ah
        mov bp,ax


        mov ax,bx
        imul ax,cx
        sar ax,6

        add ax,[iter+1]
        xor ah,ah
        mov si,ax

        imul ax,ax
        push ax
        mov ax,bp
        imul ax,ax
        mov dx,ax
        pop ax
        add ax,dx


        cmp ax,32767
        jc repeato
outside:
        mov al,[iter]
        mov dl,[iter+2]
;        add dl,dl
;        add al,16
        shl dl,4
        add al,dl



        stosb

        inc cx
        cmp cx,160
        jnz axloop
        inc bx
        cmp bx,100
        jnz ayloop

Vsync:
;        IN      AL,DX
;        AND     AL,8
;        JZ      Vsync


        in al,60h
        dec al
        jnz main
ret
