{"id":"integer-bits-inspect","version":"1.0.0","description":"Inspect or edit fixed-width integer bits and fields; returns set positions, popcount and decimal, hex and binary.","supported_operations":["integer bitfield decode flags bit positions hexadecimal","list which bits are set in integer","popcount integer flags","test set clear toggle one bit","extract bit field by position and length","insert bitfield into register","inspect firmware register mask"],"unsupported_operations":["named hardware register databases","byte endian conversion","bit streams wider than 128 bits"],"semantics":["Bit position zero is the least-significant bit; set_bits is ascending. Integer grammar matches the family grammar exactly.","Extract and insert use length consecutive bits beginning at position, and the field must fit inside width.","Mutation operations preserve every bit except the selected bit or field."],"limits":{"max_input_bytes":256,"max_output_bytes":1024,"max_width_bits":128,"max_set_bits":128,"max_iterations":128},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["operation","value","width","signed"],"properties":{"operation":{"type":"string","enum":["inspect","test","set","clear","toggle","extract","insert"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":132},{"type":"integer"}]},"width":{"type":"integer","enum":[8,16,32,64,128]},"signed":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":127},"length":{"type":"integer","minimum":1,"maximum":128},"field_value":{"anyOf":[{"type":"string","minLength":1,"maxLength":132},{"type":"integer"}]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["standard_version","width","signed","decimal","hex","binary","set_bits","popcount"],"properties":{"standard_version":{"type":"string"},"width":{"type":"integer"},"signed":{"type":"boolean"},"decimal":{"type":"string"},"hex":{"type":"string"},"binary":{"type":"string"},"set_bits":{"type":"array","maxItems":128,"items":{"type":"integer"}},"popcount":{"type":"integer","minimum":0,"maximum":128},"bit_set":{"type":"boolean"},"field_decimal":{"type":"string"},"field_hex":{"type":"string"},"field_binary":{"type":"string"}}},"examples":[{"input":{"operation":"inspect","value":"0xa5","width":8,"signed":false},"output":{"standard_version":"ISO/IEC 9899:2018 6.5.7, 6.5.10-6.5.12; ISO/IEC 14882:2020 [basic.fundamental]","width":8,"signed":false,"decimal":"165","hex":"0xa5","binary":"0b10100101","set_bits":[0,2,5,7],"popcount":4}},{"input":{"operation":"extract","value":"0xd6","width":8,"signed":false,"position":2,"length":3},"output":{"standard_version":"ISO/IEC 9899:2018 6.5.7, 6.5.10-6.5.12; ISO/IEC 14882:2020 [basic.fundamental]","width":8,"signed":false,"decimal":"214","hex":"0xd6","binary":"0b11010110","set_bits":[1,2,4,6,7],"popcount":5,"field_decimal":"5","field_hex":"0x5","field_binary":"0b101"}}],"execute_url":"/v1/tools/integer-bits-inspect/versions/1.0.0/execute"}