Challenge for the ARM Assembler gurus!

Hi,
I am writing a compiler which translate code into ARM assembly and would like to know how in C I can convert a 32bits number into 12bits.
ex:
str r0, [r5, #0xFA0] ; This represents 1000 * 4 in C.
mov r1, #1, 20 ; This is 4096;
mov r1, #0x7D, 26 ; This is 8000;
mov r1, #0xFA, 26 ; And this is 16000;
I hope it's clear enough. I would like to be able to get two values out of the function. The base value and the shift value.
ex: conv32to12 (16000, &base, &shift);
Regards,
Alain Deschenes
I am writing a compiler which translate code into ARM assembly and would like to know how in C I can convert a 32bits number into 12bits.
ex:
str r0, [r5, #0xFA0] ; This represents 1000 * 4 in C.
mov r1, #1, 20 ; This is 4096;
mov r1, #0x7D, 26 ; This is 8000;
mov r1, #0xFA, 26 ; And this is 16000;
I hope it's clear enough. I would like to be able to get two values out of the function. The base value and the shift value.
ex: conv32to12 (16000, &base, &shift);
Regards,
Alain Deschenes