Intel Corporation Interview Question

Second interview question: Given the following assembly commands: MOV Ri <-- Rj/immediate (put register j or immediate value into reg i) INC Ri (++) DEC Ri (--) JNZ Ri (jump not zero) 1. Code an assembly program that calculates x*y where x and y are unsigned integers 2. What values of x and y will cause the program to fail? 3. Modify the program to deal with these values 4. What result will we get if we run the program with values from question 2 and no modification from question 3? 5. Is it possible to answer question 1 without MOV command? Prove it!

Interview Answer

Anonymous

Nov 5, 2022

Hints for the second question: 1. Adding 1 in a nested loop 2. 0 was my wrong guess, there are actually none 3. Jump over the calculation if x or y are 0 4. 0 5. Yes. Create MOV from the other commands.