Shifting + rounding upwardsAssembler/8086

Imagine that we want to divide a number by a power of two (2, 4, 8, 16, etc.) and then rounding it upwards. In this case, why not use:

        shr     ax,4                   ; Here we divide by 16
        adc     ax,0
The only problem is that this combination will not pair on the Pentium. Both instructions do only pair in the U pipe. For interleaved code, insert an instruction that does not modify the Carry Flag.
Gem writer: Ervin Toth
last updated: 1998-03-16