Page 1 of 4

Challenge for the ARM Assembler gurus!

PostPosted: Jan 22, 2004 @ 5:35pm
by kornalius
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

PostPosted: Jan 22, 2004 @ 11:47pm
by Exocet

PostPosted: Jan 22, 2004 @ 11:58pm
by kornalius

PostPosted: Jan 22, 2004 @ 11:59pm
by kornalius

PostPosted: Jan 23, 2004 @ 2:27pm
by refractor

PostPosted: Jan 23, 2004 @ 5:34pm
by kornalius

PostPosted: Jan 23, 2004 @ 5:58pm
by Dan East

PostPosted: Jan 23, 2004 @ 6:24pm
by kornalius

PostPosted: Jan 23, 2004 @ 6:28pm
by kornalius

PostPosted: Jan 23, 2004 @ 6:34pm
by kornalius

PostPosted: Jan 23, 2004 @ 8:52pm
by Kak

PostPosted: Jan 23, 2004 @ 8:55pm
by Kak

PostPosted: Jan 23, 2004 @ 11:33pm
by Exocet

PostPosted: Jan 24, 2004 @ 1:43am
by kornalius

PostPosted: Jan 24, 2004 @ 3:12am
by Exocet