#include<stdio.h>
#include <conio.h>
-#include <limits.h>
+//#include <limits.h>
-int main(){
+#include "memory.h"
+
+int main(int argc, char *argv[])
+{
unsigned long i=0;
char near w;
- char huge *p =(char far *)0xD0000000;
+ char huge *p =(char huge *)(GetEMMSeg0()*0x10000);//0xD0000000;
//char far *q =(char far *)0x53332225;
- printf("1p=%p %ul\n", p, i);
- while(p<=(char far *)0xDFFFFFFF/*i<262144UL*/ && !kbhit())
+ printf("1p=%p %ul\n", p, GetEMMSeg0());
+ //while(!kbhit()){ printf("%p\n", ((GetEMMSeg0()*0x10000)+0x0fffffff)); }
+ //while(!kbhit()){ printf("%p\n", ((GetEMMSeg0()*0x10000)+0xffff)); }
+ if(argv[1]) { printf("switch on!\n"); while(!kbhit()){} }
+ while(p<=(char huge *)((GetEMMSeg0()*0x10000)+0xffff)/*i<262144UL*/ && !kbhit())
{
- printf("p=%p=%x %ul\n", p, *p, i);
-// *p = i;
+ if(argv[1]!=NULL) (*p) = i; else
+ //else printf("%p= %x% %ul\n", p, *p, i);
+ if((i%8)==0) printf("%p= %c %c %c %c %c %c %c %c\n", p,
+*p, *(p+1), *(p+2), *(p+3), *(p+4), *(p+5), *(p+6), *(p+7));
// (*p)++;
- p++;
+// printf(" %p\n", ((GetEMMSeg0()*0x10000)+0x0fffffff));
i++;
- }
- /*while((_UI16_MAX/2)<=i<(_UI16_MAX) && !kbhit())
- {
- printf("*p=%d %d\n",*p, i);
- /p = i;
- //(*p)++;
p++;
- i++;
- }*/
+ }
w=104;
//printf("*q=%d\n",*q);
//printf(" q=%p\n", q);
printf(" p=%p\n", p);
printf(" w=%d\n", w);
printf(" w=%p\n", w);
+ printf("GetEMMSeg0()=%p\n", GetEMMSeg0()*0x10000);
return 0;
}