Skip to content

Commit e35b8cd

Browse files
committed
Add lxor
1 parent 14916f8 commit e35b8cd

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/Kernel/Mnemonics/_lxor.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22
namespace PHPJava\Kernel\Mnemonics;
33

4-
use PHPJava\Exceptions\NotImplementedException;
4+
use PHPJava\Kernel\Types\_Long;
5+
use PHPJava\Utilities\Extractor;
56

67
final class _lxor implements OperationInterface
78
{
@@ -10,6 +11,17 @@ final class _lxor implements OperationInterface
1011

1112
public function execute(): void
1213
{
13-
throw new NotImplementedException(__CLASS__);
14+
$value2 = $this->popFromOperandStack();
15+
$value1 = $this->popFromOperandStack();
16+
17+
$this->pushToOperandStack(
18+
_Long::get(
19+
BinaryTool::xorBits(
20+
Extractor::getRealValue($value1),
21+
Extractor::getRealValue($value2),
22+
8
23+
)
24+
)
25+
);
1426
}
1527
}

0 commit comments

Comments
 (0)