Re: sort function using assembler..

Expand Messages
• ... After having tested a total of 10 sorting routines... my recommendation is to use... either RapidQ s QuickSort or RapidQ s QSringList Sort. I realize that
Message 1 of 26 , Jun 1, 2006
• 0 Attachment
--- In rapidq@yahoogroups.com, "msca53" <msca53@...> wrote:
>
> --- In rapidq@yahoogroups.com, "Don" <don67geo@> wrote:
> >
> > --- In rapidq@yahoogroups.com, "burkleyd" <burkleyd@> wrote:
> > >
> > > I found this webpage that gives examples of all
> > > 8 sorting methods... but it is written in Pascal.
> > > From what I've seen... it wouldn't (shouldn't)
> > > be too hard to convert the coding to RapidQ code.
> > >
> > >
> > > Hope this helps you in some way.
> > > David
> > >
> > '(*--------------- U S E R I N T E R F A C E --------------*)
> >
> > sub GetSortMethod
> > cls
> > print
> > print " CHOOSE: "
> > print
> > print " [1] FOR SELECT SORT "
> > print " [2] FOR INSERT SORT "
> > print " [3] FOR BUBBLE SORT "
> > print " [4] FOR SHAKE SORT "
> > print " [5] FOR HEAP SORT "
> > print " [6] FOR QUICK SORT "
> > print " [7] FOR SHELL SORT "
> > print " [8] FOR RADIX SORT "
> > print " [9] TO EXIT ALLSORT "
>
> Heap Sort..! Uh.. First time i read it
> Now, where is Merge Sort..?
>
> > sub StrSelectSort(X() as integer, N as integer)
> > defint I, J, K, Y
> > for I = 1 to N-1
> > K = I
> > Y = X(I)
> > for J = (I + 1) to N
> > if (X(J) < Y) then
> > K = J
> > Y = X(J)
> > end if
> > next
> > X(K) = X(J)
> > X(I) = Y
> > ShowOutput
> > print
> > next
> > end sub
> > greetings,
> >
> > - Don.
> >
> Change: X(K) = X(J) to X(K) = X(I)
>
> Good work..
> Manuel C
>

After having tested a total of 10 sorting routines...
my recommendation is to use... either RapidQ's QuickSort
or RapidQ's QSringList Sort. I realize that it "might"
be a bit difficult to write the code you need for your
specific use but... they are by far the fastest.
As an example... I created a list of 666 different random
numbers. Keyword being... different. I gave it a range of
0 to 999 to choose from. After the list was generated...
both RapidQ's QuickSort (for the numeric sort test) and
RapidQ's QStringList Sort (for the alpha sort test)...
were able to sort the list in as little as 0.002 secs.!
Whereas the other 8 sorting routines took anywhere from
0.9860 secs. to 2.181 secs. to complete. Quite a substantial
difference... wouldn't you say? I don't know about you but
I am quite impressed by how low the sort times are for the
RapidQ's sorting methods. I know which sorting routines I'll
be using from now on. :)
David
• ... My goal is an OPEN and FAST sort function, to manage databases indexes on the fly.. I love dbaseIII, because we can build our own LOCAL database manager
Message 2 of 26 , Jun 2, 2006
• 0 Attachment
--- In rapidq@yahoogroups.com, "burkleyd" <burkleyd@...> wrote:
>
> --- In rapidq@yahoogroups.com, "msca53" <msca53@> wrote:
>
> After having tested a total of 10 sorting routines...
> my recommendation is to use... either RapidQ's QuickSort
> or RapidQ's QSringList Sort. I realize that it "might"
> be a bit difficult to write the code you need for your
> specific use but... they are by far the fastest.
> As an example... I created a list of 666 different random
> numbers. Keyword being... different. I gave it a range of
> 0 to 999 to choose from. After the list was generated...
> both RapidQ's QuickSort (for the numeric sort test) and
> RapidQ's QStringList Sort (for the alpha sort test)...
> were able to sort the list in as little as 0.002 secs.!
> Whereas the other 8 sorting routines took anywhere from
> 0.9860 secs. to 2.181 secs. to complete. Quite a substantial
> difference... wouldn't you say? I don't know about you but
> I am quite impressed by how low the sort times are for the
> RapidQ's sorting methods. I know which sorting routines I'll
> be using from now on. :)
> David
>
My goal is an OPEN and FAST sort function, to manage databases
indexes on the fly.. I love dbaseIII, because we can build our own
LOCAL database manager without a big database server. But, i am
having troubles building INDEX files so they will be as fast as the
original dbase index file builders..! Up to now, i know we could do
it using b-trees -"boeing" trees, not binary trees-. But we could do
it by loading an array at run time, sort it and take the record
pointers to access the data ordered by a certain field (or columnm)..
Note, that we can go beyond this obvious task to make other things.
Ah.., heap sort is also a fast sort algorithm, and it is builded over
the idea of binary partitions, much a-like to quick sort..!!
I think that a function
void fsort( void* p); C's syntax
sub fsort( p as ANY ) RQ's syntax
would be nice..

