it performed about the same as the non-overflow checking version.
That's probably due to the branch prediction having very little overhead on performance.
One thing to notice,
however,
is that were a compiler to go down this path and check explicitely for overflow,
not only would the code be larger,
but overall it might be a bit slower than normal as there are commonly used optimizations
(at least on the x86 architecture)
that cannot be used.
For instance,
a cheap way to multiply a value by 5 is to skip the IMUL instruction and instead do LEA EAX,[EAX*4 + EAX],
but the LEA does not set the overflow flag.
Doing three INC EAX in a row is smaller (and just as fast) as doing ADD EAX,3,
but while the INC instruction does set the overflow flag,
you have to check the flag after each INC or you could miss an actual overflow,
which defeats the purpose of using INC to generate smaller code.

And one more thing before I go,
and this is about DynASM—it's not stated anywhere,
but if you use local labels,
you have to call
dasm_setupglobal()
or else the program will crash.
I found this out the hard way.

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go
ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or
entry, if there is only one entry). The titles are the permanent
links to that entry only. The format for the links are
simple: Start with the base link for this site: http://boston.conman.org/, then add the date you are
interested in, say 2000/08/01,
so that would make the final URL:

You may also note subtle shading of the links and that's
intentional: the “closer” the link is (relative to the
page) the “brighter” it appears. It's an experiment in
using color shading to denote the distance a link is from here. If
you don't notice it, don't worry; it's not all that
important.

It is assumed that every brand name, slogan, corporate name,
symbol, design element, et cetera mentioned in these pages is a
protected and/or trademarked entity, the sole property of its
owner(s), and acknowledgement of this status is implied.