home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
fortran
/
library
/
comline
/
comline.asm
< prev
next >
Wrap
Assembly Source File
|
1991-07-01
|
3KB
|
91 lines
;=======================================================================
;
; PROGRAM FILE: COMLINE.ASM
;
; DATE: June 23, 1991
;
; VERSION: 2.02 REVISION DATE: June 26, 1991
;
; AUTHOR: Scott D. Heavner
;
; LANGUAGE: Assembly Language Routine for FORTRAN
;
; COPYRIGHT: 1991, Scott D. Heavner
;
;=======================================================================
;
; DESCRIPTION: A routine to read the user options entered at the
; command line into a FORTRAN string. The first character
; of the string will be the length of the line input by the
; user. Input ends with a CR.
;
; CONTENTS: call CLINE(CHARACTER*128)
;
;
; APPRECIATION: If you find this program instructive or helpful, a
; small (or large) donation would be greatly appreciated.
;
; Send them to: Scott Heavner
; 19 Pine Woods Drive
; North Tonawanda, NY 14120
;
; COMMENTS: Send EMAIL to sdh@po.cwru.edu
;
;=======================================================================
TITLE COMLINE.ASM
NAME COMLINE
;----------------------------------------------------------------------
; Subroutine CLINE(CHARACTER*128)
;
; Copyright 1991 -- Scott D. Heavner
;
; Uses DOS INT 21-2F to read address of last load (where command line
; is stored). This may be adjusted by an overlay file. If this
; adjustment does occur, the only thing that should be altered is
; the length of the string (and possibly the first character will
; become a carriage return. Since this routine does not clear
; the string before it's use, the previous data will remain.
;
;----------------------------------------------------------------------
.8087
CODE SEGMENT BYTE PUBLIC
CODE ENDS
DATA SEGMENT WORD PUBLIC
DATA ENDS
ASSUME CS: CODE, DS: DATA, SS: DATA, ES: DATA
CODE SEGMENT
PUBLIC CLINE
CLINE PROC FAR
push bp ; Prepare for far call
mov bp,sp ; +
;
push si ; Save Index Registers
push di ; +
push ds ; Save Segment Registers
push es ; +
;
les bx,DWORD PTR [bp+6] ; Put offset of CLINE variable in DI
mov DI,bx ; +
push es
mov SI,0080H ; Load SI with offset of Command Line input
mov ax,2F00H ; Interrupt to get seg of main (return ES:BX)
int 21H ; - may not work with overlay files
push es ; Transfer ES(main prog addr) to DS
pop ds ; DS now contains seg of Comline
pop es ; ES now contains seg of Destination String
mov cx,64 ; Load CX with number of words to move
rep movsw ; Transfer Command line to String
;
pop es ; Restore Segment Registers
pop ds ; +
pop di ; Restore Index Registers
pop si ; +
;
mov sp,bp ; Return from far call
pop bp ; +
ret 4 ; +
CLINE ENDP
CODE ENDS
END