Re: cFASM (calling FASM as a C function)



If you go through the FASM source code, you'll find that it's
written using a 386-era programming style. By that, I mean that Tomasz
uses CISC instructions that get as much work done per byte of object
code as possible. While that was an effective programming style at one
time, on the modern "more-RISC-like" x86 CPUs you pay a heavy penalty
for using that programming style. A classic example is how Tomasz uses
the SCASD instruction to do nothing other than increment EDI by 4.
Clever, if saving space is your prime concern, but certainly not the
fastest way to add 4 to EDI. Given how heavily string instructions
get used in the code, I wouldn't be surprised to find that you could
double the speed of FASM by replacing those instructions.

In some discussions i recall, Tomasz was against lowlevel
optimizations that makes maintaining harder.

Also, as you probably don't know, size is a concern here. Tomasz wants
to keep .COM version of FASM, but size of FASM is dangerously hitting
64KB. :)

.