;demo paint

        call    clearscr

        mov     cx, 10
        mov     al, 'A'
        mov     bl, 07h         ;dos colors
        mov     dh, 10
        mov     dl, 0

        call    paint

        int     20h


clearscr:  push  ax
          push  bx
          push  cx
          push  dx

          mov   cx, 80*50
          mov   al, ' '
          mov   dx, 0
          mov   bl, 07h

          call  paint

          pop   dx
          pop   cx
          pop   bx
          pop   ax
          ret



;SETCUR - Input dh =row   dl = col
;
setcur: push    ax
        push    bx
        mov     bh, 0           ;video page
        mov     ah, 2

        int     10h

        pop     bx
        pop     ax
        ret


;PAINT - Input:
;                   al - ascii char
;                   cx - count
;                   bl - color attrib
;                   dh - row
;                   dl - col

paint:   push    ax
        push    bx
        push    cx
        push    dx

        call    setcur

        or      cx, cx
        je      outa

        mov     bh, 0
        mov     ah, 9

        int     10h

outa:   pop     dx
        pop     cx
        pop     bx
        pop     ax
        ret


        end