The RAL instruction

The RAL (Rotate Accumulator Left through Carry) instruction performs a rotate-left operation on the accumulator with the carry flag taken into account.

The RAL instruction format

InstructionDescription
RAL This format is used to rotate the 8-bit value in register A to the left + CY.

Usage example

; Author: Evgeny Sergeevich Dovgopolov

main:
    mvi     a, 80h  ; Load the hexadecimal value 80h into register A
    stc             ; Set the carry flag CY
    cmc             ; Invert the carry flag
    ral             ; Rotate the value in register A one bit to the left with the CY flag taken into account

    hlt             ; Stop program execution

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

Processor status flags

S
Yes
Z
Yes
AC
No
P
Yes
CY
Yes