home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
1991
/
10
/
embedcp
/
test
/
mem3.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-23
|
471b
|
23 lines
#include <stdio.h>
struct ctrl_reg { unsigned short offset;
unsigned short segment;
unsigned short count;
unsigned char command;
};
main()
{
struct ctrl_reg *ctrl;
unsigned short i=0,j,count = 0;
ctrl = (struct ctrl_reg *)(((long) 0xC800 << 16) + 0x100);
while (1){
ctrl->count = i;
if ((j = ctrl->count) != i) goto error;
i++;
printf ("Cycle %d\n",count++);
}
error:
printf("Expected %d - got %d\n",i,j);
}