;pikku v1.3 - by success denied '96

        .model tiny

jmax    equ     16
palndx  equ     16
ftype   equ     7
speed   equ     0

        .386

        .code
        org     100h

alku:   mov     al,13h
        int     10h
        push    0a000h
        pop     es

        mov     dx,640
        mov     cl,4*255/(speed+4)
jp3:    xor     di,di
        mov     bh,0fah
        mov     bp,-400
jp1:    mov     si,-640
jp2:    call    juliapo
        dec     bx
        add     si,4
        cmp     si,dx
        jnz     jp2
        add     bp,4
        jnz     jp1
        sub     jcp,13+3*speed
        loop    jp3

        mov     cl,64
jp6:    xor     di,di
        mov     bx,63680
        mov     bp,100
jp4:    mov     si,-320

jp5:    pusha
        imul    bp,cx
        imul    si,cx
        sar     bp,1
        sar     si,1
        mov     jrp,si
        mov     jcp,bp
        call    juliapo
        popa
        inc     bx
        inc     di
        inc     si
        jnz     jp5
        sub     bx,dx
        dec     bp
        jnz     short jp4
        loop    jp6

        mov     al,3
        int     10h

juliapo:
        pusha
        push    bx

        mov     cl,jmax

jloop2: mov     ax,si
        imul    ax
        mov     bl, ah
        mov     bh, dl
        mov     ax,bp
        imul    ax
        shrd    ax,dx,8
        add     bx,ax

        cmp     bh,4
        jnl     short jout

        sub     bx,ax
        sub     bx,ax
        xchg    bx,ax
        xchg    ax,si

        imul    bp
        shrd    ax,dx,ftype
        add     ax,8000h
org $-2
jcp dw  1500
        xchg    bp,ax
        add     si,8000h
org $-2
jrp dw  50
        loop    jloop2

jout:   xchg    ax, cx
        add     al,palndx
        stosb
        pop     di
        stosb
        popa
        inc     di
        ret

        END alku
