
#include "storaxx.h"

extern unsigned char use_xms;
extern unsigned char use_ems;

void main(void)
{
   char far *ptr1;
   char far *ptr2;
   char far *ptr3;
   char i;

   use_xms = 0;
   use_ems = 1;

   xinit(0,1024,1024,1024);

   ptr1 = xalloc(9,1);
   ptr2 = xalloc(9,1);
   ptr3 = xalloc(9,1);   

   ptr1 = map_ptr(ptr1);
   for(i=0;i<9;i++) *(ptr1+i) = i;
   ptr1 = demap_ptr(ptr1,1);

   ptr2 = map_ptr(ptr2);
   for(i=0;i<9;i++) *(ptr2+i) = i;
   ptr2 = demap_ptr(ptr2,1);

   ptr3 = map_ptr(ptr3);
   for(i=0;i<9;i++) *(ptr3+i) = i;
   ptr3 = demap_ptr(ptr3,1);


   ptr3 = map_ptr(ptr3);
   for(i=0;i<9;i++) printf("%d  ",*(ptr3+i));
   ptr3 = demap_ptr(ptr3,0);
   printf("\n");

   ptr2 = map_ptr(ptr2);
   for(i=0;i<9;i++) printf("%d  ",*(ptr2+i));
   ptr2 = demap_ptr(ptr2,0);
   printf("\n");

   ptr1 = map_ptr(ptr1);
   for(i=0;i<9;i++) printf("%d  ",*(ptr1+i));
   ptr1 = demap_ptr(ptr1,0);
   printf("\n");


   xfree(ptr2);
   xfree(ptr1);
   xfree(ptr3);

   xshutdown();
};

