pub struct InstrBuilder { /* private fields */ }Expand description
Builder for microcode.
Implementations§
Source§impl InstrBuilder
impl InstrBuilder
Sourcepub fn first(code: impl Into<InstrBuilder>) -> Self
pub fn first(code: impl Into<InstrBuilder>) -> Self
Create a new builder with the given initial instructions.
pub fn cond( code_if_true: impl Into<InstrBuilder>, code_if_false: impl Into<InstrBuilder>, ) -> Self
Sourcepub fn if_true(code_if_true: impl Into<InstrBuilder>) -> Self
pub fn if_true(code_if_true: impl Into<InstrBuilder>) -> Self
Pop a single byte boolean off the microcode stack and run this if it is true.
Sourcepub fn if_false(code_if_false: impl Into<InstrBuilder>) -> Self
pub fn if_false(code_if_false: impl Into<InstrBuilder>) -> Self
Pop a single byte boolean off the microcode stack and run this if it is false.
Sourcepub fn then_cond(
self,
code_if_true: impl Into<InstrBuilder>,
code_if_false: impl Into<InstrBuilder>,
) -> Self
pub fn then_cond( self, code_if_true: impl Into<InstrBuilder>, code_if_false: impl Into<InstrBuilder>, ) -> Self
Chooses between two branches depending on whether the u8 on top of the stack is non-zero.
Sourcepub fn then_if_true(self, code_if_true: impl Into<InstrBuilder>) -> Self
pub fn then_if_true(self, code_if_true: impl Into<InstrBuilder>) -> Self
Run the given code if the u8 on top of the stack is non-zero.
Sourcepub fn then_if_false(self, code_if_false: impl Into<InstrBuilder>) -> Self
pub fn then_if_false(self, code_if_false: impl Into<InstrBuilder>) -> Self
Run the given code if the u8 on top of the stack is zero.
Sourcepub fn read<R: MicrocodeReadable>(from: R) -> Self
pub fn read<R: MicrocodeReadable>(from: R) -> Self
Create a single-step microcode that reads from the specified source.
Sourcepub fn write<W: MicrocodeWritable>(to: W) -> Self
pub fn write<W: MicrocodeWritable>(to: W) -> Self
Create a single-step microcode that writes to the specified source.
Sourcepub fn then(self, code: impl Into<InstrBuilder>) -> Self
pub fn then(self, code: impl Into<InstrBuilder>) -> Self
Add the given instruction or instructions to the end of this microcode.
Sourcepub fn then_yield(self) -> Self
pub fn then_yield(self) -> Self
Add a yield to the end of the builder.
Sourcepub fn then_read<R: MicrocodeReadable>(self, from: R) -> Self
pub fn then_read<R: MicrocodeReadable>(self, from: R) -> Self
Add a read to the end of the builder.
Sourcepub fn then_write<W: MicrocodeWritable>(self, to: W) -> Self
pub fn then_write<W: MicrocodeWritable>(self, to: W) -> Self
Add a write to the end of the builder.
Trait Implementations§
Source§impl Clone for InstrBuilder
impl Clone for InstrBuilder
Source§fn clone(&self) -> InstrBuilder
fn clone(&self) -> InstrBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InstrBuilder
impl Debug for InstrBuilder
Source§impl Default for InstrBuilder
impl Default for InstrBuilder
Source§fn default() -> InstrBuilder
fn default() -> InstrBuilder
Source§impl From<AluOp> for InstrBuilder
Builds the microcode for a single ALU operation. This assumes that the ALU operation’s
single u8 arg is already on the stack and handles fetching the accumulator and flags
(if needed) and applying the results.
impl From<AluOp> for InstrBuilder
Builds the microcode for a single ALU operation. This assumes that the ALU operation’s single u8 arg is already on the stack and handles fetching the accumulator and flags (if needed) and applying the results.
Source§impl From<AluUnaryOp> for InstrBuilder
Builds the microcode for a single ALU unary operation. This handles reading the
accumulator and flags as needed, and handles applying the results.
impl From<AluUnaryOp> for InstrBuilder
Builds the microcode for a single ALU unary operation. This handles reading the accumulator and flags as needed, and handles applying the results.