test this:User_Russian wrote:Let's say that it is difficult to put unsigned variables due to libraries. But probably add a function Unsigned(expression), similar Bool().It is not difficult to do and does not require global modifications libraries.Code: Select all
x.l=0 y.l=$FFFFFFFF If Unsigned(x<y) ; unsigned comparison. Debug "OK" EndIf
I have already suggested, but it was not done.
Also, pay attention to this topic. If unsigned variables are not added, it is necessary to add a logical shift for signed variables.
Code: Select all
CompilerIf SizeOf(Integer) = 4
Macro rax : eax : EndMacro
CompilerEndIf
Procedure Unsigned(arg1.i,op1.l,arg2.i)
Select op1
Case '<'
!mov rdx, [p.v_arg1]
!cmp rdx, [p.v_arg2]
!setb al
ProcedureReturn
Case '<='
!mov rdx, [p.v_arg1]
!cmp rdx, [p.v_arg2]
!setbe al
ProcedureReturn
Case '>'
!mov rdx, [p.v_arg1]
!cmp rdx, [p.v_arg2]
!seta al
ProcedureReturn
Case '>='
!mov rdx, [p.v_arg1]
!cmp rdx, [p.v_arg2]
!setae al
ProcedureReturn
Case '='
!mov rax, [p.v_arg1]
!cmp rax, [p.v_arg2]
!sete al
ProcedureReturn
Case '<>'
!mov rax, [p.v_arg1]
!cmp rax, [p.v_arg2]
!setne al
ProcedureReturn
EndSelect
EndProcedure
x.l=$FFFFFFFF
y.l=$FFFFFFFE
If Unsigned(x,'>=',y) ; unsigned comparison.
Debug "OK"
EndIf