(outer_input: &[u8])
| 46 | } |
| 47 | |
| 48 | pub fn code_parser(outer_input: &[u8]) -> IResult<&[u8], Vec<(usize, Instruction)>> { |
| 49 | many0(complete(|input| { |
| 50 | let (input, address) = offset(input, outer_input)?; |
| 51 | let (input, instruction) = instruction_parser(input, address)?; |
| 52 | Ok((input, (address, instruction))) |
| 53 | }))(outer_input) |
| 54 | } |
| 55 | |
| 56 | pub fn instruction_parser(input: &[u8], address: usize) -> IResult<&[u8], Instruction> { |
| 57 | let (input, b0) = be_u8(input)?; |