int main () { std::cout << "Basic EmbeddedTime testing" << std::endl; std::cout << std::endl; std::cout << "Testing constructors..." << std::endl; Time _t1; Time _t2(1, 23, 30, 300); Time _t2bis(0, 23, 30, 300); Time _t3(1, 23, 30, 300, 500); Time _t4("01:23:30:300"); Time _t5(_t3); std::cout << std::endl; std::cout << "Testing operators..." << std::endl; std::cout << (_t2 - _t2bis) << std::endl; std::cout << (_t2 + _t2bis) << std::endl; _t1 = _t4; std::cout << _t1 << std::endl; std::cout << (_t4 == _t2) << std::endl; std::cout << (_t4 != _t2) << std::endl; std::cout << (_t2 < _t2bis) << std::endl; std::cout << std::endl; std::ifstream input_stream("input.ev"); Time t; int a; input_stream >> t >> a; assert(t.hours() == 1); assert(t.minutes() == 59); assert(t.seconds() == 59); assert(t.mseconds() == 37); assert(a = 42); while (input_stream >> t >> a) { std::cout << "reading line" << std::endl; assert(t.hours() == 2); assert(t.minutes() == 42); assert(t.seconds() == 42); assert(t.mseconds() == 42); assert(a = 42); } std::cout << "Testing realtime..." << std::endl; Time::initializeTimer(); Time t1 = Time::currentTime(); sleep(1); Time t2 = Time::currentTime(); sleep(1); Time t3 = Time::currentTime(); std::cout << "Current time and difference with the previous" << std::endl; std::cout << t1 << std::endl; std::cout << t2 << ": " << (t2 - t1) << std::endl; std::cout << t3 << ": " << (t3 - t2) << std::endl; return 0; }
_start( _unknown_ __eax, // r0 _unknown_ __ebx, // r1 _unknown_ __edx // r3 ) {// addr = 0x08048278 _unknown_ _v8; // _cfa_fffffff8 _unknown_ _t3; // _t3 intOrPtr* _t4; // _t4 _unknown_ _t5; // _t5 _unknown_ _t7; // _t7 _unknown_ _t8; // _t8 signed int _t9; // _t9 __edx = __edx; _t5 = __ebx; _t3 = __eax; _pop(__esi); __ecx = __esp; __esp = __esp & 240; _push(_t3); _push(__esp); _push(__edx); _push(_fini); _push(_init); _push(__ecx); _push(__esi); _push(main); __libc_start_main(); asm("hlt "); _push(0); _t9 = __esp; _push(_t5); _push(_t3); L2(); _pop(__ebx); _t4 = *((intOrPtr*)(_t5 + 0x123a)); if(_t4 != 0) { *_t4(); } __esp = _t9; _pop(__ebp); return; }
call_gmon_start( _unknown_ __eax, // r0 _unknown_ __ebx // r1 ) {// addr = 0x0804829C _unknown_ _v8; // _cfa_fffffff8 _unknown_ __ebp; // r6 intOrPtr* _t4; // _t4 _unknown_ _t5; // _t5 _unknown_ _t7; // _t7 _t5 = __ebx; _push(_t5); _push(__eax); L1(); _pop(__ebx); _t4 = *((intOrPtr*)(_t5 + 0x123a)); if(_t4 != 0) { *_t4(); } return; }