Ciao..
Manuel Candela
• ... The following RapidQ code includes a RQASM code implementing QuickSort, it 6 times faster than RapidQ built in QuickSort Function (Nasm source code
Message 3 of 26 , Jun 2, 2006
• 0 Attachment
burkleyd wrote:

>
> After having tested a total of 10 sorting routines...
> my recommendation is to use... either RapidQ's QuickSort
> or RapidQ's QSringList Sort. I realize that it "might"
> be a bit difficult to write the code you need for your
> specific use but... they are by far the fastest.
> As an example... I created a list of 666 different random
> numbers. Keyword being... different. I gave it a range of
> 0 to 999 to choose from. After the list was generated...
> both RapidQ's QuickSort (for the numeric sort test) and
> RapidQ's QStringList Sort (for the alpha sort test)...
> were able to sort the list in as little as 0.002 secs.!
> Whereas the other 8 sorting routines took anywhere from
> 0.9860 secs. to 2.181 secs. to complete. Quite a substantial
> difference... wouldn't you say? I don't know about you but
> I am quite impressed by how low the sort times are for the
> RapidQ's sorting methods. I know which sorting routines I'll
> be using from now on. :)
> David
>

The following RapidQ code includes a RQASM code implementing
QuickSort, it 6 times faster than RapidQ built in QuickSort
Function (Nasm source code provided).

The RQASM Quicksort is a translation of the RapidQ Sub QSRQ
used in the following RapidQ code.

QSRQ was introduced in Pascal by David and translated to RapidQ
by Don.

