[−][src]Enum inc::x86::Ins
Each x86 instruction this compiler understands.
This type fundamentally limits what code can be generated and ideally no other part of the compiler should generate ASM with strings.
Variants
Add
Add v
to register r
Fields of Add
And
Logical and of v
to register r
Fields of And
Call(String)
Unconditional function call
Cmp
Compare the value to register RAX
Fields of Cmp
Enter
x86 function preamble
Not really a single instruction but having this as a single operation makes it easier for callers of this module.
Je(String)
Jump to the specified label if last comparison resulted in equality
Jmp(String)
Unconditionally jump to the specified label
Label(String)
A label is a target to jump to
Leave
Exit a function and clean up. See Enter
Save
Save a register r
to stack at index si
Fields of Save
Load
Load a value at stack index si
to register r
Fields of Load
Mov
Mov! At least one of the operands must be a register, moving from RAM to RAM isn't a valid op.
Fields of Mov
Mul
Multiply register AX with value v
and move result to register RAX
Fields of Mul
v: Operand
Pop(Register)
Pop a register r
from stack
Push(Register)
Push a register r
to stack
Ret
Return from the calling function
Sar
Shift register r
right by v
bits; r = r / 2^v
Fields of Sar
Sal
Shift register r
left by v
bits; r = r * 2^v
Fields of Sal
Sub
Sub k
from register r
Fields of Sub
Slice(String)
Raw slices for compatibility
Often it can be just convenient to hand write some assembly and eventually port it to a sensible type here. Till then this Variant is a goods stop gap.
Trait Implementations
impl Clone for Ins
[src]
fn clone(&self) -> Ins
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<Ins> for ASM
[src]
Convert a single operation to ASM
impl Debug for Ins
[src]
impl Display for Ins
[src]
Pretty print a single ASM instruction.
impl Add<Ins> for ASM
[src]
Add operations to ASM with overloaded asm' = asm + op
.
NOTE: This is pretty inefficient due to copying of self.
type Output = Self
The resulting type after applying the +
operator.
fn add(self, op: Ins) -> Self
[src]
impl Add<Ins> for Ins
[src]
Concat Ins to get ASM; asm = op + op
NOTE: This is pretty inefficient due to copying both arguments.
type Output = ASM
The resulting type after applying the +
operator.
fn add(self, op: Ins) -> ASM
[src]
impl AddAssign<Ins> for ASM
[src]
Add operations with a easy to read asm += op
short hand.
This is pretty efficient at the cost of owning the value.
fn add_assign(&mut self, op: Ins)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,