A recent SEC filing highlights the problems Microsoft faces in the mobile market, with its Windows Phone business hemorrhaging cash and losing money on every Lumia handset sold. Worse, Microsoft may soon post a “very, very big” write-off to cover last year’s disastrous $7.9 billion purchase of Nokia’s devices and services businesses.

Microsoft’s SEC filing was first reported by financial analyst Ben Thompson. Buckle in, folks. This one is going to get ugly.

“In the third quarter of fiscal year 2015, Phone Hardware did not meet its sales volume and revenue goals, and the mix of units sold had lower margins than planned,” the Microsoft filing admits.

Microsoft’s Phone Hardware business posted $1.4 billion in revenues in the previous quarter, and noted that it sold 8.6 million Lumia handsets in the quarter, up 18 percent year-over-year. But this rosy reporting didn’t include the fact that this business also experienced a “cost of revenue” that exceeded sales by $4 million.

(Indeed, that cost was so great, it brought down the entire Devices and Consumers business. “Cost of revenue increased, mainly due to Phone Hardware,” the filing notes. Cost of revenue was up 31 percent.)

“Phone Hardware gross margin was negative $4 million in the third quarter of fiscal year 2015,” the filing adds. So Microsoft lost money on every single handset sold.

But how much money? Gregg Keizer estimates the loss at 12 cents per phone before “marketing, R&D and other expenses.” But it’s much higher than that for Lumia as this per-phone loss includes 24.7 million Nokia-branded dumb phones too.

Worse for Microsoft is the Nokia purchase, which is looming over the company like a financial nuclear bomb. Microsoft’s $7.9 billion bill for Nokia’s devices and services businesses has been offset finically by $5.5 billion in “goodwill” which was “primarily attributed to increased synergies that are expected to be achieved from the integration of [Nokia’s devices and services businesses].” But now Microsoft is admitting that it will never fully realize this goodwill.

“The valuation of acquired assets and liabilities, including goodwill, resulting from the acquisition of [Nokia’s devices and services businesses], is reflective of the enterprise value based on the long-term financial forecast for the Phone Hardware business,” the filing explains. “In this highly competitive and volatile market, it is possible that we may not realize our forecast.”

And that means it faces a write-off. The last time Microsoft did such a thing was for its previous disastrous purchase of aQuantive, which it foolishly overpaid for in a hissy fit after Google acquired DoubleClick. Microsoft paid $6.3 billion for aQuantive and then wrote off $6.2 billion five years later.

The most likely time for a Nokia writeoff is the current quarter. I’m thinking it will be north of $5 billion.

And not to drain the remaining hope from the room, but this failure in smart phones means that Microsoft will continue to release more and more low-cost devices and fewer flagships.

“We continue to demonstrate momentum in the value smartphone segment of the phone market, driving 18 percent growth in Lumia volume this quarter,” CEO Satya Nadella said during the post-earnings conference call on Friday. “However, we need to take further action to reduce our costs across devices as we execute on our Windows 10 first-party hardware plans.”

Reduce costs further? How low can this company go? The most recently-announced Lumia, the Lumia 540, will cost just $150 without a contract, and there are several options in the $60 to $200 range.

“We are currently beginning our annual budgeting and planning process,” the filing reads, after the bit about Phone hardware losing so much money. “We use the targets, resource allocations, and strategic decisions made in this process as the inputs for the associated cash flows and valuations in our annual impairment test. Given its recent performance, the Phone Hardware reporting unit is at an elevated risk of impairment. Declines in expected future cash flows, reduction in future unit volume growth rates, or an increase in the risk-adjusted discount rate used to estimate the fair value of the Phone Hardware reporting unit may result in a determination that an impairment adjustment is required, resulting in a potentially material charge to earnings.”

Incoming.