◐ Shell
clean mode source ↗

Merge pull request #34 from y-uti/fix-operand-order · php-java/php-java@cb95f98

Original file line numberDiff line numberDiff line change

@@ -11,8 +11,8 @@ final class _dadd implements OperationInterface

1111
1212

public function execute(): void

1313

{

14-

$value1 = $this->getStack();

1514

$value2 = $this->getStack();

15+

$value1 = $this->getStack();

1616
1717

$this->pushStack(BinaryTool::add($value1, $value2));

1818

}

Original file line numberDiff line numberDiff line change

@@ -11,8 +11,8 @@ final class _dmul implements OperationInterface

1111
1212

public function execute(): void

1313

{

14-

$value1 = $this->getStack();

1514

$value2 = $this->getStack();

15+

$value1 = $this->getStack();

1616
1717

$this->pushStack(BinaryTool::multiply($value1, $value2, 8));

1818

}

Original file line numberDiff line numberDiff line change

@@ -11,8 +11,8 @@ final class _dsub implements OperationInterface

1111
1212

public function execute(): void

1313

{

14-

$leftValue = $this->getStack();

1514

$rightValue = $this->getStack();

15+

$leftValue = $this->getStack();

1616
1717

$this->pushStack(BinaryTool::sub($leftValue, $rightValue, 8));

1818

}

Original file line numberDiff line numberDiff line change

@@ -11,8 +11,8 @@ final class _iadd implements OperationInterface

1111
1212

public function execute(): void

1313

{

14-

$leftValue = $this->getStack();

1514

$rightValue = $this->getStack();

15+

$leftValue = $this->getStack();

1616
1717

$this->pushStack(BinaryTool::add($leftValue, $rightValue));

1818

}

Original file line numberDiff line numberDiff line change

@@ -11,8 +11,8 @@ final class _iand implements OperationInterface

1111
1212

public function execute(): void

1313

{

14-

$value1 = $this->getStack();

1514

$value2 = $this->getStack();

15+

$value1 = $this->getStack();

1616
1717

$this->pushStack(BinaryTool::andBits($value1, $value2, 4));

1818

}

Original file line numberDiff line numberDiff line change

@@ -13,8 +13,8 @@ public function execute(): void

1313

{

1414

$offset = $this->readShort();

1515
16-

$leftOperand = $this->getStack();

1716

$rightOperand = $this->getStack();

17+

$leftOperand = $this->getStack();

1818
1919

if ($leftOperand === $rightOperand) {

2020

$this->setOffset($this->getProgramCounter() + $offset);

Original file line numberDiff line numberDiff line change

@@ -13,8 +13,8 @@ public function execute(): void

1313

{

1414

$offset = $this->readShort();

1515
16-

$leftOperand = $this->getStack();

1716

$rightOperand = $this->getStack();

17+

$leftOperand = $this->getStack();

1818
1919

if ($leftOperand !== $rightOperand) {

2020

$this->setOffset($this->getProgramCounter() + $offset);

Original file line numberDiff line numberDiff line change

@@ -13,10 +13,10 @@ public function execute(): void

1313

{

1414

$offset = $this->readShort();

1515
16-

$leftOperand = $this->getStack();

1716

$rightOperand = $this->getStack();

17+

$leftOperand = $this->getStack();

1818
19-

if ($leftOperand <= $rightOperand) {

19+

if ($leftOperand >= $rightOperand) {

2020

$this->setOffset($this->getProgramCounter() + $offset);

2121

}

2222

}

Original file line numberDiff line numberDiff line change

@@ -13,10 +13,10 @@ public function execute(): void

1313

{

1414

$offset = $this->readShort();

1515
16-

$leftOperand = $this->getStack();

1716

$rightOperand = $this->getStack();

17+

$leftOperand = $this->getStack();

1818
19-

if ($leftOperand < $rightOperand) {

19+

if ($leftOperand > $rightOperand) {

2020

$this->setOffset($this->getProgramCounter() + $offset);

2121

}

2222

}

Original file line numberDiff line numberDiff line change

@@ -13,10 +13,10 @@ public function execute(): void

1313

{

1414

$offset = $this->readShort();

1515
16-

$leftOperand = $this->getStack();

1716

$rightOperand = $this->getStack();

17+

$leftOperand = $this->getStack();

1818
19-

if ($rightOperand < $leftOperand) {

19+

if ($leftOperand < $rightOperand) {

2020

$this->setOffset($this->getProgramCounter() + $offset);

2121

}

2222

}