' ---- RQ CODE START ----
' ------------------------------------------------------------------------------------
' RQASM QUICKSORT 6 TIMES FASTER THAN RQ QUICKSORT June 2nd, 2006 by Jacques
' ------------------------------------------------------------------------------------
' ====================================================================================
\$IFNDEF CALL_ASM_PROC_X
\$DEFINE CALL_ASM_PROC_X
DECLARE FUNCTION CallAsmProc LIB "user32" ALIAS "CallWindowProcA" _
(Proc AS LONG, A1 AS LONG, A2 AS LONG, A3 AS LONG, A4 AS LONG) AS LONG
\$ENDIF
' ====================================================================================
' ----- ARRAY containing ASM QSRQASM -----
DefByte QSRQASMArray (0 To 236) = _
{&H55,&H89,&HE5,&HB8,&H01,&H00,&H00,&H00,&H81,&H7D,&H08,&H00,&H00,&H00,&H00,&H0F, _
&H84,&HD2,&H00,&H00,&H00,&HB8,&H02,&H00,&H00,&H00,&H8B,&H4D,&H10,&H39,&H4D,&H0C, _
&H0F,&H8D,&HC1,&H00,&H00,&H00,&HC1,&H65,&H0C,&H02,&HC1,&H65,&H10,&H02,&H8B,&H75, _
&H08,&H8B,&H45,&H0C,&H8B,&H5D,&H10,&H89,&HC2,&H01,&HDA,&HD1,&HEA,&H81,&HE2,&HFC, _
&HFF,&HFF,&HFF,&H8B,&H14,&H16,&H8B,&H0C,&H06,&H39,&HD1,&H0F,&H8D,&H0A,&H00,&H00, _
&H00,&H05,&H04,&H00,&H00,&H00,&H8B,&H0C,&H06,&HEB,&HEE,&H8B,&H0C,&H1E,&H39,&HD1, _
&H0F,&H8E,&H0B,&H00,&H00,&H00,&H81,&HEB,&H04,&H00,&H00,&H00,&H8B,&H0C,&H1E,&HEB, _
&HED,&H39,&HD8,&H0F,&H8F,&H17,&H00,&H00,&H00,&HFF,&H34,&H06,&HFF,&H34,&H1E,&H8F, _
&H04,&H06,&H8F,&H04,&H1E,&H05,&H04,&H00,&H00,&H00,&H81,&HEB,&H04,&H00,&H00,&H00, _
&H39,&HD8,&H0F,&H8E,&HAE,&HFF,&HFF,&HFF,&HC1,&H6D,&H0C,&H02,&HC1,&H6D,&H10,&H02, _
&HC1,&HE8,&H02,&HC1,&HEB,&H02,&H39,&H5D,&H0C,&H0F,&H8D,&H15,&H00,&H00,&H00,&H50, _
&H53,&H68,&H00,&H00,&H00,&H00,&H53,&HFF,&H75,&H0C,&HFF,&H75,&H08,&HE8,&H3E,&HFF, _
&HFF,&HFF,&H5B,&H58,&H3B,&H45,&H10,&H0F,&H8D,&H15,&H00,&H00,&H00,&H50,&H53,&H68, _
&H00,&H00,&H00,&H00,&HFF,&H75,&H10,&H50,&HFF,&H75,&H08,&HE8,&H20,&HFF,&HFF,&HFF, _
&H5B,&H58,&HB8,&H00,&H00,&H00,&H00,&H89,&HEC,&H5D,&HC2,&H10,&H00}
' ----- POINTER to use In CallAsmProc -----
DefInt ptrQSRQASM = VarPtr (QSRQASMArray(0))
' ----- RQ CALL QSRQASM -----
Function QSRQASM (ptrArray As Long, First As Long, Last As Long) As Long
Result = CallAsmProc (ptrQSRQASM, ptrArray, First, Last, 0)
End Function
' ====================================================================================
'\$Include "QuickSort.Inc"
'
Sub QSRQ (A() as integer, First as integer, Last as integer)
defint Right, Left, V
If (First >= Last) then Exit Sub
V = A((First + Last) / 2)
Right = First
Left = Last
do
while (A(Right) < V)
Right = Right + 1
wend
while (A(Left) > V)
Left = Left - 1
wend
if (Right <= Left) then
Swap(A(Right), A(Left))
Right = Right + 1
Left = Left - 1
end if
loop until Right > Left
'
if (First < Left) then QSRQ(A(), First, Left)
if (Right < Last) then QSRQ(A(), Right, Last)
End sub
' ====================================================================================
\$ESCAPECHARS ON
\$TYPECHECK ON
\$INCLUDE "RAPIDQ.INC"
'
Declare Sub OnClose_frmMyForm
'
Create frmMyForm As QForm
Center
Width = 800
height = 800
Caption = "frmMyForm"
AutoScroll = False
OnClose = OnClose_frmMyForm
Create rchWin AS QRichEdit
Align = 5
Font.Name = "courier"
Font.Size = 8
Font.Color = &H800000
WordWrap = False
ScrollBars = ssBoth
HideSelection = False
PlainText = True
End Create
Caption = "SortRQ_QS_12 "
End Create
Caption = "SortRQASM_QS_12 "
End Create
Caption = "SortRQ_QS_500 "
End Create
Caption = "SortRQASM_QS_500 "
End Create
Caption = "SortRQ_QUICKSORT_500 "
End Create
Caption = "SortRQ_QS_10000 "
End Create
Caption = "SortRQASM_QS_10000 "
End Create
Caption = "SortRQ_QUICKSORT_10000 "
End Create
End Create
End Create
'
Sub GPrint (sText as String)
End Sub
'
'
' *************************************
frmMyForm.Show
' *************************************
'
'
'
' *************************************
frmMyForm.Visible = False
frmMyForm.ShowModal
' *************************************
'
Sub OnClose_frmMyForm
Application.Terminate
End Sub
'
DefInt N, flagError = 0, MaxValue = 1E4
DefInt iArray (0 To 11) = {7,6,5,3,9,4,2,1,0,9,0,8}
DefInt iArray500 (0 To 499)
DefInt iArray10000 (0 To 9999)
DefSng sngChrono
DefStr sTmp
If flagMenuBusy = True Then Exit Sub
Select Case Sender.Handle
Case mnuSortRqQs12.Handle
sTmp = "QS RAPIDQ FUNCTION SORTING AN ARRAY OF 12 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
sTmp = sTmp & "\nBefore: "
For N = 0 To 11
sTmp = sTmp & Str\$(iArray(N)) & " "
Next N
GPrint sTmp
QSRQ (iArray(), 0, 11)
sTmp = " After: "
For N = 0 To 11
sTmp = sTmp & Str\$(iArray(N)) & " "
Next N
GPrint sTmp
Case mnuSortRQASMQs12.Handle
sTmp = "QS RQASM FUNCTION SORTING AN ARRAY OF 12 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
sTmp = sTmp & "\nBefore: "
For N = 0 To 11
sTmp = sTmp & Str\$(iArray(N)) & " "
Next N
GPrint sTmp
QSRQASM (Varptr(iArray(0)), 0, 11) ' , ptrQSRQASM)
sTmp = " After: "
For N = 0 To 11
sTmp = sTmp & Str\$(iArray(N)) & " "
Next N
GPrint sTmp
Case mnuSortRqQs500.Handle
sTmp = "QS RAPIDQ FUNCTION SORTING AN ARRAY OF 500 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
GPrint sTmp
DoEvents
Randomize Timer
For N = 0 To 499
iArray500(N) = ((-1) ^ (Int(2 * rnd))) * (MaxValue * rnd)
Next N
sngChrono = Timer
QSRQ (iArray500(), 0, 499)
sngChrono = Timer - sngChrono
' Verify
For N = 0 To 498
If iArray500(N) > iArray500(N+1) Then Inc (flagError)
Next N
GPrint "ARRAY OF 500 INTEGERS SORTED WITH QSRQ IN " & Strf\$(sngChrono, ffFixed, 8, 5) _
& " s SORT ERRORS: " & Str\$(flagError)
For N = 0 To 9
Gprint "Array(" & Str\$(N) & ") = " & Str\$(iArray500(N))
Next N
Case mnuSortRqAsmQs500.Handle
sTmp = "QS RQASM FUNCTION SORTING AN ARRAY OF 500 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
GPrint sTmp
DoEvents
Randomize Timer
For N = 0 To 499
iArray500(N) = ((-1) ^ (Int(2 * rnd))) * (MaxValue * rnd)
Next N
sngChrono = Timer
QSRQASM (Varptr(iArray500(0)), 0, 499) ', ptrQSRQASM)
sngChrono = Timer - sngChrono
' Verify
For N = 0 To 498
If iArray500(N) > iArray500(N+1) Then Inc (flagError)
Next N
GPrint "ARRAY OF 500 INTEGERS SORTED WITH QSRQASM IN " & Strf\$(sngChrono, ffFixed, 8, 5) _
& " s SORT ERRORS: " & Str\$(flagError)
For N = 0 To 9
Gprint "Array(" & Str\$(N) & ") = " & Str\$(iArray500(N))
Next N
Case mnuRqQuickSort500.Handle
sTmp = "RAPIDQ QUICKSORT FUNCTION SORTING AN ARRAY OF 500 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
GPrint sTmp
DoEvents
Randomize Timer
For N = 0 To 499
iArray500(N) = ((-1) ^ (Int(2 * rnd))) * (MaxValue * rnd)
Next N
sngChrono = Timer
QuickSort (iArray500(0), iArray500(499), ASCEND)
sngChrono = Timer - sngChrono
' Verify
For N = 0 To 498
If iArray500(N) > iArray500(N+1) Then Inc (flagError)
Next N
GPrint "ARRAY OF 500 INTEGERS SORTED WITH RQ QUICKSORT IN " & Strf\$(sngChrono, ffFixed, 8, 5) _
& " s SORT ERRORS: " & Str\$(flagError)
For N = 0 To 9
Gprint "Array(" & Str\$(N) & ") = " & Str\$(iArray500(N))
Next N
Case mnuSortRqQs10000.Handle
sTmp = "QS RAPIDQ FUNCTION SORTING AN ARRAY OF 10000 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
GPrint sTmp
DoEvents
Randomize Timer
For N = 0 To 9999
iArray10000(N) = ((-1) ^ (Int(2 * rnd))) * (MaxValue * rnd)
Next N
sngChrono = Timer
QSRQ (iArray10000(), 0, 9999)
sngChrono = Timer - sngChrono
' Verify
For N = 0 To 9998
If iArray10000(N) > iArray10000(N+1) Then Inc (flagError)
Next N
GPrint "ARRAY OF 10000 INTEGERS SORTED WITH QSRQ IN " & Strf\$(sngChrono, ffFixed, 8, 5) _
& " s SORT ERRORS: " & Str\$(flagError)
For N = 0 To 9
Gprint "Array(" & Str\$(N) & ") = " & Str\$(iArray10000(N))
Next N
Case mnuSortRqAsmQs10000.Handle
sTmp = "QS RQASM FUNCTION SORTING AN ARRAY OF 10000 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
GPrint sTmp
DoEvents
Randomize Timer
For N = 0 To 9999
iArray10000(N) = ((-1) ^ (Int(2 * rnd))) * (MaxValue * rnd)
Next N
sngChrono = Timer
QSRQASM (Varptr(iArray10000(0)), 0, 9999) ' , ptrQSRQASM)
sngChrono = Timer - sngChrono
' Verify
For N = 0 To 9998
If iArray10000(N) > iArray10000(N+1) Then Inc (flagError)
Next N
GPrint "ARRAY OF 10000 INTEGERS SORTED WITH QSRQASM IN " & Strf\$(sngChrono, ffFixed, 8, 5) _
& " s SORT ERRORS: " & Str\$(flagError)
For N = 0 To 9
Gprint "Array(" & Str\$(N) & ") = " & Str\$(iArray10000(N))
Next N
Case mnuRqQuickSort10000.Handle
sTmp = "RAPIDQ QUICKSORT FUNCTION SORTING AN ARRAY OF 10000 ELEMENTS"
sTmp = "\n" & sTmp & "\n" & String\$(Len(sTmp), "=")
GPrint sTmp
DoEvents
Randomize Timer
For N = 0 To 9999
iArray10000(N) = ((-1) ^ (Int(2 * rnd))) * (MaxValue * rnd)
Next N
sngChrono = Timer
QuickSort (iArray10000(0), iArray10000(9999), ASCEND)
sngChrono = Timer - sngChrono
' Verify
For N = 0 To 9998
If iArray10000(N) > iArray10000(N+1) Then Inc (flagError)
Next N
GPrint "ARRAY OF 10000 INTEGERS SORTED WITH RQ QICKSORT IN " & Strf\$(sngChrono, ffFixed, 8, 5) _
& " s SORT ERRORS: " & Str\$(flagError)
For N = 0 To 9
Gprint "Array(" & Str\$(N) & ") = " & Str\$(iArray10000(N))
Next N
End Select
End Sub
'
'
'
\$IFDEF ASM_CODE
; NASM QUICKSORT source code:
; =========================================================================
; compile me with : nasmw.exe myname.asm -o myname.bin
; nasmw.exe at:
; more about RapidQ and Asm at:
; http://www.teledisnet.be/web/jph01696/RapidQ/index.html
; -------------------------------------------------------------------------
;
bits 32
%define ptrArray [ebp+8]
%define First [ebp+12]
%define Last [ebp+16]
segment .text
start:
push ebp
mov ebp, esp
QSRQASM:
mov eax, 1
cmp dword ptrArray, 0
jz near Finished
mov eax, 2
mov ecx, Last
cmp First, ecx
jge near Finished
shl dword First, 2
shl dword Last, 2
mov esi, ptrArray
mov eax, First
mov ebx, Last
mov edx, eax
shr edx, 1
and edx, 0xFFFFFFFC
mov edx, [esi+edx]
.Do_id7
mov ecx, [esi+eax]
.While_id9
cmp ecx, edx
jge near .ExitWhile_id10
mov ecx, [esi+eax]
jmp .While_id9
.ExitWhile_id10
mov ecx, [esi+ebx]
.While_id11
cmp ecx, edx
jle near .ExitWhile_id12
sub ebx, 4
mov ecx, [esi+ebx]
jmp .While_id11
.ExitWhile_id12
cmp eax, ebx
jg near .If_id13
push dword [esi+eax]
push dword [esi+ebx]
pop dword [esi+eax]
pop dword [esi+ebx]
sub ebx, 4
.If_id13
.ExitIf_id14
cmp eax, ebx
jle near .Do_id7
.ExitDo_id8
shr dword First, 2
shr dword Last, 2
shr eax, 2
shr ebx, 2
cmp First, ebx
jge near .If_id15
push eax
push ebx
push dword 0
push ebx
push dword First
push dword ptrArray
Call start
pop ebx
pop eax
.If_id15
.ExitIf_id16
cmp eax, Last
jge near .If_id17
push eax
push ebx
push dword 0
push dword Last
push eax
push dword ptrArray
Call start
pop ebx
pop eax
.If_id17
.ExitIf_id18
mov eax, 0
Finished
mov esp, ebp
pop ebp
ret 16
; =========================================================================
; END NASM SOURCE CODE
\$ENDIF
' ---- RQ CODE END
'

