home *** CD-ROM | disk | FTP | other *** search
- GRASP 3.5 -- High Level Language Examples -- January 1990
-
- The directories beneath this one contain examples of interfaces between
- Grasp and programs written in Turbo Pascal (versions 3.x and 4.0), Turbo
- Basic (version 1.1), Turbo C (version 1.0), Microsoft and Quick C (version
- 5.0 and 5.1), Quick Basic (version 4.0), and Microsoft Macro Assembler
- (version 5.1). For each language there is a Grasp program and a program
- written in the appropriate language (source and compiled versions). The
- programs are very simple; they're intended only to show the mechanics of
- the interface.
-
- PLEASE NOTE THAT THE EXAMPLES USE CGA 4-COLOR MODE EXCLUSIVELY. If you
- want to use another mode (or if your system does not support CGA 4-color)
- you'll need to modify the code and provide your own pictures or clippings.
-
- To run one of the examples, copy the image file Grasp.PIC from the Grasp
- directory to the example's subdirectory. Then start Grasp and execute the
- small Grasp program. It Executes the other language's program after three
- preparatory steps.
-
- These steps are the same regardless of the language you're using. The
- first step is automatic: on loading, Grasp sets up an interrupt handler
- for interrupt 10 function G, which the other language will use to call
- Grasp.
-
- The second step is to set the video mode with the Video command. The last
- step is to allocate memory for any pictures and clippings that will be
- loaded later, using the Pnewbuf command.
-
- In some of the examples Pnewbuf has been given parameters telling it to
- set aside a buffer larger than the default screen size. This is necessary
- with some languages to avoid a memory allocation error. An alternative
- method is to use Microsoft's EXEMOD utility to set the Maximum Allocation
- field in the EXE file header to be equal to the Minimum Allocation field.
-
- Grasp passes control to the other language's program with the Exec
- command. The other program can then execute one or a group of Grasp
- commands, by placing them in memory, setting registers, and issuing an
- interrupt 10 hex.
-
- The registers must be loaded with the following values:
- AH = `G' (47 hex)
- CX = Length of the command string(s)
- ES:DX = Segment:Offset address of the command string(s)
-
- The string can contain any legal Grasp commands (for example, PFADE1,1).
- Separate commands with Carriage return-Line feed pairs.