.model tiny .code .startup mov ah,0fh ;stary mod int 10h cbw push ax mov al,13h ;novy mod int 10h std ;opacny direct cwd ;vynul dx xor bx,bx ;vynul bx mov cx,0ffffh ;nastav cx -1(ffff) mov si,offset(diff+8) ;si <- diff+11 (0) mov es,[si] ;es <- [si] step: add dh,[si] ;dh+[si] add cx,[si-2] ;cx+[si-2] part: mov ax,1010h ;ax=1010h int 10h inc bx ;bx+1 test bl,03fh ;bl*3fh -> pouze flagy jnz step ;bl=3f skok step ;lodsb ;si-1 lodsw ;si-2 and bh,bh ;bh*bh jz part ;bh=0 skok part xor cx,cx line: xor ah,ah xchg ax,bx mov di,199*320 mov ax,255 sub ax,bx test al,1 jnz evenx mov di,256 mov al,64 mov cl,199 add ax,bx evenx: cwd xchg ax,bp mov ax,di mov si,320 div si sub cx,ax jnc yfix neg cx neg si yfix: mov al,1 xchg ax,bp sub ax,dx jnc xfix neg bp neg ax xfix: cmp ax,cx jc lfix xchg ax,cx xchg si,bp lfix: mov bh,al mov dx,cx neg dx sar dx,1 mov ax,cx xchg ax,bx inc cx plot: stosb inc di add di,si add dl,ah adc dh,0 jnc skip add di,bp sub dx,bx skip: loop plot inc al jnz line mov ah,8 int 21h pop ax int 10h ret ; 0 1 2 3 4 5 6 7 8 9 10 11 12 diff db 0,0,1,1,-1,-1,1, 0, 0, 0a0h end