There isn't much reason to expect much more upside from these two tech stocks.

Take a look at these four stocks, all of them big names in mobile devices and the software powering them: Apple (NASDAQ:AAPL), Google (NASDAQ:GOOG), Nokia (NYSE:NOK) and Research In Motion (NASDAQ:RIMM).

Now consider that, in the past three weeks, two of the names have greatly outperformed the Dow Jones Industrial Average, and the other two have underperformed. Can you name the two outperformers?

The answer is easy if you’ve noticed that this has become the bizarro stock market for mobile devices. Before Monday’s broad market selloff, Nokia was up 36% in those three weeks and RIM was up 44%. The Dow had risen a much more modest 7%. And Apple and Google? The former was up 5%, and the latter was down 3%.

What’s going on? Explaining the underperformance of Apple and Google is easy. Despite a broad consensus that Apple will continue to thrive without Steve Jobs, for a few years at least, the news of his stepping down as CEO has given investors pause. And the bold, unexpected move by Google to buy Motorola Mobility for $12.5 billion had added a lot of risk to that company’s future outlook.

What’s harder to explain is why a stock market that is not exactly in a bullish mood has decided that both Nokia and RIM are worth several billion dollars more than they were only three weeks ago.

It’s not that a late summer heat wave muddled consumers’ minds enough that they thought that buying a Playbook tablet or a Blackberry or a Symbian smartphone. In fact, signs point to the opposite: RIM’sshare of the smartphone market declined in July, and Best Buy isslashing Playbook prices to bargain levels. Sales of newer Blackberries arejust as cold, while Nokia persuaded consumers to shun its mobile devices once it’s partnered with Microsoft.

No, the rallies in NOK and RIMM have the straw-clutching logic of severe bear markets. Nokia’s shares are down 83% from highs posted nearly four years ago, while RIMM is down 78% from the sunny summer of 2008. Between them, Apple’s iOS mobile platform and Google’s Android have sucked four-fifths of the market value from both Nokia and RIM. And bottom-fishers are riding the bounce from that brutal ride down.

With Nokia, there are rationalizations aplenty for buying the stock. As the bullish argument goes, Microsoft (NASDAQ:MSFT) is partnering with Nokia to sell smartphones. But if you’d read Investorplace in February, you’d knowthis argument is suspect. Nokia bulls might argue that there is room for three smartphone platforms in the market, but that overlooks another fact: Developers have the time and patience for one or maybe two platforms. And in the long run, consumers aren’t going to go crazy for a smartphone that doesn’t have many apps.

In fact, Nokia slumped for months after agreeing to partner with Microsoft. That has less to do with Microsoft’s Windows Phone 7, which is winning positive reviews, and more to do with the costs Nokia will face in coming years to disentangle itself from its in-house software.