home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / graspext / ctogr.asm < prev    next >
Encoding:
Assembly Source File  |  1986-09-06  |  823 b   |  41 lines

  1. ; CTOGR.ASM
  2. ;
  3. ; written by John Bridges
  4. ;
  5. ; Call GRASP functions from your 'C' programs
  6. ;
  7. ; after assembling and linking this routine with your 'C' program, you would
  8. ; execute GRASP commands by entering 'C' function calls like:
  9. ;
  10. ; grasp("video a\r");
  11. ; grasp("pload picture1,1\r");
  12. ; grasp("pfade 20,1\r");
  13. ;
  14. ;
  15. codeseg segment para public 'code'
  16.     assume cs:codeseg
  17.  
  18.     extrn    strlen:near
  19.     public    grasp
  20.  
  21. grasp    proc    near        ; grasp(string)
  22.     push    bp
  23.     mov    bp,sp
  24.     mov    ax,4[bp]    ; pointer to string
  25.     push    ax
  26.     call    strlen        ; standard C function to return length
  27.     add    sp,2
  28.     mov    cx,ax        ; put length into CX
  29.     mov    dx,4[bp]    ; get pointer into DX
  30.     mov    ax,ds
  31.     mov    es,ax        ; set ES to data segment
  32.     mov    ah,'G'        ; load function number
  33.     int    10h        ; execute it!
  34.     pop    bp
  35.     ret
  36. grasp    endp
  37.  
  38. codeseg    ends
  39.     end
  40.  
  41.