Labels

[MCU]exchange in PIC

Today, the teacher ask us to implenting exchanging the contents of two
file without use third-party file register.

Then, this is my answer

movf a, w
xorwf b, w
xorwf a, f
xorwf b, f

to proof

A xor B = C
C xor A = B
C xor B = A

1 comment:

  1. my teacher's method is

    movf a, w
    subwf b, w
    addwf a, f
    subwf b, f

    to proof

    W = B - A
    B = A + W
    A = B - W

    ReplyDelete