📄 mul.html
字号:
<!doctype html public "-//W3C//DTD HTML 3.2//EN"><html><head><title>Multiplication instructions</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><meta http-equiv="content-language" content="en" /><meta name="resource-type" content="document"><meta name="copyright" content="This document copyright 2001 by Richard Murray. Use for non-profit and education purposes explicitly granted."><meta name="author" content="Richard Murray"><meta name="rating" content="general"></head><!-- /assembler/mul.html --><!-- --><!-- (C) Copyright 1999 Richard Murray --><!-- Designed by Richard Murray --><!-- rmurray@heyrick.co.uk --><!-- --><body bgcolor="#f0f0f0" text="#000000" link="#0022dd" vlink="#002288"><table border = "0" width="100%"> <tr> <td align=center width=100> <img src="arm3.gif" width=79 height=78 align = middle> </td> <td> <h1 align="center"><font color="#800080">Multiplication<br>instructions</font></h1> </td> <td align=center width=100> <img src="arm3.gif" width=79 height=78 align = middle> </td></table><p> <p>These two instructions are different from the normal <a href="mov.html">arithmetical</a>instructions in that there are restrictions on the operands, namely:<ol> <li> All operands, and the destination, must be given as simple registers. <li> You cannot use immediate values or shifted registers for operand two. <li> The destination and operand one must be <i>different</i> registers. <li> Lastly, you cannot specify R15 as the destination.</ol><a name="mla"></a><h2>MLA : Multiplication with Accumulate</h2><pre> MLA<suffix> <dest>, <op 1>, <op 2>, <op 3> dest = (op_1 * op_2) + op_3</pre><code>MLA</code> behaved that same as <code>MUL</code>, except that the value of operand threeis added to the result. This is useful for running totals.<p> <p> <p><a name="mul"></a><h2>MUL : Multiplication</h2><pre> MUL<suffix> <dest>, <op 1>, <op 2> dest = op_1 * op_2</pre><code>MUL</code> provides 32 bit integer multiplication. If the operands are signed, it can beassumed that the result is also signed.<br>Here is an example of multiplication:<pre>REM Multiplication exampleREMREM by Richard Murray 26th April 1999REMREM Downloaded from: http://www.heyrick.co.uk/assembler/DIM code% 12P%=code%[ OPT 2 MUL R2, R0, R1 MOV R0, R2 MOV PC, R14]REPEAT INPUT "Number 1 : "A% INPUT "Number 2 : "B% PRINT "Result : "+STR$(USR(code%))'UNTIL A% = 0END</pre><div align = right><a href="sw/multiply.basic"><i>Download example: multiply.basic</i></a></div><p><hr size = "3"><a href="index.html#02">Return to assembler index</a><hr size = "3"><address>Copyright © 1999 Richard Murray</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -