/*-----------------------------------------------------------------------*
 * filename - rotl.cas
 *
 * function(s)
 *        _rotl - rotates an unsigned integer left
 *-----------------------------------------------------------------------*/

/*
 *      C/C++ Run Time Library - Version 5.0
 *
 *      Copyright (c) 1987, 1992 by Borland International
 *      All Rights Reserved.
 *
 */


#pragma inline
#include <stdlib.h>


/*-----------------------------------------------------------------------*

Name            _rotl - rotates an unsigned integer left

Usage           unsigned _rotl(unsigned val, int rotate_count)

Prototype in    stdlib.h

Description     _rotl rotates the unsigned integer val left rotate_count
                bits.

Return value   the unsigned integer val after rotation

*------------------------------------------------------------------------*/

#undef _rotl               /* not an intrinsic */
unsigned _rotl(unsigned val, int rotate_count)
{
asm     mov     ax, val
asm     mov     cx, rotate_count
asm     rol     ax, cl
        return  _AX;
}
