home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / FORTRAN / SUPERT87.ZIP / RMCLS.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-12-15  |  1.6 KB  |  75 lines

  1.         name    cls 
  2. ;
  3. ; subroutine cls : assembly language routine that uses the video
  4. ; bios call to clear the screen
  5. ;
  6. ; fortran call is : call cls 
  7. ;
  8. ;
  9. ;    interface to IBM professional fortran 1.0
  10.  
  11. stack_size    equ    6    ; number of bytes needed on stack
  12.  
  13. data        segment
  14.         db    'cls     '
  15. sp_save    dw    ?
  16.         dd    cls 
  17.         dd    0
  18. data        ends
  19.  
  20.  
  21.  
  22. ;
  23. code        segment    'code'
  24.         assume    cs:code,ds:data,es:nothing,ss:nothing
  25.         public    cls 
  26. cls         proc        far
  27.  
  28.  
  29. ;----------execute Profort standard entry linkage--------------------
  30.  
  31.         push    ds
  32.         sub    bp,stack_size+6
  33.         mov    ax,data
  34.         mov    ds,ax
  35.         mov    sp_save,sp
  36.         mov    sp,bp
  37. ;---------------------------------------------------------------------
  38.  
  39. ;    make call for video parameters to get the number of the
  40. ;    active page needed by the video bios set cursor command
  41.  
  42.         mov    ah,15        ; get current video state
  43.         int    10h        ; call video bios
  44.  
  45.         mov    cx,0        ; upper left corner is (0,0)
  46.  
  47.         mov    dx,184fh    ; assume lower right corner at (24,79)
  48.         cmp    ah,80        ; but make sure were in 80 colimn mode
  49.         jz    is_wide
  50.  
  51. ;    if we get here, were in 40 column mode... so adjust dx to...
  52.  
  53.         mov    dl,27h    ; (24,39)
  54. is_wide:
  55.         mov    bh,7        ; set display attribute
  56.         mov    al,0        ; get set to scroll entire screen
  57.         mov    ah,6        ; set scroll screen function
  58.         int    10h        ; call video bios
  59.  
  60.  
  61. ;-------------perform exit linkage------------------------------------
  62.  
  63.         add    sp,stack_size+2
  64.         ret
  65. ;---------------------------------------------------------------------
  66.  
  67. cls         endp
  68. code        ends
  69.         end
  70.  
  71. stack        segment word stack 'stack'
  72.         db    stack_size dup(?)
  73. stack        ends
  74.         end
  75.