srl
Shift right logical
Shifts a register or memory byte right one bit, copying bit 0 to C and putting zero into bit 7.
- 8-bit and 16-bit arithmetic, logic and bitsZ80 assembly
- Reverse a string in placeZ80 assembly
- Multiply and divide, with the remainderZ80 assembly
- Even or odd, count the set bits, multiply by shiftingZ80 assembly
- Binary searchZ80 assembly
- The snake gameZ80 assembly
- Flappy birdZ80 assembly
- ● set from the result
- 0 always 0
Forms
-
The contents of
rare shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. srl2 bytes · 15 cyclesThe contents of (HL) are shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.
-
The contents of the memory location pointed to by IX plus
ddare shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7.
Undocumented 1 row
Left out of Zilog's manual, but the Z80 runs them, and so does this emulator.
-
The contents of the memory location pointed to by IX plus
ddare shifted right one bit position. The contents of bit 0 are copied to the carry flag and a zero is put into bit 7. The result is then stored inr.
Operands
.org 0x8000
ld b, 3
srl b
halt