The RCR instruction

Rotate a register or a memory location right through carry.

The RCR instruction format

InstructionDescription
RCR reg/mem8, 1Rotate 9 bits (CF, reg/mem8) right once.
RCR reg/mem8, CLRotate 9 bits (CF, reg/mem8) right CL times.
RCR reg/mem16, 1Rotate 17 bits (CF, reg/mem16) right once.
RCR reg/mem16, CLRotate 17 bits (CF, reg/mem16) right CL times.

The RCR instruction includes the CF flag in the rotation. RCR shifts the CF flag into the most significant bit and shifts the least significant bit into the CF flag.

If the masked value is 0, the flags are not affected. If the masked count is 1, the OF flag is affected; otherwise (the masked count is greater than 1) the OF flag is undefined.

Usage example

title Author: Evgeny Sergeevich Dovgopolov

.model small
.stack 100h

code segment public            ; Start of the code segment
    assume cs:code

    main proc                  ; Start of the main procedure
        mov     al, 10001101b  ; Copy the value 8Dh into the al register

        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1
        rcr     al, 1          ; Rotate the al register right by 1

        mov     ax, 4C00h      ; Copy the process termination function number into ah and the value into al
        int     21h            ; Call the interrupt
    main endp                  ; End of the main procedure

code ends                      ; End of the code segment
end main                       ; End of file. The main procedure is the entry point

Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".

Processor status flags

CF
Yes
PF
No
AF
No
ZF
No
SF
No
TF
No
IF
No
DF
No
OF
?