James Davis, then deputy sheriff of Carbon County, was engaged in a friendly game of poker at the Virginian Hotel here when one of the other players made a rather crude remark involving Daivs' immediate ancestry - something about a dog, as the legend goes.

The room silenced. Ever so slowly, Davis raised his head and stared coldly into the eyes of man who who insulted him. "When you call me that, smile," said Davis, who didn't want to mess up a game he happened to be winning.

A century after that alleged remark - which later was immortalized in Owen Wister's 'The Virginian," the first real Wild West novel - the residents of this hamlet and surrounding communities like Hanna, Rawlins and Carbon are smiling once more . . . but for a much different reason.

In the tradition of the Old West, coal mining and railroads are again making Carbon County, and all of Wyoming, one big boom town.

When the Union Pacific opened up the first coal mines in Carbon in 1868, the coal was needed primarily for the railroad's steam engines. Around the turn of the century, the rail lines moved a bit north to Hanna, which had been named after the noted industrialist, Mark Hanna.

But by the 1950s, UP began to switch to diesel engines, and coal market began to dry up except for a small amount used for home heating. Things were looking grim and the area was fast becoming economically depressed.

The Clean Air Act of 1970, however, suddently created a demand for low-sulfur coal - which just happens to be what 99 percent of Wyoming's coal is. Utilities began to see that going back to Wyoming for low-sulfur coal was the most effective and economical way to meet increasingly more restrictive enviromental standards for air quality.

Wyoming, the 49th largest state with fewer people than the City of Buffalo, N.Y., has about 24 percent of the nation's coal supplies. According to Steve Freidenthal, an aide to the governor of Wyoming who works with the Department of Environmental Quality, there are now 14 major coal strip mines in operation, with 18 more pending.

And like his boss, Gov. Ed Herschler, Freidenthal is interested in keeping the railroads and mining companies happy. Wyoming collects an estimated $24 million a year from coal mining operations in excise and severence taxes and an ad valorum tax on coal still inplace. That is a considerable sum considering that the entire annual budget of the state is about $165 million.

A full one-third of that $24 million, however, goes into what is known as a permanent mineral trust fund, which was set up four years ago to compensate the state for permanent mineral losses caused by mining. It is still unclear what the miney in that fund will be used for, but it probably will be allowed to build up, with the interest it earns spent on environmental improvements.

Meanwhile, the small mining towns that dot the state are growing in leaps and bounds. And with that growth come problems. Although Medicine Bow, Hanna Rawlins, Saratoga, and other towns in the Hanna Basin area are handling the growth relatively well, towns in the Powder River Basin have experienced severe socioeconomic problems, and the Green River Basin communities are seeing the flourishing of lawlessness since the shoot-out days of the Old West.

That blatent disregard for the law in the Town of Rock Springs, Wyo., was so prevalent that CBS-TV's national magazine show "60 Minutes" produced a feature on the situation.

Last month, for example, the city's top police official was arrested and charged with the shooting murder of one of his undercover policemen who was about to testify before a federal grand jury in Cheyenne that has been investigating allegations of vice, drug trafficking and corruption in the area. The deputy reportedly was going to testify about alleged payoffs involving city officials and law enforcement personnel.

But in places like Rawlins, a city of about 8,000, the sudden jump in miners and railroad workers has caused significant sociological change. There are now 28 motels in that tiny town, and not an awful lot for visitors - or residents, for that matter - to do.

But the boredom is not because of any lack of money. Miners and train workers are making between $25,000 and $30,000 a year. Except for housing, which is extremely expensive (it is estimated that a new, 4-bedroom, house costs about $60,000 to build in Rawlins - not including the land price) there isn't much else to spend money on.

"We do this just about every night," said a young waitress named Sandy, recently arrived in Rawlins from the Pacific Northwest, as she toked on a joint of marijuana, which she said is in plentiful supply in coal country. "What else is there to do? I'm only going to live here a few months, until I can put some money together and move on."

But it is a different kind of life out here for a young woman. Walking into bars, they are likely to be pinched, grabbed at, hooted at, or even attacked by sex-hungry men who have seen nothing but coal dust for weeks, and are willing to pay good money for just about anything.

"There are lots of barroom fights, and it is sort of flattering when they are fighting over me," Sandy says, "but this place is really in a different time than the rest of the world. This is still the Wild West, and people tend to express themselves physically a great deal more there. It's actually been good for me, I'm in the best shape I've ever been in. We're always going hiking or climbing. And I can make a bundle of money. People have to eat and drink whereever they are."

The Town of Hanna had about 400 residents in 1970. After the first mine was opened up in 1971 by the Arch Mineral Co. of St. Louis just west of Hanna, the population leaped to about 3,500. There's a Miner's bar, a Miner's shopping center - which looked like it was built in about a week - and a trailer-court motel. And the weekly newspaper in town is called the Energy Basin Review.

"Boredom is the biggest problem in Hanna," says Arch Mineral spokesman Rysty Glen. "Wives of miners don't have much to do. We try to do what we can to have different events they can get dressed up for which will get them out of the house, but it isn't an easy life."

Things in Hanna move so slowly that the Union Pacific company car - a Ford LTD - has a small monthly calender taped on the dashboard where most cars would have a clock.

Stephen Skordas, 26, is a safety manager at one of the mines in Medicine Bow, near Hanna, which is jointly owned by Arch Mineral and Rocky Mountain Energy, a subsidiary of Union Pacific Corp. His father is a UP engineer at Rawlins.

"We run three shifts, 'round the clock, sometimes six days a week," the young Skordas says. "And we have 230 people working here. It costs us $3,000 an hour when we are not in operation."

In all, the big winners in the Wyoming boom are the mining companies and the railroads. Union Pacific now employs more than 3,000 people in Wyoming and Arch Mineral has 700 of its people there. And with coal now UP's largest commodity carried, plus the added bonus of the congressional defeat of the coal slurry pipeline that could have taken much of the coal transportation away from the railroads, the railroad's commitment is growing.

And UP's Rocky Mountain Energy subsidiary, which is based predominantly in Wyoming for soda ash, coal and uranium mining and transportation operations, last year earned $23 million on revenues of $47 million. That compares favorably with the same division's performance only three years earlier, when Rocky Mountain Energy earned but $4 million.

And because the mines are satisfying Wyoming's enviromentalists with extensive reclamation efforts that involve immediate reseeding and regarding after each strip has been mined, the state is welcoming the new business - and new revenues - with open arms.

Which means things have changed in Wyoming since the old days.