What is the arithmetic operation equivalent to shifting


The instruction ISHL (shift left integer) exists in JVM but not in IJVM. It uses the top two values on the stack, replacing the two with a single value, the result. The sec- ond-from-top word of the stack is the operand to be shifted. Its content is shifted left by a value between 0 and 31, inclusive, depending on the value of the 5 least signifi- cant bits of the top word on the stack (the other 27 bits of the top word are ignored). Zeros are shifted in from the right for as many bits as the shift count. The opcode for ISHL is 120 (0x78).

a. What is the arithmetic operation equivalent to shifting left with a count of 2?

b. Extend the microcode to include this instruction as a part of IJVM.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: What is the arithmetic operation equivalent to shifting
Reference No:- TGS01154721

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)