implemented Rrf Instruction
This commit is contained in:
@@ -18,15 +18,14 @@ public class Rlf extends FileRegisterCommandUtils implements Command
|
||||
public void execute()
|
||||
{
|
||||
int register = Memory.getRegister(address);
|
||||
int carry = Memory.getCarryBit();
|
||||
int tmp = carry;
|
||||
carry = register >>7;
|
||||
register = ((register <<1) + tmp) & 0xFF;
|
||||
int newCarry = register >>7;
|
||||
int oldCarry = Memory.getCarryBit();
|
||||
register = ((register <<1) + oldCarry) & 0xFF;
|
||||
|
||||
if(carry == 1)
|
||||
if(newCarry == 1)
|
||||
{
|
||||
Memory.setCarryBit();
|
||||
} else if(carry == 0){
|
||||
} else if(newCarry == 0){
|
||||
Memory.clearCarryBit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user