home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / sampler0 / clr.asm < prev    next >
Assembly Source File  |  1987-05-07  |  1KB  |  55 lines

  1. .radix    16
  2.         ;
  3. cseg    segment
  4.         assume    cs:cseg,  ds:cseg
  5.         ;
  6.         video    equ    10    ; bios video interrupt
  7.         exit    equ    20    ; return to ccp routine
  8.         dos    equ    21
  9.         getmode    equ    0f
  10.         getattr    equ    8
  11.         setcurs    equ    2
  12.         ttywrit    equ    0e08    ; tty write a backspace
  13.         scroll    equ    0600
  14.         inforeq    equ    1130    ; char gen routine,  get info
  15.         ;
  16.         org    100
  17.         ;
  18. clr:        mov    dl, 18        ; assume 24 rows
  19.         sub    bh, bh
  20.         mov    ax, inforeq
  21.         int    video        ; get number of rows in dl
  22.         mov    ah, getmode
  23.         int    video
  24.         dec    ah
  25.         mov    ch, dl
  26.         mov    cl, ah        ; cx = maximum row and col
  27.         xor    ah, ah        ; graphics attribute
  28.         cmp    al, 07        ; see if monochrome mode
  29.         je    mono
  30.         cmp    al, 03        ; see if notext mode
  31.         ja    notext
  32. mono:        ; on a text screen, get current attribute
  33.         mov    dl, 20        ; write space to display
  34.         mov    ah, 02
  35.         int    dos
  36.         mov    ax, ttywrit    ; wipe it out with a backspace
  37.         int    video
  38.         mov    ah, getattr    ; read attribute
  39.         int    video
  40.         ;
  41. notext:        push    bx        ; save video page
  42.         mov    bh, ah        ; screen to be cleared
  43.         mov    dx, cx
  44.         sub    cx, cx
  45.         mov    ax, scroll
  46.         int    video
  47.         pop    bx        ; get back video page
  48.         sub    dx, dx        ; home cursor
  49.         mov    ah, setcurs
  50.         int    video
  51.         ;
  52.         int    exit
  53. cseg    ends
  54.     end    clr
  55.