Rev Author Line No. Line
4985 kaklik 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title> words/mstar.asm </title>
6 <meta name="keywords" content="amforth programming language Forth ATmega ATMEL">
7 <meta name="description" content="amforth - laguage Forth for ATMEL ATmega">
8 <!-- AUTOINCLUDE START "Page/Head.en.ihtml" DO NOT REMOVE -->
9 <link rel="StyleSheet" href="../../../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style">
10 <link rel="StyleSheet" href="../../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
11 <link rel="shortcut icon" type="image/x-icon" href="../../../../Web/PIC/MLAB.ico">
12 <script type="text/javascript" src="../../../../Web/JS/MLAB_Menu.js"></script>
13 <!-- AUTOINCLUDE END -->
14 </head>
15  
16 <body lang="en">
17  
18 <!-- AUTOINCLUDE START "Page/Header.en.ihtml" DO NOT REMOVE -->
19 <!-- ============== HEADER ============== -->
20 <div class="Header">
21 <script type="text/javascript">
22 <!--
23 SetRelativePath("../../../../");
24 DrawHeader();
25 // -->
26 </script>
27 <noscript>
28 <p><b> JavaScript is required for including of the header </b></p>
29 </noscript>
30 </div>
31 <!-- AUTOINCLUDE END -->
32  
33 <!-- AUTOINCLUDE START "Page/Menu.en.ihtml" DO NOT REMOVE -->
34 <!-- ============== MENU ============== -->
35 <div class="Menu">
36 <script type="text/javascript">
37 <!--
38 SetRelativePath("../../../../");
39 DrawMenu();
40 // -->
41 </script>
42 <noscript>
43 <p><b> JavaScript is required for including of the menu </b><p>
44 </noscript>
45 </div>
46 <!-- AUTOINCLUDE END -->
47  
48 <!-- ============== TEXT ============== -->
49 <div class="Text">
50  
51 <h1> words/mstar.asm </h1>
52  
53 <p>
54 <input type=button onClick="history.back()" value="Back">
55 <input type=button onClick="history.forward()" value="Forward">
56 <a href="../WordList.en.html">Jump to Vocabulary</a>
57 </p>
58  
59 <pre>
60 ; ( n1 n2 -- d) Arithmetics
61 ; R( -- )
62 ; multiply 2 cells to a double cell
63 VE_MSTAR:
64 .db $02, &quot;m*&quot;,0
65 .dw VE_HEAD
66 .set VE_HEAD = VE_MSTAR
67 XT_MSTAR:
68 .dw PFA_MSTAR
69 PFA_MSTAR:
70 movw temp0, tosl
71 loadtos
72 ; result: (temp3*temp1)* 65536 + (temp3*temp0 + temp1*temp2) * 256 + (temp0 * temp2)
73 ; low bytes
74 mul tosl,temp0
75 movw zl, r0
76 clr temp2
77 clr temp3
78 ; middle bytes
79 mul tosh, temp0
80 add zh, r0
81 adc temp2, r1
82 adc temp3, zeroh
83  
84 mul tosl, temp1
85 add zh, r0
86 adc temp2, r1
87 adc temp3, zeroh
88  
89 mul tosh, temp1
90 add temp2, r0
91 adc temp3, r1
92 movw tosl, temp2
93 savetos
94 movw tosl, zl
95 jmp DO_NEXT
96 </pre>
97  
98 <p>
99 <input type=button onClick="history.back()" value="Back">
100 <input type=button onClick="history.forward()" value="Forward">
101 <a href="../WordList.en.html">Jump to Vocabulary</a>
102 </p>
103  
104 </div>
105  
106 <!-- AUTOINCLUDE START "Page/Footer.en.ihtml" DO NOT REMOVE -->
107 <!-- ============== FOOTER ============== -->
108 <div class="Footer">
109 <script type="text/javascript">
110 <!--
111 SetRelativePath("../../../../");
112 DrawFooter();
113 // -->
114 </script>
115 <noscript>
116 <p><b> JavaScript is required for including of the footer </b></p>
117 </noscript>
118 </div>
119 <!-- AUTOINCLUDE END -->
120  
121 </body>
122 </html>