|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.javagear.Flag
public final class Flag
Zilog Z80 CPU flag emulation.
Field Summary | |
---|---|
private int |
f
Register. |
private static int |
F_BIT3
Bit3 (usually a copy of bit 3 of the result). |
private static int |
F_BIT5
Bit5 (usually a copy of bit 5 of the result). |
private static int |
F_CARRY
Carry (set when a standard carry occurred). |
private static int |
F_HALFCARRY
Half carry (set when a carry occured between bit 3 / 4 of result - used for BCD). |
private static int |
F_NEGATIVE
Negative (set when instruction is subtraction, clear when addition). |
private static int |
F_PARITY
True indicates even parity in the result, false for 2s complement sign overflow. |
private static int |
F_SIGN
Sign (set when a result is negative). |
private static int |
F_ZERO
Zero (set when a result is zero). |
private int |
f2
The register's second bank. |
private static boolean[] |
PARITY
Pre-calculated flag settings. |
Constructor Summary | |
---|---|
Flag()
Flag Constructor. |
Method Summary | |
---|---|
boolean |
bit3()
Returns true if the bit 3 flag (F_BIT3 ) is set and
false otherwise. |
void |
bit3Off()
Sets the bit 3 flag Off ( F_BIT3 ). |
void |
bit3On()
Sets the bit 3 flag On ( F_BIT3 ). |
boolean |
bit5()
Returns true if the bit 5 flag (F_BIT5 ) is set, and
false otherwise. |
void |
bit5Off()
Sets the bit 5 flag Off ( F_BIT5 ). |
void |
bit5On()
Sets the bit 5 flag On ( F_BIT5 ). |
boolean |
carry()
Returns true if carry flag (F_CARRY ) is set. |
void |
carryOff()
Carry Flag Off. |
void |
carryOn()
Carry Flag On. |
void |
clear()
Clear register. |
void |
ex()
Exchange register banks. |
int |
get()
Get value of flag register. |
boolean |
halfcarry()
Returns true if the half carry flag (F_HALFCARRY ) is set, and
false otherwise. |
void |
halfCarryOff()
Sets the half carry flag Off ( F_HALFCARRY ). |
void |
halfCarryOn()
Sets the half carry flag On ( F_HALFCARRY ). |
boolean |
negative()
Returns true if the negative flag (F_NEGATIVE ) is set. |
void |
negativeOff()
Negative Flag Off. |
void |
negativeOn()
Negative Flag On. |
boolean |
parity()
Returns true if the parity flag ( F_PARITY ) is set. |
void |
parityOff()
Sets the parity flag Off ( F_PARITY ). |
void |
parityOn()
Sets the parity flag On ( F_PARITY ). |
void |
set(int value)
Set flag register. |
void |
setBit3(int v)
|
void |
setBit5(int v)
|
void |
setParity(int n)
Set parity. |
boolean |
sign()
Returns true if the sign flag (F_SIGN ) is set, and
false otherwise. |
void |
signOff()
Sets the sign flag Off ( F_SIGN ). |
void |
signOn()
Sets the sign flag On ( F_SIGN ). |
boolean |
zero()
Returns true if the zero flag (F_ZERO ) is set, and
false otherwise. |
void |
zeroOff()
Sets the zero flag Off ( F_ZERO ). |
void |
zeroOn()
Sets the zero flag On ( F_ZERO ). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean[] PARITY
private static final int F_CARRY
private static final int F_NEGATIVE
private static final int F_PARITY
private static final int F_BIT3
private static final int F_HALFCARRY
private static final int F_BIT5
private static final int F_ZERO
private static final int F_SIGN
private int f
private int f2
Constructor Detail |
---|
public Flag()
Method Detail |
---|
public int get()
public void set(int value)
value
- value to set register (0 - 0xFF).public void clear()
public void carryOn()
public void carryOff()
public boolean carry()
true
if carry flag (F_CARRY
) is set.
true
if set.public void negativeOn()
public void negativeOff()
public boolean negative()
true
if the negative flag (F_NEGATIVE
) is set.
true
if set.public void parityOn()
F_PARITY
).
public void parityOff()
F_PARITY
).
public void setParity(int n)
n
- value to test (0
- 0xFF
).public boolean parity()
F_PARITY
) is set.
true
if set.public void setBit3(int v)
public void bit3On()
F_BIT3
).
public void bit3Off()
F_BIT3
).
public boolean bit3()
true
if the bit 3 flag (F_BIT3
) is set and
false
otherwise.
true
if set.public void halfCarryOn()
F_HALFCARRY
).
public void halfCarryOff()
F_HALFCARRY
).
public boolean halfcarry()
true
if the half carry flag (F_HALFCARRY
) is set, and
false
otherwise.
true
if set.public void setBit5(int v)
public void bit5On()
F_BIT5
).
public void bit5Off()
F_BIT5
).
public boolean bit5()
true
if the bit 5 flag (F_BIT5
) is set, and
false
otherwise.
true
if set.public void zeroOn()
F_ZERO
).
public void zeroOff()
F_ZERO
).
public boolean zero()
true
if the zero flag (F_ZERO
) is set, and
false
otherwise.
true
if set.public void signOn()
F_SIGN
).
public void signOff()
F_SIGN
).
public boolean sign()
true
if the sign flag (F_SIGN
) is set, and
false
otherwise.
true
if set.public void ex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |