• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

GCD in assembly lanuage..

TurtleMan

Golden Member
Man.. i just don't get assembly lanuage... been programming in java
but now IM try to do find gcd and do it in assembly
it just throw me off....

anyone have any idea how to do such thing ?

I know i have to put the variables into the registers
mov eax, a
mov ebx, b
and a b both are int ,

so i know i have to use cmp value, but i don't get what to know next,

can someone help out ?
 
Why don't you write it first in Java and then take your Java and break it down into VERY simple statements? Then take that code and try to translate it into assembly.

For example, turn this
a = b + c;

Into:
a=b;
a=a+c;

And then into
mov eax, b
adc eax, c

It won't give you the best assembly, but it should give you something which works.

Dave
 
Back
Top