7.5.81 s2b

Convert short to byte

Format

s2b

Forms

s2b = 91 (0x5b)

Stack

…, value → …, result

Description

The value on top of the operand stack must be of type short. It is popped from the top of the operand stack, truncated to a byte result, then sign-extended to a short result. The result is pushed onto the operand stack.

Notes

The s2b instruction performs a narrowing primitive conversion. It may lose information about the overall magnitude of value. The result may also not have the same sign as value.