; TITLE "SMTH04 - Syslib 4.0" NAME ('ROTRH') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SMTH04.Z80 Ver 1.1 by Richard Conn ; Date : 17 Sep 89 ; Version : 1.2 ; Module : SMTH04 ; Abstract: This module contains the routine ROTRH which rotates ; the contents of the HL register pair one bit position to ; the right in a circular fashion. Bit 0 of the L register ; is rotated into Bit 7 of the H register. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC ROTRH .Z80 CSEG ;=============================================================== ; NAME - ROTRH ; Entry: HL - Contains the 16-bit value to rotate ; Exit : HL - Contains the rotated value ; Uses : HL ; Special Requirements: None ;=============================================================== ROTRH: PUSH AF SRL H ; Shift H 1 bit right with zero fill RR L ; Now shift L 1 bit right with carry fill JR NC,EXIT ; Exit here if no bit to loop SET 7,H ; ..else simulate rotating the bit EXIT: POP AF RET END