It is better to post code directly into your post, rather than link to an image on another site. So here is the code in that image:
Code:
// Compute product P <— XY
// Y is the multiplicand
// X=x15;x14;x13...x1;x0 is the multiplier
P <— 0 // Initialize product
for i=0 to 14 do // Exclude the sign bit
if X[i] = 1 then
P <— P + Y // Add
Y <— Y + Y // Shift left
As to your original question, LC-3 doesn't support bit shifting. You will just have to add the number to itself, like in the pseudocode supplied
Bookmarks