![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Posts: 6
Rep Power: 0
![]() |
We are currently using High level Assembly.
And our instructors gave us an exercise to find using only addition and subtraction command,i.e. add() and sub(); the problem is to find the positive difference between two numbers without using any control structures like if() and loops; only addition and subtraction that is.. I know this is only trivial but if there already availabel ideas, then why not use them...? Hope you could help.. |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
The point of this task is for you to learn to solve programming-oriented problems. Now how, exactly, are you supposed to learn this if we do your work for you?
Think a little. Prove you've done some work. Then come back and we'd be more than happy to help. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2006
Posts: 6
Rep Power: 0
![]() |
I've done all possible combination of addition and subtraction but to no avail.
Well if this is trivial if control structures are allowed..Already thought, but all I got is negative to positive, then positive to negative. We are not even allowed to manipulate the bit representation of the numbers to be manipulated..well I think youre right, I am just being idle on my part..I'll think again..
__________________
Contented with little, yet wishing for more.. |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
Are you trying to find the absolute of a sum or subtraction?
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Jan 2006
Posts: 6
Rep Power: 0
![]() |
..the subtraction
__________________
Contented with little, yet wishing for more.. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|