
163
SUMMARY
Eight example programs dealing with the applications
of logical instructions, Boolean instructions and subrou-
tine calls were discussed in this chapter. Examples are
taken from the counting number of set bits in any byte,
packing and unpacking BCD numbers, fi nding maximum
and minimum terms of any random integer array, bubble
sorting method, calculation of factorials and fi nding out
numbers divisible by 4.
POINTS TO REMEMBER
• After unpacking the MS BCD digit, it must be shift-
ed to the lower nibble of the byte.
• An easier way to multiply or divide an unsigned
integer by 2, 4, 8 etc. is to rotate the byte left or
right, respectively ...