I'll try to translate the other David/Don's sorting functions ...

Jacques
'
• ... This is a good news. :-) It s like having an insert-able static LIB function at code level. Has anyone has thought about RQ2ASM translator? I think it s
Message 4 of 26 , Jun 2, 2006
• 0 Attachment
--- In rapidq@yahoogroups.com, Jacques Philippe <jp@...> wrote:
>
>
> The following RapidQ code includes a RQASM code implementing
> QuickSort, it 6 times faster than RapidQ built in QuickSort
> Function (Nasm source code provided).
>

This is a good news. :-)

It's like having an insert-able static LIB function at code level.

Has anyone has thought about RQ2ASM translator? I think it's will be
great for users that didn't know Assembler but still can use RQASM by
converting their RQ native routines. I mean the common basics
keywords, not the included QT_OBJECTS or API calls.
• ... As usual, good job Jacques. Do you work or just make code for us? ... FreeBasic!! play around with this: fbc myprog.bas -r then you will see myprog.asm
Message 5 of 26 , Jun 2, 2006
• 0 Attachment
> > The following RapidQ code includes a RQASM code implementing
> > QuickSort, it 6 times faster than RapidQ built in QuickSort
> > Function (Nasm source code provided).
> >
>
As usual, good job Jacques. Do you work or just make code for us?

