Anuradha wrote:
The code probably doesnt use system calls-i am not sure. But there are some asm units that could take some time if we try to rewrite them in pascal. I am attaching one such code.
;³ Compare routine : ³ ;³ Definition in Pascal : ³ ;³ FUNCTION COMPARE( VAR structure 1 ; ³ ;³ offset in structure 1 : INTEGER ; ³ ;³ VAR structure 2 ; ³ ;³ offset in structure 2 : INTEGER ; ³ ;³ length to compare : WORD ) : INTEGER ; ³
A compare routine!? So what's wrong with MemComp (in the GPC unit)?
It doesn't have the offset parameters, but in most cases this will even make the invocation easier. E.g., if you previously used (I can only guess since you didn't give an example) Compare (Foo, i * SizeOf (Foo[0]), Bar, j * SizeOf (Bar[0]), s) you can now write MemComp (Foo[i], Bar[j], s) . And even in the unusual case that the offsets have nothing to do with the structure of the var parameters, you only need a type cast into a byte array or something (not exactly the cleanest Pascal, but still much better than asm code), or if you're afraid of changing the callers at all, it's easy to write a Compare function which does just that and calls MemComp.
Not meaning to be rude, but I really suggest you first look at the features GPC offers before deciding to use some self-made work-arounds. Unlike some other popular compilers, GPC has a rich set of built-in and library routines that cover many areas where with other compilers you might have to use some work-arounds.
Frank
PS: Your example file contains many strange characters:
;ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÿ
etc. I suppose they should have been Dos graphic characters. But then your MIME headers are wrong:
Content-Type: text/plain; charset=iso-8859-1; name="New Text Document.txt"
^^^^^^^^^^^^^^^^^^