pub struct CodeGenerator<'a, Mem: CodegenMemorySpace> { /* private fields */ }
Expand description
Provides easy methods to generate some Z80 opcodes. Currently only limited opcode list is supported
Implementations§
Source§impl<'a, Mem: CodegenMemorySpace> CodeGenerator<'a, Mem>
impl<'a, Mem: CodegenMemorySpace> CodeGenerator<'a, Mem>
pub fn new(mem: &'a mut Mem) -> Self
Sourcepub fn codegen_set_addr(&mut self, addr: u16) -> &mut Self
pub fn codegen_set_addr(&mut self, addr: u16) -> &mut Self
Sets current base address to write opcodes
Sourcepub fn jump(&mut self, addr: u16) -> &mut Self
pub fn jump(&mut self, addr: u16) -> &mut Self
Generates most optimal jump opcode generation from the current address
Sourcepub fn exact_opcode_jump_direct(&mut self, addr: u16) -> &mut Self
pub fn exact_opcode_jump_direct(&mut self, addr: u16) -> &mut Self
Generates direct jump opcode (0xC3)
Auto Trait Implementations§
impl<'a, Mem> Freeze for CodeGenerator<'a, Mem>
impl<'a, Mem> RefUnwindSafe for CodeGenerator<'a, Mem>where
Mem: RefUnwindSafe,
impl<'a, Mem> Send for CodeGenerator<'a, Mem>where
Mem: Send,
impl<'a, Mem> Sync for CodeGenerator<'a, Mem>where
Mem: Sync,
impl<'a, Mem> Unpin for CodeGenerator<'a, Mem>
impl<'a, Mem> !UnwindSafe for CodeGenerator<'a, Mem>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more