> Has anyone has thought about RQ2ASM translator? I think it's will be
> great for users that didn't know Assembler but still can use RQASM by
> converting their RQ native routines. I mean the common basics
> keywords, not the included QT_OBJECTS or API calls.
>

FreeBasic!! play around with this:
fbc myprog.bas -r

then you will see myprog.asm
jK
• johnk20042001 wrote: The following RapidQ code includes a RQASM code implementing ... Ok, ok, ok....!! SPONSORED LINKS Basic
Message 6 of 26 , Jun 3, 2006
• 0 Attachment
johnk20042001 <klaffky2825@...> wrote:
> > The following RapidQ code includes a RQASM code implementing
> > QuickSort, it 6 times faster than RapidQ built in QuickSort
> > Function (Nasm source code provided).
> >
>
>As usual, good job Jacques. Do you work or just make code for us?

Ok, ok, ok....!!

Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
• ... Yes, and it is very portable ... even in RapidQ. ... Calling the RQASM function with CallWindowProc takes something like 10000 CPU cycles, so it s the
Message 7 of 26 , Jun 3, 2006
• 0 Attachment
Don wrote:

>
> It's like having an insert-able static LIB function at code level.
>

Yes, and it is very 'portable' ... even in RapidQ.

> Has anyone has thought about RQ2ASM translator? I think it's will be
> great for users that didn't know Assembler but still can use RQASM by
> converting their RQ native routines. I mean the common basics
> keywords, not the included QT_OBJECTS or API calls.

