I have the following code:
function test_bytes(bytes32 test) external pure returns(bytes3 idx,uint256 idx2)
{
//test = 0x885094be76a41df2b315d2e669de00bb0fa1333efa1fe9d200e304c490989680
assembly{
calldatacopy(0x0,33,36)
idx := mload(0x0) //0x989680
idx2 := mload(add(idx, 32)) //10000000
}
the idx value gets bytes3 equal to 0x989680 which is correct, that value is required to convert to uint256 and store it in idx2. With the function shown I get a gas error.