title: How to color the screen in graphic mode in DOS operation system?
body: <p>in a University project in graphic mode in DOS operrarion system I need to clear the screen (color it all in one color), does anyone know what's the intterapt for that and what do I need to put in the registers? In which register put the color i want the screen will be in? thank very much to the helpers!</p>
  
  <p>this is my code (in assembly): if someone can help me understand why the up &amp; down arrowes are moving right &amp; left  and why my exit is writing me deternmind code 0 I would love that!:</p>
  
  <blockquote>
  <pre><code>&gt; IDEAL MODEL 
  small STACK 
  100h DATASEG 
  x dw 0 
  xa dw 0 
  y dw 5 
  ya dw 5 
  z dw 1
  za dw 1 
  color db 4
  Pixels Color bgcolor db 0 ;BackGround Color
  &gt; CODESEG start: 
  mov ax, @data 
  mov ds, ax 
  ; Graphic mode 
  mov ax, 13h 
  int 10h
  ; Print red dot 
  mov bh,0h 
  mov cx,[x] 
  mov dx,[y]
  &gt; mov al,[color] 
  mov ah,0ch 
  int 10h 
  amit:
  &gt;     ;Wait for +
  &gt;     mov ah,00h
  &gt;     int 16h
  &gt;     cmp ax, 0d3dh
  &gt;     je plus
  &gt;     ;Wait for -
  &gt;     cmp ax, 0c2dh
  &gt;     je minus
  &gt;     ; Wait for exit
  &gt;     cmp ax, 1071h
  &gt;     je exit
  &gt;     cmp ax, 4d00h
  &gt;     je right
  &gt;     cmp ax, 4b00h
  &gt;     je left1
  &gt;     cmp ax, 4800h
  &gt;     je up1
  &gt;     cmp ax, 5000h
  &gt;     je down1
  &gt;     
  &gt;     exit:
  &gt;         mov ah, 0
  &gt;         mov al, 2
  &gt;         int 10h
  &gt;         mov ax, 4c00h
  &gt;         int 21h
  &gt;     plus:
  &gt;         add [x], 1
  &gt;         mov cx, [x]
  &gt;         add [y], 1
  &gt;         mov dx, [y]
  &gt;         mov bh, 0h
  &gt;         mov al,[color]
  &gt;         mov ah, 0ch
  &gt;         int 10h
  &gt;         add [z], 1h
  &gt;         add [za], 1h
  &gt;         jmp amit
  &gt;     left1:
  &gt;         jmp left
  &gt;     up1:
  &gt;         jmp up
  &gt;     down1:
  &gt;         jmp down
  &gt;     minus:
  &gt;         mov bh, 00h
  &gt;         mov al,[bgcolor]
  &gt;         mov ah,0ch
  &gt;         int 10h
  &gt;         sub [x], 1
  &gt;         mov cx, [x]
  &gt;         sub [y], 1
  &gt;         mov dx, [y]
  &gt;         sub [z], 1h
  &gt;         sub [za], 1h
  &gt;         jmp amit
  &gt;     right:
  &gt;         clsright:
  &gt;             mov bh, 00h
  &gt;             mov al,[bgcolor]
  &gt;             mov ah,0ch
  &gt;             int 10h
  &gt;             sub [x], 1
  &gt;             mov cx, [x]
  &gt;             sub [y], 1
  &gt;             mov dx, [y]
  &gt;             sub [z], 1h
  &gt;             cmp [z], 0h
  &gt;             jne clsright  
  &gt;         add [x],1h
  &gt;         jmp arrowplus
  &gt;     left:
  &gt;         clsleft:
  &gt;             mov bh, 00h
  &gt;             mov al,[bgcolor]
  &gt;             mov ah,0ch
  &gt;             int 10h
  &gt;             sub [x], 1
  &gt;             mov cx, [x]
  &gt;             sub [y], 1
  &gt;             mov dx, [y]
  &gt;             sub [z], 1h
  &gt;             cmp [z], 0h
  &gt;             jne clsleft 
  &gt;             sub [x], 1h
  &gt;             jmp arrowplus
  &gt;     up:
  &gt;         clsup:
  &gt;             mov bh, 00h
  &gt;             mov al,[bgcolor]
  &gt;             mov ah,0ch
  &gt;             int 10h
  &gt;             sub [x], 1
  &gt;             mov cx, [x]
  &gt;             sub [y], 1
  &gt;             mov dx, [y]
  &gt;             sub [z], 1h
  &gt;             cmp [z], 0h
  &gt;             jne clsup 
  &gt;             sub [y], 1h
  &gt;             jmp arrowplus
  &gt;     down:
  &gt;         clsdown:
  &gt;             mov bh, 00h
  &gt;             mov al,[bgcolor]
  &gt;             mov ah,0ch
  &gt;             int 10h
  &gt;             sub [x], 1
  &gt;             mov cx, [x]
  &gt;             sub [y], 1
  &gt;             mov dx, [y]
  &gt;             sub [z], 1h
  &gt;             cmp [z], 0h
  &gt;             jne clsdown
  &gt;             add [y], 1h
  &gt;             jmp arrowplus
  &gt;     arrowplus:
  &gt;         add [x], 1
  &gt;         mov cx, [x]
  &gt;         add [y], 1
  &gt;         mov dx, [y]
  &gt;         mov bh, 0h
  &gt;         mov al,[color]
  &gt;         mov ah, 0ch
  &gt;         int 10h
  &gt;         add [z], 1h
  &gt;         mov [z], dx
  &gt;         cmp [za], dx
  &gt;         jne arrowplus
  &gt;         jmp amit END start
  </code></pre>
  </blockquote>