diff --git a/machine/src/core.rs b/machine/src/core.rs index 1dee9ae..2bdd914 100644 --- a/machine/src/core.rs +++ b/machine/src/core.rs @@ -13,7 +13,7 @@ pub fn index_of_byte(addr: u32) -> usize { (addr & 3) as usize } -/// Get the address to the map of the memory cells which is not empty (a multiple of 4). +/// Get the address of the memory cells which is not empty (a multiple of 4). pub fn index_to_word(addr: u32) -> u32 { (addr & !3) as u32 } @@ -28,6 +28,7 @@ impl Word { } impl Word { + //TODO if the byte isn't the lowest byte then this doesn't make sense? pub fn sign_extend_byte(byte: u8, loc: usize) -> Self { let sign = byte as i8 >> 7; let mut result: [u8; MEMORY_CELL_BYTES] = [sign as u8; MEMORY_CELL_BYTES];