By Callum Keown

Microsoft stock is having a terrible year but it's starting to get a boost for an unlikely reason.

The tech giant fell 23% in the first six months of the year, its worst first half since 2000. The stock slumped 17% in June--its worst month since December 2000.

However, one of Microsoft's biggest weaknesses--its exposure to software--may suddenly be becoming a strength.

The shares started the second half of the year well, rising 3% Wednesday and pointing higher again in premarket trading Thursday.

Software stocks have been benefiting from a rotation away from chips--the year's standout red-hot sector. The iShares Expanded Tech-Software exchange-traded fund, IGV, has climbed for four consecutive days through Wednesday--and was pointing higher again ahead of the open Thursday.

The IGV ETF is up 7% over the past eight trading days, while the iShares Semiconductor ETF, SOXX is down 8.5% over the same period.

The chips-to-software rotation may be helping Microsoft for the moment, but the tech giant needs more than that to turn its year around.

Write to Callum Keown at callum.keown@dowjones.com

This content was created by Barron's, which is operated by Dow Jones & Co. Barron's is published independently from Dow Jones Newswires and The Wall Street Journal.