Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!hao!hplabs!sdcrdcf!sdcsvax!darrell From: darrell@sdcsvax.UUCP (Darrell Long) Newsgroups: net.arch,net.lang.c,net.micro,net.micro.pc,net.micro.68k Subject: Re: Re: Re: Need 286 "C" benchmark Message-ID: <894@sdcsvax.UUCP> Date: Wed, 29-May-85 00:20:15 EDT Article-I.D.: sdcsvax.894 Posted: Wed May 29 00:20:15 1985 Date-Received: Sat, 1-Jun-85 02:50:18 EDT References: <426@oakhill.UUCP> <8745@microsoft.UUCP> <583@intelca.UUCP> <433@oakhill.UUCP> <588@intelca.UUCP> <293@celerity.UUCP> Organization: EECS Dept. U.C. San Diego Lines: 76 Xref: watmath net.arch:1287 net.lang.c:5328 net.micro:10595 net.micro.pc:4093 net.micro.68k:842 Here's a little program that makes a good benchmark. It especially exercises the CALL instruction, clearly on of the most used of all instructions. This program finds the Knight's tour on an n*n chess board, I suggest you start with n=5. The running times grow exponentially in n. I have run this program on 68010's (SUN), WE-3200x (3B-2) and VAXen with interesting results. Let's see how the 80286 fares. #include #define TRUE 1 #define FALSE !TRUE #define n 5 #define n_sqr n*n int a[8]={2,1,-1,-2,-2,-1,1,2}; int b[8]={1,2,2,1,-1,-2,-2,-1}; int chess_board[n][n]; int count = 0; main() { int i,j; for (i = 0; i < n; i++) for (j = 0; j < n; j++) chess_board[i][j] = 0; chess_board[0][0] = 1; if (try(2,0,0)) for (i = 0; i < n; i++) { for (j = 0; j < n; j++) printf("\t%d",chess_board[i][j]); printf("\n"); } else printf("no solution in %d tries.\n", count); } try(i,x,y) int i,x,y; { int k,u,v,q_1; k = 0; do { count++; q_1 = FALSE; u = x + a[k]; v = y + b[k]; if (((u < n) && (u >= 0)) && ((v < n) && (v >= 0))) if (chess_board[u][v] == 0) { chess_board[u][v] = i; if (i < n_sqr) { q_1 = try((i + 1),u,v); if (!q_1) chess_board[u][v] = 0; } else q_1 = TRUE; }; } while ((!q_1) && (++k < 8)); return(q_1); } -- Darrell Long Department of Electrical Engineering and Computer Science University of California, San Diego USENET: sdcsvax!darrell ARPA: darrell@sdcsvax