Code: Select all
CompilerIf (#PB_Compiler_Processor = #PB_Processor_x86)
val = -2147483647
valq.q = -9223372036854775807
CompilerElse
val = -9223372036854775807
valq.q = -9223372036854775807
CompilerEndIf
Procedure.i Absi (val)
CompilerIf (#PB_Compiler_Processor = #PB_Processor_x86)
Protected t = val >> 31 ; MSB is used to fill all the bits
CompilerElse
Protected t = val >> 63 ; MSB is used to fill all the bits
CompilerEndIf
val ! t ; v xor t
val - t ; v sub t
ProcedureReturn val
EndProcedure
Procedure.q Absq (val.q)
Protected t.q = val >> 63 ; MSB is used to fill all the bits
val ! t ; v xor t
val - t ; v sub t
ProcedureReturn val
EndProcedure
Debug Absi(val)
Debug Absq(valq)