Calling the RQASM function with CallWindowProc takes something like
10000 CPU cycles, so it's the minimum time for a 'RQASM' routine. This
is a limit for 'RQASM' use in RapidQ. Previously I quickly calculates
that sorting 500 integers requires something like ?5 million CPU cycles,
here the 10000 CPU 'burden' -I call it the tax- is negligible.

In RapidQ Library (ie: RapidQ32.Lib) many API are resolved, desassembling
these library provides the Entry point of 500 common API. I already
published these addresses here I guess (long). So calling one ofthese API
in 'rqasm' is pretty easy (no need to resolve the API).

Jacques
• ... TY Do you work No, I created a nanobio stuff that transforms air in 1 cent coins. or just make code for us? Not for us John, for you :) ... for Fun too. I
Message 8 of 26 , Jun 3, 2006
• 0 Attachment
johnk20042001 wrote:

>>> The following RapidQ code includes a RQASM code implementing
>>> QuickSort, it 6 times faster than RapidQ built in QuickSort
>>> Function (Nasm source code provided).
>>>
> As usual, good job Jacques.

TY

Do you work

No, I created a nanobio stuff that transforms air in 1 cent coins.

or just make code for us?

Not for us John, for you :) ... for Fun too.

I love to program for few hours and 'RQASM' is my favorite
child. Someones call that intellectual msbtn :)

