+ 1

Assembly

How i can trasform a code in Java to assembly? Short Java code Int x, min, max Get x While (x!=0) { If (x<min) Min= x If (x>max) Max= x Get x } Print min, max

17th Mar 2020, 3:01 PM
Ivan Ferro
Ivan Ferro - avatar
4 Answers
+ 2
While you can probably make a program that translates java's bytecode to assembly, which might be a liiitle bit complex, it'll probably be easier to just handwrite it in assembly. Or just rewrite it in C/C++ and grab its generated assembly. Though, I kinda doubt that the assignment is to "automatically translate the java/c/c++ code to assembly", so this might not be a good idea because you can spot machine generated assembly in the blink of an eye. Personally, I use nasm and mingw (gcc) to compile my assembly. https://www.nasm.us/ http://www.mingw.org/
17th Mar 2020, 3:45 PM
Dennis
Dennis - avatar
+ 1
Why you want this? Any particular reason?
17th Mar 2020, 3:03 PM
Ipang
+ 1
Ipang for university exercise
17th Mar 2020, 3:04 PM
Ivan Ferro
Ivan Ferro - avatar
+ 1
I see Ivan Ferro 👌 I was just wondering, because as I understand, people choose Java because it's platform independent. While Assembly is very specific about hardware. I am no good with Assembly. So good luck, may you find a way 👍
17th Mar 2020, 3:23 PM
Ipang