You also need to look at the cycle count for the different ways of doing it (the first two ways ) to see which is really the most efficient time wise (if you care).
Fist approach: 4 bytes; 20 t-states. Second approach: 7 bytes; 32 t-states, but does not trash HL. Turbo Pascal's approach: 15 bytes; lots of t-states.
43 posted on 03/08/2002 5:17:09 AM PST by supercat