top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Please give an example for: Switch the integer values stored in two registers without using any additional memory?

+2 votes
297 views
Please give an example for: Switch the integer values stored in two registers without using any additional memory?
posted Oct 7, 2015 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

To swap the values, you can carry out the following instructions:

Reg_1 = Reg_1 + Reg_2;
Reg_2 = Reg_1 - Reg_2;
Reg_1 = Reg_1 - Reg_2;

answer Oct 7, 2015 by Manikandan J
Similar Questions
+4 votes

Requirements:

1.No input should be processed, and the output should be in the form of 2 3 5 7 11 13 ... etc.
2. No reserved words in the language are used at all
3.The language should at least allow structured programming, and have reserved words (otherwise point 2 would be moot).

+4 votes

Is there any alternate function is available?

+3 votes

Is it possible if yes can someone share the code in C?

...