home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 183_01 / screen.asm < prev    next >
Assembly Source File  |  1985-11-27  |  1KB  |  71 lines

  1. Comment  @
  2.  
  3.         This assembler routine is used with the Microsoft C 3.0 compiler
  4.       to do video calls.
  5.  
  6.  
  7.  
  8.         Name  cls -- clear screen
  9.  
  10.         Synopsis  cls();
  11.  
  12.         Descrpt   clear the screen from 0,0 to 79, 24
  13.  
  14.  
  15.  
  16.         Name      cpos -- positions the cursor
  17.  
  18.         Synopsis  cpos(row, col);
  19.                   int row;
  20.                   int col;
  21.  
  22.         Descrpt   positions the cursor at row, col.
  23.                   must be between 1,1 and 80, 25
  24.  
  25. @
  26.  
  27.  
  28.         assume  cs:_text
  29. _text   segment public byte 'code'
  30.         public  _cls, _cpos
  31.  
  32. _cls    proc    near
  33.         push    bp
  34.         mov     bp,sp
  35.  
  36.         mov     ax,0600h
  37.         mov     cx,0000
  38.         mov     dx,184fh
  39.         mov     bh,07
  40.         int     10h
  41.  
  42.         mov     ah,02
  43.         mov     dx,0000
  44.         mov     bh,00
  45.         int     10h
  46.  
  47.         pop     bp
  48.         ret
  49. _cls    endp
  50.  
  51. _cpos   proc    near
  52.         push    bp
  53.         mov     bp,sp
  54.  
  55.         mov     dx,[bp + 4]
  56.         mov     ax,[bp + 6]
  57.         pop     bp
  58.  
  59.         mov     dh,dl
  60.         mov     dl,al
  61.         sub     dh,01
  62.         sub     dl,01
  63.         mov     ah,02
  64.         mov     bh,00
  65.         int     10h
  66.         ret
  67. _cpos   endp
  68.  
  69. _text   ends
  70.         end
  71.