Esempio n. 1
0
void
PrintfInt ( int32 n )
{
    byte buffer [ 1024 ] ;
    if ( _Context_->System0->NumberBase == 10 ) sprintf ( ( char* ) buffer, INT_FRMT, n ) ;
    else if ( _Context_->System0->NumberBase == 2 )
    {
        Print_Binary ( n, 4, 46 ) ;
        return ;
    }
    else /* if ( _Context->System0->NumberBase == 16 ) */ sprintf ( ( char* ) buffer, UINT_FRMT_0x09, n ) ; // hex
    // ?? any and all other number bases ??
    Printf ( ( byte* ) buffer ) ;
}
Esempio n. 2
0
File: cpu.c Progetto: 8l/openvmtil
void
_CpuState_Show ( CpuState * cpu )
{
    Printf ( ( byte* ) "\nEAX 0x%08x", cpu->Eax ) ;
    Printf ( ( byte* ) " ECX 0x%08x", cpu->Ecx ) ;
    Printf ( ( byte* ) " EDX 0x%08x", cpu->Edx ) ;
    Printf ( ( byte* ) " EBX 0x%08x", cpu->Ebx ) ;
    Printf ( ( byte* ) "\nESP 0x%08x", cpu->Esp ) ;
    Printf ( ( byte* ) " EBP 0x%08x", cpu->Ebp ) ;
    Printf ( ( byte* ) " ESI 0x%08x", cpu->Esi ) ;
    Printf ( ( byte* ) " EDI 0x%08x", cpu->Edi ) ;
    if ( _CfrTil_->Debugger0->DebugAddress ) Printf ( ( byte* ) "\nEIP 0x%08x", _CfrTil_->Debugger0->DebugAddress ) ;
    else Printf ( ( byte* ) "\nEIP 0x%08x", cpu->Eip ) ;
    Printf ( ( byte* ) " EFlags " ) ;
    Print_Binary ( cpu->EFlags, 14, 14 ) ;
    Printf ( ( byte* ) ": of:11 %d sf:7 %d, zf:6 %d, af:4 %d, pf:2 %d, cf:0 %d :: flag:bit value\n",
        cpu->EFlags & OVERFLOW_FLAG ? 1 : 0, cpu->EFlags & SIGN_FLAG ? 1 : 0, cpu->EFlags & ZERO_FLAG ? 1 : 0,
        cpu->EFlags & AUX_FLAG ? 1 : 0, cpu->EFlags & PARITY_FLAG ? 1 : 0, cpu->EFlags & CARRY_FLAG ? 1 : 0
        ) ;
}