Assembler programming?

In assembler, is it possible to switch two fieds in three statements without using a temp field or any other storage.

Comments

  • r1 = r1 xor r2

    r2 = r1 xor r2

    r1 = r1 xor r2

  • Im not sure what you mean, or what assembly language, but in Intel 8 bit assembly there is a command called XCH which will exchange a byte with whats in the accumulator.

    example:

    Accumulator = 50

    mybyte = 100

    XCH A,mybyte

    now the accumulator holds 100 and mybyte holds 50

Sign In or Register to comment.