fn compute_address(cpu: &mut CpuState, instr: &Instruction, offset: u32) -> u32 {
    let address: u32;
    let bits = instr.code;
    let base_reg_val: u32 = cpu.registers[base_reg_bits![bits]];

    if up_bit![bits] {
        if indexing_bit![bits] {
            address = base_reg_val + offset;
        } else {
            address = base_reg_val;
            cpu.registers[base_reg_bits![bits]] += offset;
        }
    } else {
        if indexing_bit![bits] {
            address = base_reg_val - offset;
        } else {
            address = base_reg_val;
            cpu.registers[base_reg_bits![bits]] -= offset;
        }
    }

    address
}
/// Computes the address given to an offset of an SDT instruction
Computes the address given to an offset of an SDT instruction
Computes the address given to an offset of an SDT instruction
fn compute_address(cpu: &mut CpuState, instr: &Instruction, offset: u32) -> u32 {
    let address: u32;
    let bits = instr.code;
    let base_reg_val: u32 = cpu.registers[base_reg_bits![bits]];
    if up_bit![bits] {
        if indexing_bit![bits] {
            address = base_reg_val + offset;
        } else {
            address = base_reg_val;
            cpu.registers[base_reg_bits![bits]] += offset;
        }
    } else {
        if indexing_bit![bits] {
            address = base_reg_val - offset;
        } else {
            address = base_reg_val;
            cpu.registers[base_reg_bits![bits]] -= offset;
        }
    }
    address
}
fn compute_address ( cpu : & mut CpuState , instr : & Instruction , offset : u32 ) -> u32 { let address : u32 ; let bits = instr . code ; let base_reg_val : u32 = cpu . registers [ base_reg_bits ! [ bits ] ] ; if up_bit ! [ bits ] { if indexing_bit ! [ bits ] { address = base_reg_val + offset ; } else { address = base_reg_val ; cpu . registers [ base_reg_bits ! [ bits ] ] += offset ; } } else { if indexing_bit ! [ bits ] { address = base_reg_val - offset ; } else { address = base_reg_val ; cpu . registers [ base_reg_bits ! [ bits ] ] -= offset ; } } address }
Computes the address given to an offset of an SDT instruction
Computes the address given to an offset of an SDT instruction
cpu
&mut CpuState
instr
&Instruction
offset
u32