home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progc / fixed300.arj / CPMS0001.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-29  |  569 b   |  31 lines

  1. #if 0
  2. From: Joe Huffman <joe@proto.com>
  3. Subject: constant near pointers for 386
  4. Date: Thu, 23 May 91 11:38:17 PDT
  5. Status: Fixed in 3.0
  6. #endif
  7.  
  8. #include <stdio.h>
  9.  
  10. /* 'ztc bug -mx' Ignores the constant 0xA0000 in the first situation. */
  11.  
  12. char *table[10];
  13.  
  14. int main()
  15. {
  16.   int i;
  17.  
  18.   for(i = 0; i < 10; i++)
  19.   {
  20.     unsigned long int offset = i * 0x1000L;
  21. #if 1
  22.     table[i] = (char *)0xA0000 + (offset & 0xffff);
  23. #else
  24.     table[i] = (char *)(offset & 0xffff) + 0xA0000;
  25. #endif
  26.     printf("table[%d] = %p\n", i, table[i]);
  27.   }
  28.   return 0;
  29. }
  30.  
  31.