title: how to coloring monitor in graphic mode in assembly
body: <p>hello Why the program does not run correctly
  The first runs for a short time, the display changes color
  But then the color black is back
  The program will draw a flag but can not correctly screen color graphics mode do</p>
  
  <pre><code>.model small
  .stack 256
      org 100H
  .data
  .code
  main proc 
      mov ax, @data
      mov ds, ax          
      call graphicsmode
      call printflag              
  
      mov ah,00
      mov al,03
      int 10h     
  
      mov ax,4c00h
      int 21h
  main endp
  
  graphicsmode proc
      MOV AH,00H
      MOV AL,13H
      INT 10H 
      ret
  graphicsmode endp   
  
  printflag proc      
      ;print color green
      ;--------------------------
      mov cx,50   ;column
      mov dx,50   ;row        
  L1: mov ah,0CH
      mov al,2H   ;color pixel        
      mov bh,00H
      int 10h     
      inc cx
      cmp cx,400
      jne L1
  
      mov cx,50
      inc dx
      cmp dx,100
      jne L1  
  
      ;print color white  
      ;--------------------------
      mov cx,50   ;column
      mov dx,100  ;row        
  L2: mov ah,0CH
      mov al,7H   ;color pixel        
      mov bh,00H
      int 10h     
      inc cx
      cmp cx,400
      jne L2
  
      mov cx,50
      inc dx
      cmp dx,150
      jne L2  
  
      ;print color red    
      ;--------------------------
      mov cx,50   ;column
      mov dx,150  ;row        
  L3: mov ah,0CH
      mov al,4H   ;color pixel        
      mov bh,00H
      int 10h     
      inc cx
      cmp cx,400
      jne L3
  
      mov cx,50
      inc dx
      cmp dx,200
      jne L3  
      ret
  printflag endp
  
  end main
  </code></pre>