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 more