Es fehlen nur die Vergleichsoperationen für Unsigned.
Habe mal was dafür gebastelt.
Code: Alles auswählen
;-TOP
; Kommentar :
; Author : mk-soft
; Second Author :
; Datei : UnsignedCompare.pb
; Version : 1.01
; Erstellt :
; Geändert :
;
; Compilermode :
;
; ***************************************************************************************
Procedure Above(a.l, b.l)
EnableASM
; If a > b
MOV ebx,dword [p.v_a]
CMP ebx,dword [p.v_b]
JBE l_not_above
; ProcedureReturn #True
MOV eax,1
ProcedureReturn
not_above:
; ProcedureReturn #False
XOr eax,eax
ProcedureReturn
DisableASM
EndProcedure
; ***************************************************************************************
Procedure AboveEqual(a.l , b.l)
EnableASM
; If a >= b
MOV ebx,dword [p.v_a]
CMP ebx,dword [p.v_b]
JB l_not_above_equal
; ProcedureReturn #True
MOV eax,1
ProcedureReturn
not_above_equal:
; ProcedureReturn #False
XOr eax,eax
ProcedureReturn
DisableASM
EndProcedure
; ***************************************************************************************
Procedure Below(a.l, b.l)
EnableASM
; If a < b
MOV ebx,dword [p.v_a]
CMP ebx,dword [p.v_b]
JAE l_not_below
; ProcedureReturn #True
MOV eax,1
ProcedureReturn
not_below:
; ProcedureReturn #False
XOr eax,eax
ProcedureReturn
DisableASM
EndProcedure
; ***************************************************************************************
Procedure BelowEqual(a.l, b.l)
EnableASM
; If a <= b
MOV ebx,dword [p.v_a]
CMP ebx,dword [p.v_b]
JA l_not_below_equal
; ProcedureReturn #True
MOV eax,1
ProcedureReturn
not_below_equal:
; ProcedureReturn #False
XOr eax,eax
ProcedureReturn
DisableASM
EndProcedure
; ***************************************************************************************
; test
Debug "Unsigned grösser"
Debug Above( -1, 1)
Debug Above( 1, 1)
Debug "Unsigned grösser gleich"
Debug AboveEqual( -1, 1)
Debug AboveEqual( 1, 1)
Debug "Unsigned kleiner"
Debug Below( 1, -1)
Debug Below( 1, 1)
Debug "Unsigned kleiner gleich"
Debug BelowEqual( 1, -1)
Debug BelowEqual( 1, 1)
