home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / mouse / tcmouse / scrn.asm < prev    next >
Encoding:
Assembly Source File  |  1987-06-11  |  1.5 KB  |  48 lines

  1. ;This file is a test of using external assembly language
  2. ;routines with Turbo C
  3. ;
  4. _TEXT   segment byte public 'CODE'    ;define segment
  5.         assume cs: _TEXT
  6.         public _clear;
  7.         public _gotoyx;
  8. ;
  9. ;***** The _clear function can be adapted to be called with
  10. ;      parameters, to be used with windows.
  11. ;      Therefore, it sets up the bp register for accessing parameters.
  12. ;
  13. _clear  proc near   ;define procedure
  14.         push bp     ;save old bp
  15.         mov bp,sp   ;load current sp to bp
  16.         mov ah,6    ;window scroll function
  17.         mov al,0    ;code to blank screen
  18.         mov ch,0    ;y value
  19.         mov cl,0    ;x value
  20.         mov dh,24   ;y1
  21.         mov dl,79   ;x1
  22.         mov bh,7    ;blank line attribute
  23.         int 10h     ;video interrupt
  24.         pop bp      ;restore bp
  25.         sub ax,ax   ;zero ax
  26.         push ax     ;push row number
  27.         push ax     ;push column number
  28.         call _gotoyx  ;position cursor at 0,0
  29.         pop cx      ;cleanup parameters off the stack
  30.         pop cx      ; ditto
  31.         ret
  32. _clear  endp        ;end procedure
  33. ;
  34. _gotoyx proc near   ;define procedure
  35.         push bp     ;save old bp
  36.         mov bp,sp   ;
  37.         mov ah,2    ;function number
  38.         mov dh,[bp+4]   ;y in dh
  39.         mov dl,[bp+6]   ;x in dl
  40.         mov bh,0    ;current page
  41.         int 10h     ;video interrupt
  42.         pop bp      ;restore bp
  43.         ret         ;near return
  44. _gotoyx endp        ;end procedure
  45. ;
  46. _TEXT   ends
  47. end
  48.