It can be something very stupid, but I would like to ask this question to clarify things in my head.
I am doing great 68k assembly tutorial (link). Evrything goes well, but I don't understand one thing. Let me quote:
You can shift using one data register as a shift size, for example:
lsl.l d0,d1
Now in this example, d1 is shifted left by the number held in d0. We’ll pretend at d0 contains 0000010F.
For the source operand, only a byte is read as the shift count. Since d0 contains 0000010F, only the 0F is used. So, the long-word of d1 is shifted left by 0F bits.
The maximum number of bits you can shift by depends on the size you chose:
.b for byte gives a maximum shift of $08 bits. .w for word gives a maximum shift of $10 bits. .l for long-word gives a maximum shift of $1F bits.
And here it goes: why for byte and 16bit word operation you can use full length (0x08 for byte and 0x10 for 16bit word) and for 32bit long word only 0x1F? Shouldnt it be 0x20 for 32bit long word consequently?
Anyway I don't see a point shifiting byte 8 bits left as this will give always 0x00 as result.
Still I don't understand this exception for long word in this tutorial.
Any help apreciated.
You can only use up to 0x1F for the shift size because there are 32 bits in a long word, so there are only 31 bits to which you can shift the lowest order bit before you completely run out of places to shift the bits.
As far as why the processor or at least the assembler won't accept 0x20 as the number of bits to shift, that was a design decision by whoever designed the chip or the assembler. Remember, if the assembler is the gatekeeper unless you manually edit the binary riles. If the assembler does not accept the code, it doesn't really matter if the chip accepts it unless you manually edit the binary.