home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m110 / 1.ddi / HLL / MASM / GRASPASM.ASM next >
Encoding:
Assembly Source File  |  1990-02-12  |  1.9 KB  |  71 lines

  1. ;--------------------------------------------------------------;
  2. ;       MASM program which demonstrates the ability to         ;
  3. ;       call GRASP from an external program                    ;
  4. ;                                                              ;
  5. ;       Assemble: MASM graspasm;                               ;
  6. ;       Link:     LINK graspasm;                               ;
  7. ;--------------------------------------------------------------;
  8.  
  9. DGROUP          group   _DATA,STACK
  10.  
  11. _TEXT           segment word public 'CODE'
  12.  
  13.         assume  cs:_TEXT,ds:DGROUP,ss:STACK
  14.  
  15. main            proc    near
  16.         mov    ax,DGROUP        ; make DS and ES
  17.         mov    ds,ax            ;   reference data
  18.         mov     es,ax
  19.  
  20.         mov    dx,offset load_pic    ; ES:DX points to command
  21.         call    grasp            ; send it to GRASP
  22.  
  23.         mov    dx,offset fade_pic    ; second command
  24.         call    grasp
  25.  
  26.         mov    dx,offset wait_key    ; etc.
  27.         call    grasp
  28.  
  29.         mov     ax,4c00h
  30.         int     21h
  31. main        endp
  32.  
  33.  
  34. ;-----------------------------------------------------------------------;
  35. ;       The GRASP procedure -- call with the segment:offset of the      ;
  36. ;       GRASP command string in ES:DX                                   ;
  37. ;-----------------------------------------------------------------------;
  38. grasp           proc    near
  39.  
  40.         mov     di,dx                   ; DI points to string which
  41.         mov     al,0                    ;   is null-terminated
  42.         mov     cx,0ffffh
  43.         cld
  44.         repnz   scasb
  45.         not     cx
  46.         dec     cx                      ; string length in CX
  47.         mov     ah,'G'                  ; call GRASP using
  48.         int     10h                     ;   function 'G'
  49.  
  50.         ret
  51. grasp           endp
  52.  
  53. _TEXT           ends
  54.  
  55.  
  56. _DATA        segment word 'DATA'
  57.  
  58. load_pic    DB    'pload Grasp,1',0    ; Grasp command strings
  59. fade_pic    DB    'pfade 1,1',0
  60. wait_key    DB    'waitkey',0
  61.  
  62. _DATA           ends
  63.  
  64.  
  65. STACK           segment para stack 'STACK'
  66.         dw      64 dup (?)
  67. STACK           ends
  68.  
  69.  
  70.         end     main
  71.