added assembler skeleton code
This commit is contained in:
@@ -5,3 +5,4 @@ edition.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
[dependencies]
|
||||
common = { path = "../common" }
|
||||
+10
-10
@@ -1,14 +1,14 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
use common::prelude::Instruction;
|
||||
|
||||
pub fn assemble(src: &str) -> Vec<Instruction> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
pub fn disassemble(binary: Vec<Instruction>) -> String {
|
||||
// TODO: disassembling functionality
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
// - we probably don't need to implement this for a while yet.
|
||||
// - this method should recover symbols such as labels and variables from the human written assembly, recognising
|
||||
// sequences that are expansions of pseduo-instructions and reversing this to produce near enough the original source code.
|
||||
todo!()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user