These Quicksorts functions in this C++ CGI
are modified Versions of Hutch' Quicksorts
nrQsortA and nrQsortD in the folder M32LIB
from his Masm32 Assembler available from his site at
http://www.movsd.com

I modified these to work in a Visual C++ ASM procedures
I hope although as look back now was simple to modify will help others

What I did was use C runtime functions for memory management
first adding
EXTERN malloc:NEAR
EXTERN free:NEAR
I replaced
invoke SysAllocStringByteLen,0,bLen
with
push bLen
call malloc

and
I replaced invoke SysFreeString,hMem
with

push hMem
call free

And after I did that, to my amazement it ran!


See it run
http://busybeesolutions.com/cgi-bin/c_asm/Qsortnumbers.exe

See the ASM files
http://busybeesolutions.com/sourcefiles/c_asm/qsortnumsA.txt
http://busybeesolutions.com/sourcefiles/c_asm/qsortnumsD.txt
http://busybeesolutions.com/sourcefiles/c_asm/displaynums.txt

See the C file that calls the ASM procedures

http://busybeesolutions.com/sourcefiles/c_asm/qnums.txt

How to create a C++ or C to call assembly procedures in Visual C++
note: this project was a console project



http://support.microsoft.com/default.aspx?scid=kb;EN-US;q106399
:)
Posted on 2001-12-24 22:54:17 by andy981