home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - rotl.cas
- *
- * function(s)
- * _rotl - rotates an unsigned integer left
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 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;
- }
-