📄 dpmiqb.bas
字号:
'Program: DPMIQB.BAS
' QBASIC Protected Mode Application.
'Interpreter: QBASIC with machine code
'Author: Gunther Ilzig
' CIS: 100775,2275
' Internet: 100775.2275@compuserve.com
'Status: Freeware
DECLARE SUB Waiting ()
DECLARE SUB ReadCode (mcseg%, mcoff%)
DECLARE FUNCTION CheckDpmi% (udt&)
TYPE DpmiPar 'UDT for DPMI parameters
entry AS LONG 'DPMI entry point
'offset 0
flags AS INTEGER 'flag for 32-bit support
'offset 4
cpu AS INTEGER 'processor type
'offset 6
major AS INTEGER 'DPMI major version
'offset 8
minor AS INTEGER 'DPMI minor version
'offset 10
para AS INTEGER 'number of paragraphs for private
'DPMI data
'offset 12
pseg AS INTEGER 'segment private Host data area
'offset 14
hseg AS INTEGER 'segment hello string
'offset 16
hoff AS INTEGER 'offset hello string
'offset 18
END TYPE
DIM dpmi AS DpmiPar 'define the check structure
DIM mc%(400) 'machine code array
words% = 0 'number of words for the DPMI Host
eflag% = 0 'error flag
'----- The string to print in the Protected Mode
hello$ = ""
hello$ = hello$ + CHR$(&HD) + CHR$(&HA)
hello$ = hello$ + " Hello 32-bit Protected Mode World from QBASIC!"
hello$ = hello$ + CHR$(&HD) + CHR$(&HA) + CHR$(&HD) + CHR$(&HA)
hello$ = hello$ + " Please, press any key to continue ..."
hello$ = hello$ + CHR$(&HD) + CHR$(&HA)
hello$ = hello$ + CHR$(&H24)
dpmi.hseg = VARSEG(hello$) 'string segment
dpmi.hoff = SADD(hello$) 'string offset
'----- Code starts here.
CLS 'clear text screen
'----- Check DPMI support.
IF CheckDpmi%(dpmi.entry) <> 1 THEN
'DPMI support isn't available
PRINT
PRINT " Sorry!"
PRINT " Your configuration doesn't support DPMI."
PRINT
PRINT " This application works only in the following environments:"
PRINT
PRINT "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -