Professional Documents
Culture Documents
Assignment 1
Assignment 1
Q-1: Write the assembly language code for program given below by using one register and two temporary
locations
a = b + c * d;
Ans:
Q-2: Show the output of a Java native code compiler, in any typical assembly language, for the following Java input
string using one register
Ans:
Q-3:Show the compiler output and the interpreter output for the following Java source code:
Solution:
Compiler Output
Interpreter Output
Q-6: Which of the following Java source errors would be detected at compile
time, and which would be detected at run time?
(a) a = b+c = 3;
(b) if (x<3) a = 2
else a = x;
(c) if (a>0) x = 20;
else if (a<0) x = 10;
else x = x/a;
(d) MyClass x [] = new MyClass[100];
x[100] = new MyClass();