added assembler skeleton code

This commit is contained in:
2025-06-15 21:53:57 +01:00
parent 2b8281157e
commit 2b5ad0885b
5 changed files with 24 additions and 10 deletions
+10 -10
View File
@@ -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!()
}