You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the recent addition of seek_from_*, I was wondering if there are plans to add seek_bits_from_*, too.?
I have this weird protocol that looks somewhat like this:
struct Operation {
header: Header, #2 bits
#[deku(bits="6")]
opCode: u8,
operand: Operand # any number of bytes
}
As you would assume, opCode + operand could be just an enum. However, for some if not most operands, the header isn't so much a header but rather an integral part of the operand itself. I know, it's a weird format.
So, it'd be very cool if there was a way to define that the enum id location is input[2..8], and the operand is actually ( input[0..2], 6 unused bits, input[9...] )
Do you have any ideas on how this could be implemented?
The text was updated successfully, but these errors were encountered:
I've solved that before by sending in an already read header into the operand, but it sounds like that's not really a solution since it's doesn't interpret the header the second time as just being two bits.
We don't have bit_order support, yet. But that first u8 looks like Lsb Order . Add bit_order attribute #468. I've written other instructions set decoders that I had to do this for, wouldn't surprise me.
I'd have to play around with the idea of seek_bits! I think it's possible as long as it's no bigger then the last read.
Given the recent addition of
seek_from_*
, I was wondering if there are plans to addseek_bits_from_*
, too.?I have this weird protocol that looks somewhat like this:
As you would assume,
opCode
+operand
could be just an enum. However, for some if not most operands, the header isn't so much a header but rather an integral part of the operand itself. I know, it's a weird format.So, it'd be very cool if there was a way to define that the enum id location is
input[2..8]
, and the operand is actually (input[0..2]
, 6 unused bits,input[9...]
)Do you have any ideas on how this could be implemented?
The text was updated successfully, but these errors were encountered: