pub(super) fn read(self, ctx: &mut impl CpuContext) -> u16 {
        trace!("Operand16::read {}", self);
        match self {
            Self::BC => ctx.cpustate().regs.bc(),
            Self::DE => ctx.cpustate().regs.de(),
            Self::HL => ctx.cpustate().regs.hl(),
            Self::AF => ctx.cpustate().regs.af(),
            Self::Sp => ctx.cpustate().regs.sp,
            Self::Immediate => {
                let low = Operand8::Immediate.read(ctx);
                let high = Operand8::Immediate.read(ctx);
                u16::from_le_bytes([low, high])
            }
            Self::AddrImmediate => {
                panic!("No actual operation uses (u16) as the source for a 16 bit load")
            }
        }
    }
/// Read this operand from the CPU context, yielding for memory access if needed.
Read this operand from the CPU context, yielding for memory access if needed.
Read this operand from the CPU context yielding for memory access if needed .
pub(super) fn read(self, ctx: &mut impl CpuContext) -> u16 {
        trace!("Operand16::read {}", self);
        match self {
            Self::BC => ctx.cpustate().regs.bc(),
            Self::DE => ctx.cpustate().regs.de(),
            Self::HL => ctx.cpustate().regs.hl(),
            Self::AF => ctx.cpustate().regs.af(),
            Self::Sp => ctx.cpustate().regs.sp,
            Self::Immediate => {
                let low = Operand8::Immediate.read(ctx);
                let high = Operand8::Immediate.read(ctx);
                u16::from_le_bytes([low, high])
            }
            Self::AddrImmediate => {
                panic!("No actual operation uses (u16) as the source for a 16 bit load")
            }
        }
    }
pub ( super ) fn read ( self , ctx : & mut impl CpuContext ) -> u16 { trace ! ( " " self ) ; match self { Self :: BC => ctx . cpustate ( ) . regs . bc ( ) , Self :: DE => ctx . cpustate ( ) . regs . de ( ) , Self :: HL => ctx . cpustate ( ) . regs . hl ( ) , Self :: AF => ctx . cpustate ( ) . regs . af ( ) , Self :: Sp => ctx . cpustate ( ) . regs . sp , Self :: Immediate => { let low = Operand8 :: Immediate . read ( ctx ) ; let high = Operand8 :: Immediate . read ( ctx ) ; u16 :: from_le_bytes ( [ low , high ] ) } Self :: AddrImmediate => { panic ! ( " " ) } } }
Read this operand from the CPU context, yielding for memory access if needed.
Read this operand from the CPU context yielding for memory access if needed .
self
ctx
&mut impl CpuContext
self
ctx
&mut impl CpuContext