After being largely unprepared for the extreme stress of the 2008 crisis, large banks in the United States are determined to be ready this time. They have been taking measures to deal with instability in Europe for over a year. In recent months, they have stepped up their contingency planning, especially after it became clear that Greece was struggling to comply with the terms of a March bailout that was intended to keep the country in the euro.

In New York and London, banks have set up dedicated crisis teams, and rehearsed elaborate responses. As clients get nervous, banks have been guiding clients on how to react to a range of situations, from just one country leaving the euro zone to the dissolution of the euro itself.

Ordinary investors, for example, are demanding more information on Europe from their brokers. David Darst, chief investment strategist at Morgan Stanley Smith Barney, said the crisis had consumed his regular Monday morning call with the firm’s financial advisers, and has been the focus of the monthly video he does for clients and brokers. Mr. Darst says he hears two main questions: “What is your thought on Greece pulling out of the euro and it leading to contagion?” and “What impact will this have on my portfolio?”

Large banks that have substantial exposure to Europe have been doing tests to see if important functions like moving money for clients between nations could handle a country leaving the euro. This quarter, a substantial number of Citigroup employees carried out an extensive dry run that assumed a country left the euro and caused wider stress, according to a person familiar with the bank’s activities who was not authorized to discuss the tests publicly. One aspect of the drill looked at how different parts of the bank’s international payment systems performed.

Citigroup also has a London-based team that is focusing on crisis responses. The group reports to the bank’s risk officers who give a regular download to the firm’s chief executive, Vikram S. Pandit. And the bank’s board is being regularly briefed on measures that Citigroup is taking to deal with European turbulence.

Citigroup has $84 billion in loans, bonds and other types of exposure to troubled European countries, plus France. The bank’s filings indicate that all but $8 billion of that exposure is offset with collateral it has collected and hedges on the portfolio.

“We are managing the current issues in the euro zone in line with the bank’s ongoing prudent approach to managing all forms of market, credit and operational risk,” said Jon Diat, a Citigroup spokesman.

Some banks are testing their systems to deal with the possibility of new currencies and preparing guidance for clients on how to operate in such an environment. BNY Mellon, a bank that handles huge amounts of international payments, has been sketching out the potential fallout for several disruptive outcomes in Europe.

“Over the past several months, BNY Mellon has been working to prepare our services, systems and operations to respond to potential euro-zone-related scenarios,” said Ron Gruendl, a spokesman. “Our contingency plans are designed to implement responsive measures efficiently and accurately with as little impact to our clients as possible.”

Banks like Goldman Sachs and Morgan Stanley are also looking into the severe legal challenges that would arise if a country exited the euro. Contracts that govern loans, bonds and derivatives in Europe rarely take into account such a situation.

“This is a big issue — what jurisdiction are your contracts written under?” Gary Cohn, president of Goldman, said at the end of last month. “Could you end up having a contract and end up with lira or drachma or something like that?”

Consider an Italian corporation that owed a foreign bank 5 million euros, with a loan agreement struck under Italian law. If Italy left the euro, the bank might have less chance of getting euros back after the exit. In that case, the financial firm might be exposed to a new, less valuable currency.

Recognizing that threat, some banks are trying to move contracts into new jurisdictions like the United States or Britain. By transferring such loan agreements to English law, the banks may increase the chances of getting repaid in euros after an exit, according to legal experts.

“An English court would be likely to say the loan remains a euro obligation,” said Andrew McClean, a partner at Slaughter and May, a London law firm.

The banks are also trying to protect their balance sheets if they do get stuck with large amounts of assets denominated in a new, weaker currency. To help offset the potential financial hit, firms are building up their deposit base in troubled countries.

By doing so, they can better match their assets (the loans) within a specific country with their liabilities (the deposits). Then if a country left the euro zone, the value of the loan might fall in euros, but the banks wouldn’t owe as much to depositors in euros.

“We know that is a strategy that some banks are trying to do,” said Andrew Lim, a bank analyst at Espírito Santo Investment Bank in London. Mr. Lim notes, however, that some large banks, including Deutsche Bank, still have a lot more loans than deposits in countries like Italy and Spain.

If the Greek elections prompt market instability, banks are likely to have another source of support, perhaps overshadowing any of their own efforts to date. In a period of severe weakness, central banks will most likely step in and provide cheap loans to bolster the financial system.

Susanne Craig contributed reporting.

Watch CNBC's “A Greek Tragedy” anchored by Michelle Caruso-Cabrera, on Sunday, June 17th at 8 p.m. ET.