11-24-2010, 08:11 PM
britlion Wrote:I completely agree I need other people to test these. I didn't write the original code, just reworked it from well known sources into shape; which means there are likely to be bugs.I've made some changes to your routine. Please download and compare.
I'll look into this one after work today.
Some corrections:
- Removed the LD DE,(XXXX) block. It's useless and might corrupt the HEAP
- Check if HL==0 (NULL) at the beginning of the asm code, and return if so (this can happen if not enough memory)
- Remove the FASTCALL and, instead of returning immediately, jump to the end of subroutine whenever required. The string ByVal parameters must be freed upon return, or there will be a memory leak (yes, the same that happened with print64 )
- Make as much labels as possible LOCAL, so it won't pollute namespace and won't collide with other routines. E.g. nextchar label could be used in many other routines (e.g. print64).