home *** CD-ROM | disk | FTP | other *** search
- name cls
- ;
- ; subroutine cls : assembly language routine that uses the video
- ; bios call to clear the screen
- ;
- ; fortran call is : call cls
- ;
- ;
- ; interface to IBM professional fortran 1.0
-
- stack_size equ 6 ; number of bytes needed on stack
-
- data segment
- db 'cls '
- sp_save dw ?
- dd cls
- dd 0
- data ends
-
-
-
- ;
- code segment 'code'
- assume cs:code,ds:data,es:nothing,ss:nothing
- public cls
- cls proc far
-
-
- ;----------execute Profort standard entry linkage--------------------
-
- push ds
- sub bp,stack_size+6
- mov ax,data
- mov ds,ax
- mov sp_save,sp
- mov sp,bp
- ;---------------------------------------------------------------------
-
- ; make call for video parameters to get the number of the
- ; active page needed by the video bios set cursor command
-
- mov ah,15 ; get current video state
- int 10h ; call video bios
-
- mov cx,0 ; upper left corner is (0,0)
-
- mov dx,184fh ; assume lower right corner at (24,79)
- cmp ah,80 ; but make sure were in 80 colimn mode
- jz is_wide
-
- ; if we get here, were in 40 column mode... so adjust dx to...
-
- mov dl,27h ; (24,39)
- is_wide:
- mov bh,7 ; set display attribute
- mov al,0 ; get set to scroll entire screen
- mov ah,6 ; set scroll screen function
- int 10h ; call video bios
-
-
- ;-------------perform exit linkage------------------------------------
-
- add sp,stack_size+2
- ret
- ;---------------------------------------------------------------------
-
- cls endp
- code ends
- end
-
- stack segment word stack 'stack'
- db stack_size dup(?)
- stack ends
- end