11.14. 11.14 The HLA Standard Library Bits Module
The HLA Standard Library provides the bits.hhf module that provides several bit related functions, including built-in functions for many of the algorithms we've studied in this chapter. This section will describe these functions available in the HLA Standard Library.
procedure bits.cnt( b:dword ); returns( "EAX" )
This procedure returns the number of one bits present in the "b" parameter. It returns the count in the EAX register. To count the number of zero bits in the parameter value, invert the value of the parameter before passing it to bits.cnt. If you want to count the number of bits in a 16-bit operand, simply zero extend it to 32 bits prior to calling this function. Here are a couple of examples: ...
Get Art of Assembly Language, 1st Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.