ShiftLeft instruction

Instruction ShiftLeft
Syntax ShiftLeft Destination, Source1, Source2[, Overflow-Label]
Constraints Destination and Source1 are of the same type, Source2 is a positive integer
Process Destination := shift_left(Source1, Source2)
If Overflow Detected Then Go To Overflow-Label

The ShiftLeft instruction is used to shift bits to the left in an integer.

Overflows are not detected by default.

The overflow exception is raised when the resulting number changes sign or loses bits.

An INTEL processor sets the V bit on signed overflow. There is no good way to detect bits loses unless the shift value (Source2) is 1.

It is possible to either mask Source2 to the number of bits defined in Source1 and Destination or to raise an exception.

Source2 may not be negative.

Syndicate content