Re: Another one



> How about this one? It also produces an 'Operand size mismatch'
>
> mov Result+1, al // save to allocated string/last position

"byte ptr" fixes it:

mov byte ptr Result+1, al

Actually i'm doubtful if for these functions assembler gives a large
benefit. They don't seem to be very optimized. For example i think the
XLAT instruction is probably inefficient; many rarely used high-level
opcodes (like LOOP and REP MOVS, so probably also XLAT) have a slow
implementation in modern CPUs.

You might be better off coding these things in Pascal (leaving you with
more readable code that is only slightly less, if at all, slower) or
using more optimized assembly (you can suggest them as Fastcode
challenges, though it might take some time before the implementations
arrive).

In any case i find myself coding this function often as well, so it
might be a potential Fastcode candidate.

--
The Fastcode Project: http://www.fastcodeproject.org/
.



Relevant Pages