Jacques
• ... desassembling ... ofthese API ... I ve looking around for a document like this in this group, Guardian s site and your site, but has not found any. It s
Message 9 of 26 , Jun 3, 2006
• 0 Attachment
--- In rapidq@yahoogroups.com, Jacques Philippe <jp@...> wrote:
>
> In RapidQ Library (ie: RapidQ32.Lib) many API are resolved,
desassembling
> these library provides the Entry point of 500 common API. I already
> published these addresses here I guess (long). So calling one
ofthese API
> in 'rqasm' is pretty easy (no need to resolve the API).
>

I've looking around for a document like this in this group, Guardian's
like this.

Or probably, lying somewhere in RapidQ compiler a hidden internal
keywords that can be used to call RQASM without API call?

Could upload it to the file section?

- Don.
• ... I cant find them either ;) ... I upload them at: http://users.teledisnet.be/web/jph01696/RapidQ/Api_Resolved_in_RapidQ_LIB_and_DLL.zip Same short
Message 10 of 26 , Jun 3, 2006
• 0 Attachment
Don wrote:
> --- In rapidq@yahoogroups.com, Jacques Philippe <jp@...> wrote:
>> In RapidQ Library (ie: RapidQ32.Lib) many API are resolved,
> desassembling
>> these library provides the Entry point of 500 common API. I already
>> published these addresses here I guess (long). So calling one
> ofthese API
>> in 'rqasm' is pretty easy (no need to resolve the API).
>>
>
> I've looking around for a document like this in this group, Guardian's
> like this.
>

