/* (c) 2010 by Gerhard Wiesinger Source Code released under GNU GPL, v2 only and not any later version. http://www.gnu.org/licenses/gpl-2.0.html Must be compiled with OpenWatcom C for long long support. */ #ifdef __WATCOMC__ #if defined(__386__) && !defined(__WINDOWS_386__) #error Wrong build target, use wcc instead of wcc386! #endif #endif /* end __WATCOMC__ */ #include #include #include #include #include #include #define INT_SCREEN 0x10 #define LOOP 1000000L typedef unsigned char UCHAR; typedef unsigned int WORD; typedef unsigned long DWORD; typedef unsigned long long QWORD; void usage(void) { printf("Usage:\n"); printf("No parameters: print performance information\n"); printf("-h help\n"); printf("-1 do loop only once\n"); printf("-2 do loop 2 mio times\n"); printf("-3 do loop 10 mio times\n"); printf("-4 do loop 20 mio times\n"); printf("-5 do loop 100 mio times\n"); printf("default loop is 1 mio times\n"); exit(1); } int main(int argc, char* argv[]) { DWORD i = 0; union REGS inregs, outregs; struct SREGS outsregs; time_t start1; time_t stop1; time_t start1_nc; time_t stop1_nc; time_t start2; time_t stop2; WORD window = 1; DWORD loop = LOOP; int c; printf("INT10PER performance information V1.0, (c) 2010 by Gerhard Wiesinger\n\n"); while ( (c = getopt(argc, argv, "h12345")) != -1) { switch (c) { case 'h': usage(); break; case '1': loop = 1; break; case '2': loop = 2000000L; break; case '3': loop = 10000000L; break; case '4': loop = 20000000L; break; case '5': loop = 100000000L; break; case '?': usage(); break; } } inregs.x.ax = 0x4F02; inregs.x.bx = 0xC000 | 0x101; // bh=bit 15=0 (clear), bit14=0 (windowed) int86x(INT_SCREEN, &inregs, &outregs, &outsregs); /* Call INT 10h */ start1 = time(NULL); for (i=0; i