; TITLE "SMTH03 - Syslib 4.0" NAME ('ROTLH') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SMTH03.Z80 Ver 1.1 by Richard Conn ; Date : 17 Sep 89 ; Version : 1.2 ; Module : SMTH03 ; Abstract: This module contains the routine ROTLH which rotates ; the HL register pair Left 1 bit. Bit 15 is rotated in a ; circular fashion into Bit 0. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC ROTLH .Z80 CSEG ;=============================================================== ; NAME - ROTLH ; Entry: HL - Contains a 16-bit value to rotate ; Exit : HL - Contains the shifted value ; Uses : HL ; Special Requirements: None ;=============================================================== ROTLH: PUSH AF ; Save A and flags ADD HL,HL ; Shift all 16 bits by addition JR NC,EXIT ; Quit if no need to compensate for LSB SET 0,L ; ..else set LSB from Carry EXIT: POP AF ; Restore A and flags RET END