<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>