fn parse_reg_from_load_instruction(instruction: &String) -> Option<u16> {
    let mut split = instruction.split(&[' ', ','][..]);
    let mut reg_no: Option<u16> = None;
    if let Some(asm) = split.next() {
        if asm.contains("ld") {
            let reg = split.next().unwrap();
            reg_no = match reg {
                "r0" => Some(0),
                "r1" => Some(1),
                "r2" => Some(2),
                "r3" => Some(3),
                "r4" => Some(4),
                "r5" => Some(5),
                "r6" => Some(6),
                "r7" => Some(7),
                _ => None,
            }
        }
    }
    reg_no
}
/// Parses the `Rt` register that the load instruction is loading to.
Parses the `Rt` register that the load instruction is loading to.
Parses the ` Rt ` register that the load instruction is loading to .
fn parse_reg_from_load_instruction(instruction: &String) -> Option<u16> {
    let mut split = instruction.split(&[' ', ','][..]);
    let mut reg_no: Option<u16> = None;
    if let Some(asm) = split.next() {
        if asm.contains("ld") {
            let reg = split.next().unwrap();
            reg_no = match reg {
                "r0" => Some(0),
                "r1" => Some(1),
                "r2" => Some(2),
                "r3" => Some(3),
                "r4" => Some(4),
                "r5" => Some(5),
                "r6" => Some(6),
                "r7" => Some(7),
                _ => None,
            }
        }
    }
    reg_no
}
fn parse_reg_from_load_instruction ( instruction : & String ) -> Option < u16 > { let mut split = instruction . split ( & [ ' ' , ',' ] [ .. ] ) ; let mut reg_no : Option < u16 > = None ; if let Some ( asm ) = split . next ( ) { if asm . contains ( " " ) { let reg = split . next ( ) . unwrap ( ) ; reg_no = match reg { " " => Some ( 0 ) , " " => Some ( 1 ) , " " => Some ( 2 ) , " " => Some ( 3 ) , " " => Some ( 4 ) , " " => Some ( 5 ) , " " => Some ( 6 ) , " " => Some ( 7 ) , _ => None , } } } reg_no }
Parses the `Rt` register that the load instruction is loading to.
Parses the ` Rt ` register that the load instruction is loading to .
instruction
&String
instruction
&String