I cant find them either ;)

>
> Or probably, lying somewhere in RapidQ compiler a hidden internal
> keywords that can be used to call RQASM without API call?
>
> Could upload it to the file section?

http://users.teledisnet.be/web/jph01696/RapidQ/Api_Resolved_in_RapidQ_LIB_and_DLL.zip

Same short documentation in the Header of both asm.Inc files

Jacques
• ... 20+ (0.02 secs. vs 0.1+ secs.) faster with my slow PentiumI, against the 12+ seconds from QSRQ.. Obviously RapidQ slow-down the job.. RQ s quicksort()
Message 11 of 26 , Jun 3, 2006
• 0 Attachment
> The following RapidQ code includes a RQASM code implementing
> QuickSort, it 6 times faster than RapidQ built in QuickSort
> Function (Nasm source code provided).
>
> The RQASM Quicksort is a translation of the RapidQ Sub QSRQ
> used in the following RapidQ code.
>
> QSRQ was introduced in Pascal by David and translated to RapidQ
> by Don.
>
>
> ' ---- RQ CODE START ----
> ' --------------------------------------------------------------------
----------------
> ' RQASM QUICKSORT 6 TIMES FASTER THAN RQ QUICKSORT June 2nd,
>2006 by Jacques

20+ (0.02 secs. vs 0.1+ secs.) faster with my "slow" PentiumI, against
the 12+ seconds from QSRQ.. Obviously RapidQ slow-down the job.. RQ's
quicksort() function it's a very good one..

Well, i got it finally..
Sorting strings.. it's another story..!

Thank you
Manuel C.
• ... against ... RQ s ... Ooohh.. 0.12/0.02. Sorry Manuel C.
Message 12 of 26 , Jun 4, 2006
• 0 Attachment
--- In rapidq@yahoogroups.com, "msca53" <msca53@...> wrote:
>
> > The following RapidQ code includes a RQASM code implementing
> > QuickSort, it 6 times faster than RapidQ built in QuickSort
> > Function (Nasm source code provided).
> >
> > The RQASM Quicksort is a translation of the RapidQ Sub QSRQ
> > used in the following RapidQ code.
> >
> > QSRQ was introduced in Pascal by David and translated to RapidQ
> > by Don.
> >
> >
> > ' ---- RQ CODE START ----
> > ' ---------------------------------------------------------------
-----
> ----------------
> > ' RQASM QUICKSORT 6 TIMES FASTER THAN RQ QUICKSORT June 2nd,
> >2006 by Jacques
>
> 20+ (0.02 secs. vs 0.1+ secs.) faster with my "slow" PentiumI,
against
> the 12+ seconds from QSRQ.. Obviously RapidQ slow-down the job..
RQ's
> quicksort() function it's a very good one..
>
> Well, i got it finally..
> Sorting strings.. it's another story..!
>
> Thank you
> Manuel C.
>
Ooohh.. 0.12/0.02. Sorry
Manuel C.
• ... And the first result is 5 and not 20 :), the second result is 6 times faster. Jacques
Message 13 of 26 , Jun 4, 2006
• 0 Attachment
msca53 wrote:
>> 20+ (0.02 secs. vs 0.1+ secs.) faster with my "slow" PentiumI,
> against
>> the 12+ seconds from QSRQ.. Obviously RapidQ slow-down the job..
> RQ's
>> quicksort() function it's a very good one..

...

> Ooohh.. 0.12/0.02. Sorry
> Manuel C.

And the first result is 5 and not 20 :), the second result is
6 times faster.

Jacques
Your message has been successfully submitted and would be delivered to recipients shortly.