Andlw instruction (#5)
This commit is contained in:
1 parent
47cf49abea
commit
8011c0ce40
2 files changed
+24
-2
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package commands;
|
||||
|
||||
import registers.Memory;
|
||||
|
||||
public class Andlw extends CommandUtils implements Command
|
||||
{
|
||||
private final int literal;
|
||||
|
||||
public Andlw(int input)
|
||||
{
|
||||
literal = input & 0x00FF;
|
||||
}
|
||||
@Override
|
||||
public void execute()
|
||||
{
|
||||
int result = literal & Memory.workingRegister;
|
||||
|
||||
checkZeroBit(result);
|
||||
|
||||
Memory.workingRegister = result % 256;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user