pub enum ParameterList {
CallingConvention {
params: Vec<String>,
},
PassByRegister {
params: Vec<(String, Reg)>,
ret: Option<Reg>,
},
}Expand description
A list of parameters, used to define the signature of a subroutine or trap.
Variants§
CallingConvention
A parameter list defined with standard LC-3 calling convention.
If a subroutine is defined with this parameter list variant, arguments are pulled from the stack at FP+4 to FP+4+n.
The params field defines the names of the parameters accepted by this
subroutine or trap.
This variant can be readily created with ParameterList::with_calling_convention.
PassByRegister
A parameter list defined by pass-by-register calling convention.
If a subroutine is defined with this parameter list variant, arguments are pulled from registers.
The params field defines the name of the parameters accepted by this
subroutine or trap and the register where the argument is located.
The ret field defines which register the return value is located in
(if it exists).
This variant can be readily created with ParameterList::with_pass_by_register.
Implementations§
source§impl ParameterList
impl ParameterList
sourcepub fn with_calling_convention(params: &[&str]) -> Self
pub fn with_calling_convention(params: &[&str]) -> Self
Creates a new standard LC-3 calling convention parameter list.
Trait Implementations§
source§impl Clone for ParameterList
impl Clone for ParameterList
source§fn clone(&self) -> ParameterList
fn clone(&self) -> ParameterList
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ParameterList
impl Debug for ParameterList
source§impl Hash for ParameterList
impl Hash for ParameterList
source§impl PartialEq for ParameterList
impl PartialEq for ParameterList
impl Eq for ParameterList
impl StructuralPartialEq for ParameterList
Auto Trait Implementations§
impl Freeze for ParameterList
impl RefUnwindSafe for ParameterList
impl Send for ParameterList
impl Sync for ParameterList
impl Unpin for ParameterList
impl UnwindSafe for ParameterList
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)