SuperH-based fx calculators
fx legacy BCD

Refer to NumberFormat for further details.

BCD to/from double conversion.

 

0x284: int BCD_GetNotANumberValue( unsigned char*value, unsigned char*result );

if (value[0] && 0xF0 == 0xF0) result = "ERROR";
  if (value[0] && 0xF0 == 0x80) result = "UNDEF";
  if (value[0] && 0xF0 == 0x90) result = "TRUE";
  if (value[0] && 0xF0 == 0xA0) result = "FALSE";
  if (value[0] && 0xF0 == 0x40){
        if ((short*)value[10] > 0x5000) result = "-INFINITY";
        else result = "INFINITY";
  };

returns 1 if "ERROR" else returns 0

 

0x5A6: int BCD_SetAsInt( int input, TBCDvalue*result );

Converts an integer input into BCD *result.
 

0x645: CalculateExpression( char**formula, char opcode[2], TBCDvalue*result, int P4 );

Converts a string input into BCD *result.
if ( P4 == 0 ){
    the concatenation of opcode and formula is used
    f. i. if opcode[0] = '1' and formula is "897" the resulting number will be 1897
}else{
    formula is used, the first opcode if formula is copied to opcode
}

opcode[ 0 ] must not be zero.

0x64A: CalculateExpression0( ... );

Converts a string input into BCD *result.
This syscall is called by 0x645 and has 5 arguments. Use 0x645 instead.

 

(20.05.2012 06:40:57)