Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

how can i write this code in assambly languange while(n > 1){ if (n is even ) n :=n/2 else n:=3*n+1 }

OpenStudy (anonymous):

Start simple: First figure out how to write `n = n/2` and `n=3n+1` in asm. Once you have those figured out, work your way to the if statement (you're gonna need a comparison of some sort and a conditional branch). Finally, work on the while statement (which should be very similar to the if, only you're looping around). If you have a specific problem, please post the assembly (and for which architecture it is) you have so far.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!