<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-forward-container">
<blockquote type="cite"
cite="mid:6DD503A0-A4CA-44F8-8A67-AFA2F59232FB@iaeth.ch">
<pre class="moz-quote-pre" wrap="">...MOD/DIV are just other words for AND/ASR...
</pre>
</blockquote>
<p><font size="-1">All times I use SET when working with hardware
registers; </font><font size="-1"><span id="result_box"
class="" lang="en"><span class="">so, I was curious about
the generated code for MOD/DIV alternative</span><br>
<span class=""><br>
</span></span></font></p>
<p><font size="-1"><span id="result_box" class="" lang="en"><span
class="">A simple test</span></span> </font> <font
size="-1">for extracting some bits from a 16 bits value <br>
</font> <font size="-1"><br>
   a := 2345H; <br>
   b := a DIV 100H MOD 7; <br>
</font> <font size="-1"><br>
Generate : <br>
</font> <font size="-1"><br>
10Â Â Â 40002345Â Â Â MOVÂ Â Â R0Â Â Â R0Â Â Â 9029 <br>
11Â Â Â A0D00000Â Â Â STRÂ Â Â R0Â Â Â SBÂ Â Â 0 </font><font size="-1"><br>
12Â Â Â 80D00000Â Â Â LDRÂ Â Â R0Â Â Â SBÂ Â Â 0 <br>
13Â Â Â 40020008Â Â Â ASRÂ Â Â R0Â Â Â R0Â Â Â 8 <br>
14Â Â Â 400B0007Â Â Â DIVÂ Â Â R0Â Â Â R0Â Â Â 7 <br>
15Â Â Â 20000000Â Â Â MOV'Â Â Â R0Â Â Â R0Â Â Â R0 <br>
16Â Â Â A0D00004Â Â Â STRÂ Â Â R0Â Â Â SBÂ Â Â 4 <br>
</font> <font size="-1"><br>
I forget something ? </font></p>
</div>
</body>
</html>