IMHO, it's not a good idea to "port" ASM code to TP (as TP's purpose is platform independence). So at best you should rewrite this in Pascal. Normally with modern PCs the performance decrease is not noticeable. -Michael