因 為 問 題 沒 有 說 甚 麼 語 言 , 我 假 設 是 在 談 匯 編 , 因 為 在 C 或 JAVA 環 境 下 要 向 系 統 分 配 64MB XMS 記 憶 應 該 挺 輕 鬆 的 , 匯 編 得 向 Jack Ellis 兄 詢 問 解 決 辦 法 :
Yes, they must load a V3.0 XMS manager, e.g. QHIMEM or V3.10+ HIMEM (MS-DOS V6.22+). They must use the program
steps shown below --
先 要 載 入 符 合 XMS 3.0 標 準 的 管 理 程 序 , 例 如 QHIMEM 或 HIMEM V3.10 ( MS-DOS V6.22 以 上 ) , 然 後 --
A) Find the "entry point" address of the XMS manager: ( 找 XMS 管 理 員 的 "進 入 地 址" )
XEnt: dd 0 ;XMS "entry address" holder. ( XMS "進 入 地 址" 儲 存 )
...
...
...
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).
由 這 裡 開 始 , 鎖 定 64MB 以 下 的 XMS 記 憶 步 驟 和 XMS 2.0 是 一 樣 的 。
重 點 是 要 求 64MB 以 上 的 XMS 的 "功 能 號" 必 需 是 089h ( 並 非 一 般 的 009h ) , 並 必 需 將 正 確 的 KByte 數 字 設 定 在 32bit 的 EDX 暫 存 器 內 而 並 非 是 用 16bit 的 DX 暫 存 器 )
本帖最近评分记录
(共 1 条)
点击查看详情
| 评分人 | 分数 | 时间 |
| byxyk |
+2 |
2007-06-28 20:19 |