QB.BI: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
m (Removed protection from "QB.BI") |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
' QB.BI - Assembly Support Include File | ' QB.BI - Assembly Support Include File | ||
' | ' | ||
' Copyright | ' Copyright (C) 1987 Microsoft Corporation | ||
' | ' | ||
' Purpose: | ' Purpose: | ||
Line 57: | Line 57: | ||
' Generate a software interrupt, loading all but the segment registers | ' Generate a software interrupt, loading all but the segment registers | ||
' | ' | ||
{{ | {{Text|DECLARE|#87cefa}} {{Cl|SUB}} {{Cl|INTERRUPT}} (intnum {{Cl|AS}} {{Cl|INTEGER}}, inreg {{Cl|AS}} RegType, outreg {{Cl|AS}} RegType) | ||
' | ' | ||
' Generate a software interrupt, loading all registers | ' Generate a software interrupt, loading all registers | ||
' | ' | ||
{{ | {{Text|DECLARE|#87cefa}} {{Cl|SUB}} {{Cl|INTERRUPTX}} (intnum {{Cl|AS}} {{Cl|INTEGER}}, inreg {{Cl|AS}} RegTypeX, outreg {{Cl|AS}} RegTypeX) | ||
' | ' | ||
' Call a routine at an absolute address. | ' Call a routine at an absolute address. | ||
Line 67: | Line 67: | ||
' be added to this declare statement before the parameter given. | ' be added to this declare statement before the parameter given. | ||
' | ' | ||
{{ | {{Text|DECLARE|#87cefa}} {{Cl|SUB}} {{Cl|CALL ABSOLUTE|ABSOLUTE}} (address {{Cl|AS}} {{Cl|INTEGER}}) | ||
' | ' | ||
' Generate a software interrupt, loading all but the segment registers | ' Generate a software interrupt, loading all but the segment registers | ||
' (old version) | ' (old version) | ||
' | ' | ||
{{ | {{Text|DECLARE|#87cefa}} {{Cl|SUB}} {{Text|INT86OLD|#87cefa}} (intnum AS {{Cl|INTEGER}}, inarray(1) {{Cl|AS}} {{Cl|INTEGER}}, outarray(1) {{Cl|AS}} {{Cl|INTEGER}}) | ||
' | ' | ||
' Gemerate a software interrupt, loading all the registers | ' Gemerate a software interrupt, loading all the registers | ||
' (old version) | ' (old version) | ||
' | ' | ||
{{ | {{Text|DECLARE|#87cefa}} {{Cl|SUB}} {{Text|INT86XOLD|#87cefa}} (intnum {{Cl|AS}} {{Cl|INTEGER}}, inarray(1) {{Cl|AS}} {{Cl|INTEGER}}, outarray(1) {{Cl|AS}} {{Cl|INTEGER}}) | ||
{{CodeEnd}} | {{CodeEnd}} | ||
Line 97: | Line 96: | ||
ds {{Cl|AS}} {{Cl|INTEGER}} | ds {{Cl|AS}} {{Cl|INTEGER}} | ||
es {{Cl|AS}} {{Cl|INTEGER}} | es {{Cl|AS}} {{Cl|INTEGER}} | ||
{{Cl|END TYPE}} | {{Cl|END TYPE}} | ||
{{CodeEnd}} | {{CodeEnd}} | ||
: ''Explanation:'' DECLARE statements in QB4.5 and PDS(7.1) are not required because the Library MUST be included with [[INTERRUPT]], [[INTERRUPTX]] and [[CALL ABSOLUTE|ABSOLUTE]] or a "Subprogram not defined" [[ERROR Codes|error]] will occur. | : ''Explanation:'' DECLARE statements in QB4.5 and PDS(7.1) are not required because the Library MUST be included with [[INTERRUPT]], [[INTERRUPTX]] and [[CALL ABSOLUTE|ABSOLUTE]] or a "Subprogram not defined" [[ERROR Codes|error]] will occur. | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
* [[$INCLUDE]], [[INTERRUPT]], [[INTERRUPTX]] | * [[$INCLUDE]], [[INTERRUPT]], [[INTERRUPTX]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Latest revision as of 22:44, 11 February 2023
The QB.BI file can be used for INTERRUPT or INTERRUPTX routines by $INCLUDEing the file in a program. It is useful for the TYPE and SUB declarations.
Description
- Create your own BI files to $INCLUDE to hold your own TYPE definitions. Use notepad and save as All Files as filename.BI
- In QBasic the BI library or support file MUST be included in a program package or download!
- QB64 programs do not require any INCLUDED files once the BAS file is compiled!
Examples
- The QB.BI file contents:
'************************************************************************** ' QB.BI - Assembly Support Include File ' ' Copyright (C) 1987 Microsoft Corporation ' ' Purpose: ' This include file defines the types and gives the DECLARE ' statements for the assembly language routines CALL ABSOLUTE, ' INTERRUPT, INTERRUPTX, INT86OLD, and INT86XOLD. ' '*************************************************************************** ' ' Define the TYPE needed for INTERRUPT ' TYPE RegType ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flags AS INTEGER END TYPE ' ' Define the TYPE needed for INTERRUPTX ' TYPE RegTypeX ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flags AS INTEGER ds AS INTEGER es AS INTEGER END TYPE ' ' DECLARE statements for the 5 supported routines ' ----------------------------------------- ' ' Generate a software interrupt, loading all but the segment registers ' DECLARE SUB INTERRUPT (intnum AS INTEGER, inreg AS RegType, outreg AS RegType) ' ' Generate a software interrupt, loading all registers ' DECLARE SUB INTERRUPTX (intnum AS INTEGER, inreg AS RegTypeX, outreg AS RegTypeX) ' ' Call a routine at an absolute address. ' NOTE: If the routine called takes parameters, then they will have to ' be added to this declare statement before the parameter given. ' DECLARE SUB ABSOLUTE (address AS INTEGER) ' ' Generate a software interrupt, loading all but the segment registers ' (old version) ' DECLARE SUB INT86OLD (intnum AS INTEGER, inarray(1) AS INTEGER, outarray(1) AS INTEGER) ' ' Gemerate a software interrupt, loading all the registers ' (old version) ' DECLARE SUB INT86XOLD (intnum AS INTEGER, inarray(1) AS INTEGER, outarray(1) AS INTEGER) |
- Ethan Winer's compact "RegType.BI" file for INTERRUPT or INTERRUPTX:
TYPE RegType ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flags AS INTEGER ds AS INTEGER es AS INTEGER END TYPE |
- Explanation: DECLARE statements in QB4.5 and PDS(7.1) are not required because the Library MUST be included with INTERRUPT, INTERRUPTX and ABSOLUTE or a "Subprogram not defined" error will occur.
See also