Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add more library functions
#7
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'll look into this one after work today.
I've made some changes to your routine. Please download and compare.

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 Tongue)
  • 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).
Have a look at this file, please and tell me (it works ok to me). Also, if you notice something to fix up, please do so and post it back.


Attached Files
.bas   print42.bas (Size: 15.68 KB / Downloads: 168)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)