void setRegistryValue(bool registryNum[8], bool value[8]) { try{ bool* output = new bool[8]; bool tmpCheck = 0; bool* low = new bool[8]; bool* high = new bool[8]; if ( Eightto1bit(tmpCheck, lessthan(output, registryNum, low))) throw 10; if ( Eightto1bit(tmpCheck, greaterthan(output, registryNum, high))) throw 10; value[0] = registry[to_int8(registryNum)][0]; value[1] = registry[to_int8(registryNum)][1]; value[2] = registry[to_int8(registryNum)][2]; value[3] = registry[to_int8(registryNum)][3]; value[4] = registry[to_int8(registryNum)][4]; value[5] = registry[to_int8(registryNum)][5]; value[6] = registry[to_int8(registryNum)][6]; value[7] = registry[to_int8(registryNum)][7]; } catch (int e) { std::cout<<"Reg("; printValueInDecimal(registryNum); std::cout<<") = "; printValue(registryNum); std::cout<<'\n'; } }
bool* getRegistryValue(bool* output, bool registryNum[8]) { output[0] = registry[to_int8(registryNum)][0]; output[1] = registry[to_int8(registryNum)][1]; output[2] = registry[to_int8(registryNum)][2]; output[3] = registry[to_int8(registryNum)][3]; output[4] = registry[to_int8(registryNum)][4]; output[5] = registry[to_int8(registryNum)][5]; output[6] = registry[to_int8(registryNum)][6]; output[7] = registry[to_int8(registryNum)][7]; return output; }
void sw(bool registrylocation[8], bool memlocation[16]) { int index = 0; index = to_int8(memlocation); dataMemory[index] = registrylocation[0]; dataMemory[index+1] = registrylocation[1]; dataMemory[index+2] = registrylocation[2]; dataMemory[index+3] = registrylocation[3]; dataMemory[index+4] = registrylocation[4]; dataMemory[index+5] = registrylocation[5]; dataMemory[index+6] = registrylocation[6]; dataMemory[index+7] = registrylocation[7]; }
static inline boost::int8_t to_int8(const Byte *buf) { return to_int8(buf[0]); }