Arithmetic/Integer: Difference between revisions

Content added Content deleted
Line 40: Line 40:
From the principles of operation: Operands are signed and 32 bits long.
From the principles of operation: Operands are signed and 32 bits long.
Negative quantities are held in two's-complement form.
Negative quantities are held in two's-complement form.
====Multiplication====
<br>'''Multiplication:'''<br>
The product of the multiplier (the second operand) and the multiplicand
The product of the multiplier (the second operand) and the multiplicand
(the first operand) replaces the multiplicand. Both multiplier and
(the first operand) replaces the multiplicand. Both multiplier and
multiplicand are 32-bit signed integers. The product is always a 64-bit
multiplicand are 32-bit signed integers. The product is always a 64-bit
signed integer and occupies an even/odd register pair.
signed integer and occupies an even/odd register pair.
====Division====
<br>'''Division:'''<br>
The dividend (first operand) is divided by the divisor (second operand)
The dividend (first operand) is divided by the divisor (second operand)
and replaced by the quotient and remainder. The dividend is a 64-bit
and replaced by the quotient and remainder. The dividend is a 64-bit
Line 51: Line 51:
A 32-bit signed remainder and a 32-bit signed quotient replace the dividend
A 32-bit signed remainder and a 32-bit signed quotient replace the dividend
in the even-numbered and odd-numbered registers, respectively.
in the even-numbered and odd-numbered registers, respectively.
<lang 360asm>
<lang 360asm>* Arithmetic/Integer 04/09/2015
* Arithmetic/Integer 04/09/2015
ARITHINT CSECT
ARITHINT CSECT
USING ARITHINT,R12
USING ARITHINT,R12
Line 90: Line 89:
BUF DC CL12' '
BUF DC CL12' '
YREGS
YREGS
END ARITHINT
END ARITHINT</lang>
</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 100: Line 98:
R 9
R 9
</pre>
</pre>




=={{header|6502 Assembly}}==
=={{header|6502 Assembly}}==