There are 3 memory registers: A, B and C. Following are the 3 valid commands:
1) copy from A to C
2) copy from B to C
3) Replace A by A - C
How can these commands be used to copy from B to A?
There are 3 memory registers: A, B and C. Following are the 3 valid commands:
1) copy from A to C
2) copy from B to C
3) Replace A by A - C
How can these commands be used to copy from B to A?
Copyright © 2021 JogjaFile Inc.
Copy $A$ to $C$
Replace $A$ by $A-C$ # A is now initialized to $0$
Copy $B$ to $C$
Replace $A$ by $A-C$ # $A$ now contains $-B$
Copy $A$ to $C$ # $C$ now contains $-B$
Replace $A$ by $A-C$ # A is now reinitialized to $0$
Replace $A$ by $A-C$ # $A$ now contains $B$