dpmiqb.bas
来自「如何使用QBasic进入32位保护模式」· BAS 代码 · 共 65 行
BAS
65 行
'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 + =
减小字号Ctrl + -
显示快捷键?