I was looking at some code written by other people and at one point I found the instruction:
ROL.L d0, d0
Now, I know this instruction allows me to shift bits left n places, example:
ROL.L #$2, d0
it makes me shift the bits of the longword contained in the data register d0 by two positions to the left, where any bits released on the left (msb) will reappear on the right (lsb).
Having ascertained this, I deduce that an instruction like the one mentioned in my question:
ROL.L d0, d0
it makes me shift by d0 positions to the left the bits of the longword contained in the data register d0.
In truth, this is not the case.
I have also tried on Intel microprocessors but it seems that such an instruction is not supported. Incidentally, on 64-bit INTEL systems the maximum rotation is 255 positions, while on 8088 microprocessors it is only 1 position at a time.
Update. I thought I'd include the procedure code where I found this instruction. This procedure generates pseudo-random numbers:
rand_func1
move.l #$12345678,d0
addq.l #5,d0
rol.l d0,d0
move.l d0,rand_func1+2 ; d0 = pseudo-random number
rts
By virtue of what @Sep Roland told me, I did some checks and this is what I got.
An instruction such as rol.l d0, d0, rotates the bits of register d0 to the left by the modulo 64 of the value contained in d0.
For ROL.L d0, d0 the CPU uses a rotation count of d0 and 63. So if the d0 register contains a value that is a multiple of 64, you won't observe any change to the value.
A modulo is the remainder of dividing one number by another. So, one modulo 64 of a number is the remainder of this number divided by 64. For example, the modulo 64 of 65 is 1, because when you divide 65 by 64, the remainder is 1.
Code example:
move.l #64,d0
rol.l d0,d0 ; No changes, this is because:
; Mod-64 of 64 is 0 because:
; 64 / 64 = 1 remainder 0, because:
; 64 x 0 = 0, so 64 - 64 = 0
;
; so the code is equivalent to:
; rol.l #0,d0, that is, no rotation
move.l #65,d0
rol.l d0,d0 ; Mod-64 of 65 is 1 because:
; 65 / 64 = 1 remainder 64, because:
; 64 x 1 = 64, so 65 - 64 = 1
;
; so the code is equivalent to:
; rol.l #1,d0, that is:
; d0 = 65 = 00000000 00000000 00000000 01000001
; once the code is executed:
; rol.l #1,d0
; d0 = 00000000 00000000 00000000 10000010 =
; = 82 hex
move.l #120,d0
rol.l d0,d0 ; Mod-64 of 120 is 56 because:
; 120 / 64 = 1 remainder 56, because:
; 64 x 1 = 64, so 120 - 64 = 56
;
; so the code is equivalent to:
; rol.l #56,d0, that is:
; d0 = 120 = 00000000 00000000 00000000 01111000
; once the code is executed:
; rol.l #56,d0 (if it could be done)
; d0 = 01111000 00000000 00000000 00000000 =
; = 78000000 hex