Code: Select all
; printf under PB_C
CompilerIf #PB_Compiler_ExecutableFormat<>#PB_Compiler_Console
CompilerError "Exec-Format must be Console in Compiler-Option"
CompilerEndIf
Define *string=UTF8("Hello visible universe. ")
Define *string2=UTF8("Value is now: %lld ")
Define *string3=UTF8("CPU-Time: %lld ")
Define value.q=42
OpenConsole()
! printf(p_string);
! printf(p_string2,++v_value);
! long long myrdtsc(void) { asm volatile ("rdtsc\n\t" "shl $32,%rdx\n\t" "or %rdx ,%rax"); }
! printf(p_string3,myrdtsc());
Input()
CloseConsole()
FreeMemory(*string)
FreeMemory(*string2)
FreeMemory(*string3)
; Hello visible universe. Value is now: 43 CPU-Time: 3181639470065