mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
refactor: move file up 1 director
This commit is contained in:
parent
c3491e3508
commit
17981acc49
0
.gitignore → blspc/.gitignore
vendored
0
.gitignore → blspc/.gitignore
vendored
0
Cargo.lock → blspc/Cargo.lock
generated
0
Cargo.lock → blspc/Cargo.lock
generated
1
blspc/example/if.blsp
Normal file
1
blspc/example/if.blsp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(if true (print "True") (print "False"))
|
|
@ -35,14 +35,16 @@ pub enum Instr {
|
||||||
// Load a literal value onto the stack.
|
// Load a literal value onto the stack.
|
||||||
Load { address: Register },
|
Load { address: Register },
|
||||||
// Store a literal value into a register.
|
// Store a literal value into a register.
|
||||||
Store { address: Register, value: Type, },
|
Store { address: Register, value: Type },
|
||||||
// Call intrinsic function.
|
// Call intrinsic function.
|
||||||
Call { address: Register, args: Register },
|
Call { address: Register, args: Register },
|
||||||
// Immediate arithmetic.
|
// Immediate arithmetic.
|
||||||
IAdd { lhs: Register, rhs: Register, to: Register, },
|
IAdd { lhs: Register, rhs: Register, to: Register },
|
||||||
ISub { lhs: Register, rhs: Register, to: Register, },
|
ISub { lhs: Register, rhs: Register, to: Register },
|
||||||
IMul { lhs: Register, rhs: Register, to: Register, },
|
IMul { lhs: Register, rhs: Register, to: Register },
|
||||||
IDiv { lhs: Register, rhs: Register, to: Register, },
|
IDiv { lhs: Register, rhs: Register, to: Register },
|
||||||
|
// Jumping
|
||||||
|
JumpIfFalse { cond: Register, to: Register },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Instr {
|
impl Display for Instr {
|
||||||
|
@ -55,6 +57,7 @@ impl Display for Instr {
|
||||||
Instr::ISub { lhs, rhs, to } => write!(f, "ISUB {} {} {}", lhs, rhs, to),
|
Instr::ISub { lhs, rhs, to } => write!(f, "ISUB {} {} {}", lhs, rhs, to),
|
||||||
Instr::IMul { lhs, rhs, to } => write!(f, "IMUL {} {} {}", lhs, rhs, to),
|
Instr::IMul { lhs, rhs, to } => write!(f, "IMUL {} {} {}", lhs, rhs, to),
|
||||||
Instr::IDiv { lhs, rhs, to } => write!(f, "IDIV {} {} {}", lhs, rhs, to),
|
Instr::IDiv { lhs, rhs, to } => write!(f, "IDIV {} {} {}", lhs, rhs, to),
|
||||||
|
Instr::JumpIfFalse { cond, to } => write!(f, "JUMP_IF_FALSE {} {}", cond, to),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue