¿Qué secuencia de instrucciones de pila usarás para rotar el contenido de los registros R0, R1 y R2?

También puede hacerlo con un solo registro adicional (a) y 6 declaraciones Xor.
Aquí está en python (^ es Xor)

def bin (s): devuelve str (s) si s > 1) + str (s & 1)

R1 = int (‘0110’, 2) # TBD: ‘0101’
R2 = int (‘1110’, 2) # TBD: ‘0110’
R3 = int (‘0101’, 2) # TBD: ‘1110’

imprimir ‘R1’, bin (R1)
imprimir ‘R2’, bin (R2)
imprimir ‘R3’, bin (R3)

imprimir “R1 R2”
a = R1 ^ R2
R1 = a ^ R1
R2 = a ^ R2
imprimir ‘R1’, bin (R1)
imprimir ‘R2’, bin (R2)

imprimir “R1 R3”
a = R1 ^ R3
R1 = a ^ R1
R3 = a ^ R3
imprimir ‘R1’, bin (R1)
imprimir ‘R2’, bin (R2)
imprimir ‘R3’, bin (R3)

produce:
R1 110
R2 1110
R3 101
R1 R2
R1 1110
R2 110
R1 R3
R1 101
R2 110
R3 1110

empujar R1
empujar R0
empujar R2
pop R0; obtiene el valor de R2
pop R1; obtiene el valor de R0
pop R2; obtiene el valor de R1