...MOD/DIV are just other words for AND/ASR...
All times I use SET when working with hardware
registers; so, I was curious about
the generated code for MOD/DIV alternative
A simple test for extracting some bits from a 16 bits value
a := 2345H;
b := a DIV 100H MOD 7;
Generate :
10 40002345 MOV R0 R0 9029
11 A0D00000 STR R0 SB 0
12 80D00000 LDR R0 SB 0
13 40020008 ASR R0 R0 8
14 400B0007 DIV R0 R0 7
15 20000000 MOV' R0 R0 R0
16 A0D00004 STR R0 SB 4
I forget something ?