Question

When you are asked to hand compile into assembly language, are there multiple correct answers? For example, in https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-004-computation-structures-spring-2017/c11/c11s3/compilation_answers.pdf, can you get the correct solution even if your solution doesn't match the solution given?

Was it helpful?

Solution

Yup. There are multiple sequences of assembly instructions that all do the same thing. (For instance, one trivial way to see this is to notice that you can insert a no-op instruction anywhere.) They might not all be equally good, but they'd all be correct.

Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange
scroll top