我在网上获得的解答,for your reference.
:I want to write a small program in assembler, this program will :help us enter 386 protected mode from real mode after boot. :The problem I encountered it that Ido
n't know how to :enable/disable the A20 gate... Need more info. Is XMS installed, you got the offset to it's call point?
To manually override...
cli
mov al, 0D1h
out 64h, al
mov al, 0DDh
out 60h, al
sit
But this code assumes allot of things.
int 2Fh, 1687h will get you the call entry to DPMI via ES
I and SI will contain the size of the DPMI host. Alloc mem for host's size, if any, then
mov that ret into es, clear out ax, and call the entry point.
Check Wrox MasterClass Asm src code, it's on their page www.wrox.com and Walter Oney goes over this in Sys Programming for Windows 95 using DPMI.
<><><>