A big earnings miss from Caterpillar wasn't enough to derail a rally that pushed the stock market up 2 percent for the week.

Caterpillar fell almost 6 percent Friday after its second-quarter results came in below analysts' expectations. Technology stocks rose broadly following strong earnings from the chip maker Advanced Micro Devices and Microsoft.

The Dow Jones industrial average is closing with a loss of 43 points, or 0.3 percent, to 12,681. The Standard and Poor's 500 index is up 1, or 0.1 percent, to 1,345. The Nasdaq is up 24, or 0.9 percent, at 2,589. Each index finished the week higher.

Rising and falling shares were about even on the New York Stock Exchange. Volume was lighter than average at 3.3 billion shares.