|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdioscuri.module.cpu.Util
public class Util
| Field Summary | |
|---|---|
protected static boolean |
cf
|
protected static int |
lowerByteCarry
|
| Method Summary | |
|---|---|
protected static byte[] |
addRegRegDisp(byte[] reg1,
byte[] reg2,
byte[] displacement)
Adds two registers and the memory reference displacement. Does not check carry or overflow flags. |
protected static byte[] |
addWords(byte[] word1,
byte[] word2,
int carryBit)
Adds two words (16-bit) including a possible carry bit. Takes care of possible carry from LSB to MSB. |
protected static byte[] |
booleansToBytes(boolean[] booleans)
Converts a boolean[] into a byte[] Each boolean value is converted into a hexadecimal (0 or 1) value and placed in a byte[]. |
protected static boolean[] |
bytesToBooleans(byte[] bytes)
Converts a byte[] into a boolean[] Each bit is converted into a boolean value and placed in a boolean[]. |
protected static boolean |
checkParityOfByte(byte data)
Check the parity of a given byte and given size in bits. |
protected static java.lang.String |
convertByteToString(byte b)
|
protected static byte |
convertStringToByte(java.lang.String strValue)
Converts a given string into a byte of one integer |
protected static byte[] |
convertStringToWord(java.lang.String strValue)
Converts a given string into a word of bytes |
protected static java.lang.String |
convertWordToString(byte[] word)
|
static int |
getExponent(double val)
|
static int |
getExponent(float val)
|
static double |
scalb(double d,
int i)
|
static float |
scalb(float f,
int i)
|
protected static byte |
signExtend(byte inputByte)
Determines the sign of the input byte and returns the complementary (sign-extended) byte |
protected static byte[] |
subtractWords(byte[] word1,
byte[] word2,
int borrowBit)
Subtracts two words (16-bit) including a possible borrow bit. Takes care of possible borrow from LSB to MSB. |
protected static boolean |
test_AF_ADD(byte input,
byte result)
Test the auxiliary flag (AF) for addition with possible carry. AF is set when carry occurs to higher nibble. |
protected static boolean |
test_AF_ShiftLeft(byte input,
int shifts)
Test the auxiliary flag (AF) for shift operations with byte. AF is set when carry occurs. |
protected static boolean |
test_AF_SUB(byte input,
byte result)
Test the auxiliary flag (AF) for subtraction with possible borrow. AF is set when borrow occurs from higher nibble. |
protected static boolean |
test_CF_ADD(byte[] input1,
byte[] input2,
int carry)
Test the carry flag for addition operations with words. CF is set when unsigned overflow occurs. |
protected static boolean |
test_CF_ADD(byte input1,
byte input2,
int carry)
Test the carry flag for addition operations with bytes. CF is set when unsigned overflow occurs. |
protected static boolean |
test_CF_SUB(byte[] input1,
byte[] input2,
int carry)
Test the carry flag for subtraction operations with words. CF is set when unsigned overflow occurs. |
protected static boolean |
test_CF_SUB(byte input1,
byte input2,
int carry)
Test the carry flag for subtraction operations with bytes. CF is set when unsigned overflow occurs. |
protected static boolean |
test_OF_ADD(byte[] input1,
byte[] input2,
byte[] result,
int carry)
Test the overflow flag for addition operations with words. OF is set when 2's complement signed overflow occur. |
protected static boolean |
test_OF_ADD(byte input1,
byte input2,
byte result,
int carry)
Test the overflow flag for addition operations with bytes. OF is set when 2's complement signed overflow occur. |
protected static boolean |
test_OF_SUB(byte[] input1,
byte[] input2,
byte[] result,
int carry)
Test the overflow flag for subtraction operations with words. OF is set when 2's complement signed overflow occurs. |
protected static boolean |
test_OF_SUB(byte input1,
byte input2,
byte result,
int carry)
Test the overflow flag for subtraction operations with bytes. OF is set when 2's complement signed overflow occurs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static boolean cf
protected static int lowerByteCarry
| Method Detail |
|---|
protected static boolean checkParityOfByte(byte data)
data -
protected static byte[] addWords(byte[] word1,
byte[] word2,
int carryBit)
word1 - first wordword2 - second wordcarryBit -
protected static byte[] subtractWords(byte[] word1,
byte[] word2,
int borrowBit)
word1 - first wordword2 - second wordborrowBit -
protected static byte[] addRegRegDisp(byte[] reg1,
byte[] reg2,
byte[] displacement)
reg1 - first register to be addedreg2 - second register to be addeddisplacement -
protected static boolean test_AF_ADD(byte input,
byte result)
input - result -
protected static boolean test_AF_SUB(byte input,
byte result)
input - result -
protected static boolean test_AF_ShiftLeft(byte input,
int shifts)
input - shifts -
protected static boolean test_CF_ADD(byte input1,
byte input2,
int carry)
input1 - input2 - carry -
protected static boolean test_CF_ADD(byte[] input1,
byte[] input2,
int carry)
input1 - input2 - carry -
protected static boolean test_CF_SUB(byte input1,
byte input2,
int carry)
input1 - unsigned input1 of operationinput2 - unsigned input2 of operationcarry - possible carry bit
protected static boolean test_CF_SUB(byte[] input1,
byte[] input2,
int carry)
input1 - input2 - carry -
protected static boolean test_OF_ADD(byte input1,
byte input2,
byte result,
int carry)
input1 - input2 - result - carry -
protected static boolean test_OF_ADD(byte[] input1,
byte[] input2,
byte[] result,
int carry)
input1 - result - input2 - carry -
protected static boolean test_OF_SUB(byte input1,
byte input2,
byte result,
int carry)
input1 - input2 - carry - result -
protected static boolean test_OF_SUB(byte[] input1,
byte[] input2,
byte[] result,
int carry)
input1 - input2 - result - carry -
protected static byte signExtend(byte inputByte)
inputByte - Byte whose sign determines value of sign-extension
protected static byte[] booleansToBytes(boolean[] booleans)
booleans -
protected static boolean[] bytesToBooleans(byte[] bytes)
bytes -
protected static java.lang.String convertByteToString(byte b)
b -
protected static java.lang.String convertWordToString(byte[] word)
word -
protected static byte convertStringToByte(java.lang.String strValue)
strValue -
protected static byte[] convertStringToWord(java.lang.String strValue)
strValue -
public static int getExponent(double val)
val -
public static int getExponent(float val)
val -
public static double scalb(double d,
int i)
d - i -
public static float scalb(float f,
int i)
f - i -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||