home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------------------------;
- ; MASM program which demonstrates the ability to ;
- ; call GRASP from an external program ;
- ; ;
- ; Assemble: MASM graspasm; ;
- ; Link: LINK graspasm; ;
- ;--------------------------------------------------------------;
-
- DGROUP group _DATA,STACK
-
- _TEXT segment word public 'CODE'
-
- assume cs:_TEXT,ds:DGROUP,ss:STACK
-
- main proc near
- mov ax,DGROUP ; make DS and ES
- mov ds,ax ; reference data
- mov es,ax
-
- mov dx,offset load_pic ; ES:DX points to command
- call grasp ; send it to GRASP
-
- mov dx,offset fade_pic ; second command
- call grasp
-
- mov dx,offset wait_key ; etc.
- call grasp
-
- mov ax,4c00h
- int 21h
- main endp
-
-
- ;-----------------------------------------------------------------------;
- ; The GRASP procedure -- call with the segment:offset of the ;
- ; GRASP command string in ES:DX ;
- ;-----------------------------------------------------------------------;
- grasp proc near
-
- mov di,dx ; DI points to string which
- mov al,0 ; is null-terminated
- mov cx,0ffffh
- cld
- repnz scasb
- not cx
- dec cx ; string length in CX
- mov ah,'G' ; call GRASP using
- int 10h ; function 'G'
-
- ret
- grasp endp
-
- _TEXT ends
-
-
- _DATA segment word 'DATA'
-
- load_pic DB 'pload Grasp,1',0 ; Grasp command strings
- fade_pic DB 'pfade 1,1',0
- wait_key DB 'waitkey',0
-
- _DATA ends
-
-
- STACK segment para stack 'STACK'
- dw 64 dup (?)
- STACK ends
-
-
- end main
-