mov ax,04300h ;Inquire if we have an XMS manager. ( 有 沒 有 XMS 管 理 員 呢 ? )
int 02Fh
cmp al,080h ;Is an XMS manager installed? ( XMS 管 理 員 載 入 了 嗎 ? )
jne NoXMSDvr ;No? Take appropriate error action. ( 沒 有 就 宣 告 錯 誤 )
mov ax,04310h ;Get XMS manager "entry" address. ( 取 得 XMS 管 理 員 進 入 地 址 )
int 02Fh
push es ;Save XMS manager "entry" address ( 儲 存 起 "進 入 地 址" )
push bx ; in "XEnt" 32-bit word, above. ( 對 應 "XEnt" 32bit 字 組 )
pop XEnt
B) Ask the XMS manager for the desired XMS memory: ( 向 XMS 管 理 員 索 取 記 憶 體 )
mov ah,089h ;MUST use 089h (not 009h) for > 64-MB! ( 大 於 64MB 一 定 要 使 用 089h )
mov edx,MemKB ;MUST use EDX-reg. (not DX-reg.) for
; memory, which is number of KBytes. ( 一 定 要 使 用 EDX 暫 存 器 , 使 用 KBytes 為 單 位 )
call XEnt ;Call XMS manager with this request. ( 呼 叫 XMS 管 理 員 並 送 出 要 求 )
cmp ax,1 ;Did XMS manager return 1 = success? ( XMS 管 理 員 回 覆 1 嗎 ? 1 就 是 成 功 )
jne NoXMSMem ;No? Take appropriage error action. ( 宣 告 錯 誤 )
From then on, the steps to "lock" and use the XMS memory are the same
as for a V2.0 XMS manager and for using XMS memory blocks of 64-MB or
less. The IMPORTANT items are that the XMS "function code" used to
request over 64-MB of memory must be 089h (not 009h like before), and
the number of KBytes requested must be set in the 32-bit EDX register
(not the 16-bit DX register like before).