Lines Matching refs:prog
554 pub fn get_insn(prog: &[u8], idx: usize) -> Insn { in get_insn()
558 if (idx + 1) * INSN_SIZE > prog.len() { in get_insn()
562 prog.len() in get_insn()
566 opc: prog[INSN_SIZE * idx], in get_insn()
567 dst: prog[INSN_SIZE * idx + 1] & 0x0f, in get_insn()
568 src: (prog[INSN_SIZE * idx + 1] & 0xf0) >> 4, in get_insn()
569 off: LittleEndian::read_i16(&prog[(INSN_SIZE * idx + 2)..]), in get_insn()
570 imm: LittleEndian::read_i32(&prog[(INSN_SIZE * idx + 4)..]), in get_insn()
618 pub fn to_insn_vec(prog: &[u8]) -> Vec<Insn> { in to_insn_vec()
619 if prog.len() % INSN_SIZE != 0 { in to_insn_vec()
629 while insn_ptr * INSN_SIZE < prog.len() { in to_insn_vec()
630 let insn = get_insn(prog, insn_ptr); in to_insn_vec()