diff --git a/src/spider/runtime/instr/Instr_000-01F.cpp b/src/spider/runtime/instr/Instr_000-01F.cpp index 088b8d9..21a8cf5 100644 --- a/src/spider/runtime/instr/Instr_000-01F.cpp +++ b/src/spider/runtime/instr/Instr_000-01F.cpp @@ -118,26 +118,102 @@ namespace spider { void CPU::INC() { // TODO: Implement INC + fetchOperDst(); + switch(_size){ + case 0b00: //byte + _dst->_u8 += 1; + case 0b01: //short + _dst->_u16 += 1; + case 0b10: //int + _dst->_u32 += 1; + case 0b11: //long + _dst->_u64 += 1; + } + (this->*_post)(); } void CPU::DEC() { // TODO: Implement DEC + fetchOperDst(); + switch(_size){ + case 0b00: //byte + _dst->_u8 -= 1; + case 0b01: //short + _dst->_u16 -= 1; + case 0b10: //int + _dst->_u32 -= 1; + case 0b11: //long + _dst->_u64 -= 1; + } + (this->*_post)(); } void CPU::ADD() { // TODO: Implement ADD + fetchOperSrc(); + fetchOperDst(); + switch(_size){ + case 0b00: //byte + _dst->_u8 += _src->_u8; + case 0b01: //short + _dst->_u16 += _src->_u16; + case 0b10: //int + _dst->_u32 += _src->_u32; + case 0b11: //long + _dst->_u64 += _src->_u64; + } + (this->*_post)(); } void CPU::SUB() { // TODO: Implement SUB + fetchOperSrc(); + fetchOperDst(); + switch(_size){ + case 0b00: //byte + _dst->_u8 -= _src->_u8; + case 0b01: //short + _dst->_u16 -= _src->_u16; + case 0b10: //int + _dst->_u32 -= _src->_u32; + case 0b11: //long + _dst->_u64 -= _src->_u64; + } + (this->*_post)(); } void CPU::MUL() { // TODO: Implement MUL + fetchOperSrc(); + fetchOperDst(); + switch(_size){ + case 0b00: //byte + _dst->_u8 = _src->_u8 * _dst->_u8; + case 0b01: //short + _dst->_u16 = _src->_u16 * _dst->_u16; + case 0b10: //int + _dst->_u32 = _src->_u32 * _dst->_u32; + case 0b11: //long + _dst->_i64 = _src->_i64 * _dst->_i64; + } + (this->*_post)(); } void CPU::UMUL() { // TODO: Implement UMUL + fetchOperSrc(); + fetchOperDst(); + switch(_size){ + case 0b00: //byte + _dst->_u8 = _src->_u8 * _dst->_u8; + case 0b01: //short + _dst->_u16 = _src->_u16 * _dst->_u16; + case 0b10: //int + _dst->_u32 = _src->_u32 * _dst->_u32; + case 0b11: //long + _dst->_u64 = _src->_u64 * _dst->_u64; + } + (this->*_post)(); } void CPU::DIV() {