title: 8086 boot file drawing boxes flickers in assembly
body: <p>I drew boxes in the 320x200*256 mode, it appears they are flickering, is there a way to fix this pixel flickering? what should I do to fix this, is there any good tutorials about this I only found a little documentation around in google like this <a href="http://webpages.charter.net/danrollins/techhelp/0113.HTM" rel="nofollow noreferrer">http://webpages.charter.net/danrollins/techhelp/0113.HTM</a> and this <a href="http://stanislavs.org/helppc/int_10.html" rel="nofollow noreferrer">http://stanislavs.org/helppc/int_10.html</a> is there any step by step tutorial.</p>
  
  <pre><code>    [bits 16]
      [org 0x7c00]
  start:
      xor ax, ax
      mov ds, ax
      mov es, ax
      mov sp, 0x09000
      mov bp,sp
      mov ebx,13h
      mov eax,4f02h
      int 10h
      mov ax,2h
      mov  ebx,0xa000
      mov ecx,0
      mov es,ebx
      mov ebx,0
      xor edi,edi
  
  j:
      mov ax,4h
      mov cx, 200
      mov dx,200
      mov bx,220
      call drawBox
      mov ax,1h
      mov cx, 100
      mov dx,140
      mov bx,140
      call drawBox
      mov ax,0x16
      mov cx, 150
      mov dx,90
      mov bx,200
      call drawBox
      mov ax,0x25
      mov cx, 20
      mov dx,20
      mov bx,80
      call drawBox
      mov ax,2h
      call fill
      jmp j
  fill:
      mov [bp+202],word cx
      mov [bp+204],word bx
      mov [bp+200] ,word dx
      xor cx,cx
      xor dx,dx
      mov bx,200
      call drawBox
      mov cx,[bp+202] 
      mov bx,[bp+204]
      mov dx,[bp+200]
  
  drawBox:
      mov [bp],word cx
      mov [bp+4],word dx
      .keepdrawing:
          call setXY
          inc cx
          cmp cx,bx
          je .reset
      jmp .keepdrawing
      .reset:
          mov cx,[bp]
          inc dx
          cmp dx,bx
          jge .done
      jmp .keepdrawing
      .done:
      mov cx,[bp]
      mov dx,[bp+4]
      ret
  setXY: ;requires cx Xposition, dx Yposition
      mov [bp+16], word ax
      mov [bp+20], word dx
      xor ax,ax
      add ax,320
      mul dx;; dx = y posiion
      mov di,cx ; cx = x position
      add di,ax 
      mov ax,[bp+16]
      mov dx,[bp+20] 
      cmp ax,[es:di]
          je .done
          jne .put
      .put:
      mov [es:di],ax
      .done:
      ret
  times (510 - ($-$$)) db 0x00
  dw 0xAA55
  </code></pre>