[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Cookbook
1. Compile or assemble the files required.
2. Link the files together, making sure that the device vector
table is the first module within the link.
3. Run EXETOBIN on the resulting .EXE or .COM file to produce a .BIN
file. There should be no relocation fixups required.
4. Run program BH (provided with the toolkit) on the .BIN
file to produce the .BGI file.
The resulting driver is now ready for testing. Examine the file TEST.C for
an example of installing, loading, and calling a newly-created device
driver.
Examples
; To call any BGI function from assembly language, include the
; structure below and use the CALLBGI macro.
CALLBGI MACRO P
MOV SI,$&P ; PUT OPCODE IN (SI)
CALL CS:DWORD PTR BGI_ADD ; BGI_ADD POINTS TO DRIVER
ENDM
; e.g., to draw a line from (10,15) to (200,300):
MOV AX, 10
MOV BX, 15
MOV CX, 200
MOV DX, 300
CALLBGI VECT
; To index any item in the status table, include the status table
; structures below and use the BGISTAT macro.
BGISTAT MACRO P ; GET ES:<SI> --> BGI STATUS
LES SI, CS:DWORD PTR STABLE ; GET LOCATION OF STATUS TO SI
ADD SI, $&P ; OFFSET TO CORRECT LOCATION
ENDM
; e.g., to obtain the aspect ratio of a device:
BGISTAT ASPEC
MOV AX, ES:[SI] ; (AX)= Y/X *10000
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson