#include <stdio.h>
#include "xms.h"
  
void main(void) {
    struct XMS_Move X;
    int handle;
  
    if(Installed_XMS()) {
        puts("XMS detected");
        if((handle = Alloc_XMS(1024)) != 0) {
            puts("Allocated 1kb.");
            /* Now transfer to XMS */
            X.Length = 1024;
            X.SourceHandle = 0; /* Indicate conventional memory */
            X.SourceOffset = 0L;
            X.DestHandle = 0;
            X.DestOffset = 0L;
            if(Move_XMS(&X))
                puts("Cannot move XMS!");
            else
                puts("Data move to XMS");
        } else
            puts("Cannot get XMS");
    } else
        puts("No XMS");
}
  
