Skip to content

Commit

Permalink
Bit offset can be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Nov 21, 2016
1 parent 6c82b04 commit 5bff589
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/arith.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ CPU.prototype.sbb32 = function(dest, src) { return this.sbb(dest, src, OPSIZE_32

CPU.prototype.add = function(dest_operand, source_operand, op_size)
{
//if(this.safe_read32s(this.instruction_pointer + 1) === 0) throw "0000000";
//if(this.safe_read32s(this.instruction_pointer + 1) === 0 && this.safe_read32s(this.instruction_pointer + 5) === 0) throw "0000000";

this.last_op1 = dest_operand;
this.last_op2 = source_operand;
Expand Down Expand Up @@ -1374,7 +1374,6 @@ CPU.prototype.btr_reg = function(bit_base, bit_offset)

CPU.prototype.bt_mem = function(virt_addr, bit_offset)
{
dbg_assert(bit_offset >= 0);
var bit_base = this.safe_read8(virt_addr + (bit_offset >> 3) | 0);
bit_offset &= 7;

Expand All @@ -1384,7 +1383,6 @@ CPU.prototype.bt_mem = function(virt_addr, bit_offset)

CPU.prototype.btc_mem = function(virt_addr, bit_offset)
{
dbg_assert(bit_offset >= 0);
var phys_addr = this.translate_address_write(virt_addr + (bit_offset >> 3) | 0);
var bit_base = this.read8(phys_addr);

Expand All @@ -1398,7 +1396,6 @@ CPU.prototype.btc_mem = function(virt_addr, bit_offset)

CPU.prototype.btr_mem = function(virt_addr, bit_offset)
{
dbg_assert(bit_offset >= 0);
var phys_addr = this.translate_address_write(virt_addr + (bit_offset >> 3) | 0);
var bit_base = this.read8(phys_addr);

Expand All @@ -1412,7 +1409,6 @@ CPU.prototype.btr_mem = function(virt_addr, bit_offset)

CPU.prototype.bts_mem = function(virt_addr, bit_offset)
{
dbg_assert(bit_offset >= 0);
var phys_addr = this.translate_address_write(virt_addr + (bit_offset >> 3) | 0);
var bit_base = this.read8(phys_addr);

Expand Down

0 comments on commit 5bff589

Please sign in to comment.