Strange M0+ instruction format

Hi,
    I note that the Thumb quick reference states that LSLS,LSLR & ASR can shift by a 5-bit field within the register OR by bits 0-7 of a second register. Now forgive my ignorance, but if 31 is the maximum shift value, bits 0-4 would be appropriate. Has anyone else tried placing values >31 into the register holding the shift value as it does appear to return odd values.

I'm not sure what is going on but if I find something unexpected, I try to find a way to use it.

I discovered it by placing 6 x 5-bit shift values into a single register, shifting right the shift value by 5 bits to select the next shift value. I have a subroutine that needs a lot of shifts and using this trick allows me to pass 2 variables, not 7.

Parents Reply Children
No data
More questions in this forum