Updated from 3:11 a.m. EST

Shares of

SanDisk

(SNDK)

were rising in after-hours trading Monday after the memory-chip maker swung to a fourth-quarter loss but beat the Street on revenue.

SanDisk, which has faced the same misery befalling other

tech stocks

, reported a fourth-quarter net loss of $1.86 billion, or $8.25 a share, compared with a net profit of $106 million, or 45 cents a share for the same period a year before.

SanDisk's annual revenue dropped from $1.25 billion to $863.9 million. The Milpitas, Calif., company got smacked with $1.91 billion in one-time expenses, including $1.02 billion for a combined pre-tax goodwill and intangible asset impairment charge.

Analysts had expected the company to post a loss of 60 cents a share on revenue of about $767 million, according to Thomson Reuters.

"Despite a very difficult pricing environment, macroeconomic turmoil and the impact on consumer purchasing, we delivered sequential revenue growth in the fourth quarter," said SanDisk CEO Eli Harari in a statement. "However, we are very disappointed with our fourth-quarter bottom line results, which included significant asset impairment and inventory related charges."

SanDisk shares closed the regular trading session down 1.3% to $11.28 but were rising more than 6% in after-hours trading.

Other chipmakers also have taken a beating lately. Shares of rival

Micron Technology

(MU) - Get Report

, for example, also were falling, slipping 5.7% in recent trading.

The news has been no better for fellow chipmakers

Applied Materials

(AMAT) - Get Report

, which warned of a fourth-quarter loss Monday, and chip giants

Qualcomm

(QCOM) - Get Report

,

Broadcom

(BRCM)

,

Texas Instruments

(TXN) - Get Report

, all of which posted recent losses. And, though it reported better-than-expected fourth-quarter profit,

Altera

(ALTR) - Get Report

warned of slowing sales growth.