TESTHMA - 2


HMMEntry dd ?

.CODE

begin:

mov ax, DGROUP

mov ds, ax

mov ah, 9h ;

mov dx, OFFSET msg

int 21h

; , HIMEM.SYS

mov ax, 4300h

int 2fh

cmp al, 80h

je HMM_installed

; ,

;

mov ah, 9h

mov dx, OFFSET noHMM

int 21h

jmp terminate

HMM_installed:

mov ah, 9h

mov dx, OFFSET yesHMM

int 21h

;

mov ax, 4310h

int 2fh

mov word ptr cs:[HMMEntry][0], bx

mov word ptr cs:[HMMEntry][2], es

;

mov ah, 9h

mov dx, OFFSET ver1

int 21h

mov ax,0

call cs:[HMMEntry]

;

call Print_word

mov ah, 9h

mov dx, OFFSET ver2

int 21h

mov ax, bx

call Print_word

; HMA

mov ah, 9h

mov dx, OFFSET hmareq

int 21h

mov ax,0100h

mov dx,0ffffh

call cs:[HMMEntry]

or ax, ax

jnz hmareq_ok

jmp error

hmareq_ok:

mov ah, 9h

mov dx, OFFSET okmsg

int 21h

; A20

mov ah, 9h

mov dx, OFFSET enA20

int 21h

mov ax,0300h

call cs:[HMMEntry]

or ax, ax

jnz enA20_ok

jmp error

enA20_ok:

mov ah, 9h

mov dx, OFFSET okmsg

int 21h

; A20

mov ah, 9h

mov dx, OFFSET dsA20

int 21h

mov ax,0400h

call cs:[HMMEntry]

or ax, ax

jnz dsA20_ok

jmp error

dsA20_ok:

mov ah, 9h

mov dx, OFFSET okmsg

int 21h

; HMA

mov ah, 9h

mov dx, OFFSET hmarel

int 21h

mov ax,0200h

call cs:[HMMEntry]