pub fn new(data_size: usize, program_size: usize) -> Result<MemoryBank> {
        if data_size & (data_size - 1) != 0 {
            return Err(1);
        }
        let data_memory = vec![0; data_size];
        let program_memory = vec![0; program_size];
        let address_mask = (data_size - 1) as u16;
        Ok(MemoryBank {data_memory, program_memory, address_mask})
    }
/// Creates a new memory bank. Capacity *MUST* be a power of 2
Creates a new memory bank. Capacity *MUST* be a power of 2
Creates a new memory bank . Capacity * MUST * be a power of 2
pub fn new(data_size: usize, program_size: usize) -> Result<MemoryBank> {
        if data_size & (data_size - 1) != 0 {
            return Err(1);
        }
        let data_memory = vec![0; data_size];
        let program_memory = vec![0; program_size];
        let address_mask = (data_size - 1) as u16;
        Ok(MemoryBank {data_memory, program_memory, address_mask})
    }
pub fn new ( data_size : usize , program_size : usize ) -> Result < MemoryBank > { if data_size & ( data_size - 1 ) != 0 { return Err ( 1 ) ; } let data_memory = vec ! [ 0 data_size ] ; let program_memory = vec ! [ 0 program_size ] ; let address_mask = ( data_size - 1 ) as u16 ; Ok ( MemoryBank { data_memory , program_memory , address_mask } ) }
Creates a new memory bank.
Creates a new memory bank .
data_size
usize
program_size
usize
data_size
usize
program_size
usize