Application Examples
{
char
*ptr;
ptr = (char *) (((unsigned long)segment << 16) + offset);
return (ptr);
}
/* ------------------------------------------------------------------ */
/* Function which determines whether EMM device driver is installed.
*/
/* ------------------------------------------------------------------ */
char
emm_installed()
{
char *EMM_device_name = "EMMXXXX0";
char *int_67_device_name_ptr;
/* -------------------------------------------------------- */
/* AH = DOS get interrupt vector function.
*/
/* -------------------------------------------------------- */
input_regs.h.ah = 0x35;
/* -------------------------------------------------------- */
/* AL = EMM interrupt vector number.
*/
/* -------------------------------------------------------- */
input_regs.h.al = EMM_INT;
intdosx (&input_regs, &output_regs, &segment_regs);
/* -------------------------------------------------------- */
/* Upon return ES:0Ah points to location where device name
*/
/* should be.
*/
/* -------------------------------------------------------- */
int_67_device_name_ptr = build_ptr(segment_regs.es,0xA);
/* -------------------------------------------------------- */
/* Compare memory with EMM device name.
*/
/* -------------------------------------------------------- */
if (memcmp(EMM_device_name, int_67_device_name_ptr,
DEVICE_NAME_LENGTH) == 0)
return (TRUE);
else
return (FALSE);
}
/* ------------------------------------------------------------------ */
/* Function which determines if there are enough unallocated expanded */
/* memory pages for the application.
*/
/* ------------------------------------------------------------------ */
char enough_unallocated_pages (pages_needed)
int
pages_needed;
{
input_regs.h.ah = GET_UNALLOCATED_PAGE_COUNT;
int86 (EMM_INT, &input_regs, &output_regs);
if (output_regs.h.ah! = 0 || pages_needed > output_regs.x.bx)
return (FALSE);
else
return (TRUE);
}
4-8
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com