Just before all the wheels fell off, Gene Banks made a free throw with 22 seconds to go tonight and Duke upset No. 3-ranked Kentucky, 55-54, when the losers' habitual hero, Kyle Macy, missed a 17-foot jump shot under heavy defensive pressure at game's end.

Along with Purdue, a surprise 75-69 winner over Indiana in the other semifinal, Duke advances to Saturday's championship game of the NCAA Mideast Regional basketball tournament here.

With 23,380 screaming Kentucky crazies in their ears, with Kentucky's machete-subtle defense backing at their every movement, with a skinny Kentucky center named Fred Cowan scoring 23 points in the second half -- with all that going on, Duke could score only 18 points in the last half, could shoot only 38.5 per cent, could make only eight of 14 free throws.

It was crash-and-burn time at Rupp Arena, scene of many disasters for unwary travelers.But Duke had been so wonderful in the first half, with big Mike Gminski floating in six of eight shots and quick Vance Taylor slicing through the machetes to make six of seven, that its halftime lead of 37-23 was enough to save the Devils from the licking flames of ignaminious defeat.

"It certainly wasn't picture-perfect, but it's great to be playing Saturday," said Bill Foster, Duke's lameduck coach who would like to go to his new job at South Carolina with a national championship to remember.

"We had a great first half," he said, "but in the second half we didn't get the movement of players and the basketball we like. We just thank the Lord that at the end, Macy's shot didn't go in."

With 11 minutes to play, Duke led by 12 points, 45-33. Duke made only two field goals after that. Whatever malaise settled upon the Devils in the last two weeks of the Atlantic Coast Conference regular-season schedule -- when they lost five of seven games -- seemed to be paying another unwelcome visit, for here came Kentucky, flying on the wings of Cowan's 15 straight points to tie the game at 54-all with 37 seconds to play.

Duke asked for time out. "We, me anyway, had lost our composure some," said Taylor.

The clock was running now. From 27 seconds to 26, 25 . . . and Gene Banks had the ball on the right side, looking, looking . . . "I turned and faced the basket," he said later, "and I saw a lane, I saw it and I went for it up the middle and got fouled."

It was a two-shot foul with 22 seconds to play.

Banks made the first free throw. "It hit it with a lot of confidence," he said, but then he missed the second and with nine seconds to go Kentucky called a time out.

From Paducah in the west to Inez in the east, Kentuckians knew that Macy would shoot it if he couldn't get it inside to Cowan, who had missed only one of nine second-half shots. From Murphy in the west to Manteo in the east, every Carolinian-loving Duke fan knew that Gminski wouldn't let the ball inside to Cowan and they knew the marvelous sophomore, Vince Taylor, would be right up against Macy's heroic whiskers.

The clock was running now. Nine seconds, 8, 7 . . . and Macy with the ball looked for a screen to give him a hole in Duke's unexpected zone defense. No hole. No passing lane to Cowan. No nothing.

So from 17 feet Macy went up off-balance, with Taylor right there. "When he went up, he had to spin a little to get open, and there was contact," Taylor admitted. "But I guess the ref thought it was incidental." c

Twenty minutes after Macy's shot bounced off the iron -- an ugly shot, it was so poorly launched it barely reached the hoop -- Macy said he thought he had been fouled. "He brushed my elbow, and that's critical," Macy said.

But if Macy could question that last shot, he had no excuses for the others. He was three-for-nine tonight, only one for five in the decisive first half, and Kentucky dearly needed his outside shooting against the agressive Duke zone. Macy is a 53 percent shooter and twice this season has won games on the last shot.

"Our guys did a super job on Macy," said Foster after his 13th ranked Devils with their fifth straight game to raise their record to 24-8. Kentucky, which also lost it's season opener to Duke back in November, winds up 29-6.

"First I'd like to say to Al McGuire and Billy Parker," said the hero Banks, naming some TV commentators who have low-rated the Devils, "hello."

Banks smiled. "Just keep picking us underdogs," he said.

Fifth-place finishers in the ACC before winning the postseason tournament, Duke now goes against Purdue, the third-place Big Ten team which tonight beat its intrastate rival, and Big Ten champions, the proud Indiana Hoosiers.

Ranked 20th in one poll and out of sight in the other, the unappreciated Boilermakers got only 11 points from foul-troubled all-American Joe Barry Carroll but had 20 points apiece from Keith Edmonson and Drake Morris.

Purdue built a 37-26 halftime lead that was immediately stretched to 15 points with the help of a technical foul against Indiana Coach Bob Knight. Indiana never got closer than six in a long, steady rally in the second half.

While Mike Woodson made only five of 12 shots for Indiana, his 14 points, five under his average, Isiah Thomas racked up 30, including 12 in the last three minutes of play.