Math Processor Unit Library

libmpu – library of arithmetic functions for integer, real, and complex numbers of increased digit capacity

16 Commits   0 Branches   2 Tags
41c271da (kx 2025-01-05 15:42:39 +0300  1) .TH ismul 3  "December 27, 2024" "libmpu" "LibMPU Programmer's Manual"
41c271da (kx 2025-01-05 15:42:39 +0300  2) .SH NAME
41c271da (kx 2025-01-05 15:42:39 +0300  3) \fBismul\fP \- signed multiplication of integers
41c271da (kx 2025-01-05 15:42:39 +0300  4) .SH SYNOPSIS
41c271da (kx 2025-01-05 15:42:39 +0300  5) .nf
41c271da (kx 2025-01-05 15:42:39 +0300  6) .B #include <libmpu.h>
41c271da (kx 2025-01-05 15:42:39 +0300  7) .PP
41c271da (kx 2025-01-05 15:42:39 +0300  8) .BI "void ismul( mpu_int *" prod ", mpu_int *" num ", mpu_int *" mul ", int " nb_prod ", int " nb_num " );
41c271da (kx 2025-01-05 15:42:39 +0300  9) .fi
41c271da (kx 2025-01-05 15:42:39 +0300 10) .SH DESCRIPTION
41c271da (kx 2025-01-05 15:42:39 +0300 11) The function \fBismul()\fP performs the multiplication operation of the variable located
41c271da (kx 2025-01-05 15:42:39 +0300 12) at the address \fBnum\fP by the variable located at the address \fBmul\fP, taking into account
41c271da (kx 2025-01-05 15:42:39 +0300 13) the sign of the variables. The result is placed at \fBprod\fP. The contents of the memory at
41c271da (kx 2025-01-05 15:42:39 +0300 14) \fBnum\fP, \fBmul\fP are not changed, the previous memory contents at \fBprod\fP are lost.
41c271da (kx 2025-01-05 15:42:39 +0300 15) The parameter \fBnb_prod\fP determines the size of the operand (in bytes) located at the
41c271da (kx 2025-01-05 15:42:39 +0300 16) address \fBprod\fP, and the parameter \fBnb_num\fP defines the size of operands (in bytes)
41c271da (kx 2025-01-05 15:42:39 +0300 17) located at the addresses \fBnum\fP, \fBmul\fP.
41c271da (kx 2025-01-05 15:42:39 +0300 18) .PP
41c271da (kx 2025-01-05 15:42:39 +0300 19) The function affects the flags \fBA\fP, \fBC\fP, \fBO\fP, \fBP\fP, \fBS\fP, \fBZ\fP, \fBR\fP.
41c271da (kx 2025-01-05 15:42:39 +0300 20) .PP
41c271da (kx 2025-01-05 15:42:39 +0300 21) The \fBA\fP flag is reset to 0. The \fBP\fP flag is set only when the size of the \fBprod\fP
41c271da (kx 2025-01-05 15:42:39 +0300 22) operand is one or two bytes (\fBnb\fP == 1 || \fBnb\fP == 2). Flag \fBR\fP (major || remainder)
41c271da (kx 2025-01-05 15:42:39 +0300 23) is set in the case that the resulting product requires a larger size than the \fBnb_prod\fP
41c271da (kx 2025-01-05 15:42:39 +0300 24) parameter.
41c271da (kx 2025-01-05 15:42:39 +0300 25) .sp
41c271da (kx 2025-01-05 15:42:39 +0300 26) .SH SEE ALSO
41c271da (kx 2025-01-05 15:42:39 +0300 27) .BR iadd(3),
41c271da (kx 2025-01-05 15:42:39 +0300 28) .BR isub(3),
41c271da (kx 2025-01-05 15:42:39 +0300 29) .BR iadc(3),
41c271da (kx 2025-01-05 15:42:39 +0300 30) .BR isbb(3),
41c271da (kx 2025-01-05 15:42:39 +0300 31) .BR ishl(3),
41c271da (kx 2025-01-05 15:42:39 +0300 32) .BR ishr(3),
41c271da (kx 2025-01-05 15:42:39 +0300 33) .BR isal(3),
41c271da (kx 2025-01-05 15:42:39 +0300 34) .BR isar(3),
41c271da (kx 2025-01-05 15:42:39 +0300 35) .BR irol(3),
41c271da (kx 2025-01-05 15:42:39 +0300 36) .BR iror(3),
41c271da (kx 2025-01-05 15:42:39 +0300 37) .BR ircl(3),
41c271da (kx 2025-01-05 15:42:39 +0300 38) .BR ircr(3),
41c271da (kx 2025-01-05 15:42:39 +0300 39) .BR ishln(3),
41c271da (kx 2025-01-05 15:42:39 +0300 40) .BR ishrn(3),
41c271da (kx 2025-01-05 15:42:39 +0300 41) .BR isaln(3),
41c271da (kx 2025-01-05 15:42:39 +0300 42) .BR isarn(3),
41c271da (kx 2025-01-05 15:42:39 +0300 43) .BR iroln(3),
41c271da (kx 2025-01-05 15:42:39 +0300 44) .BR irorn(3),
41c271da (kx 2025-01-05 15:42:39 +0300 45) .BR ircln(3),
41c271da (kx 2025-01-05 15:42:39 +0300 46) .BR ircrn(3),
41c271da (kx 2025-01-05 15:42:39 +0300 47) .BR ineg(3),
41c271da (kx 2025-01-05 15:42:39 +0300 48) .BR inot(3),
41c271da (kx 2025-01-05 15:42:39 +0300 49) .BR iand(3),
41c271da (kx 2025-01-05 15:42:39 +0300 50) .BR itest(3),
41c271da (kx 2025-01-05 15:42:39 +0300 51) .BR icmp(3),
41c271da (kx 2025-01-05 15:42:39 +0300 52) .BR ior(3),
41c271da (kx 2025-01-05 15:42:39 +0300 53) .BR ixor(3),
41c271da (kx 2025-01-05 15:42:39 +0300 54) .BR iinc(3),
41c271da (kx 2025-01-05 15:42:39 +0300 55) .BR idec(3),
41c271da (kx 2025-01-05 15:42:39 +0300 56) .BR ixchg(3),
41c271da (kx 2025-01-05 15:42:39 +0300 57) .BR icpy(3),
41c271da (kx 2025-01-05 15:42:39 +0300 58) .BR icvt(3),
41c271da (kx 2025-01-05 15:42:39 +0300 59) .BR imul(3),
41c271da (kx 2025-01-05 15:42:39 +0300 60) .BR idiv(3),
41c271da (kx 2025-01-05 15:42:39 +0300 61) .BR isdiv(3),
41c271da (kx 2025-01-05 15:42:39 +0300 62) .BR iatoi(3),
41c271da (kx 2025-01-05 15:42:39 +0300 63) .BR iatoui(3),
41c271da (kx 2025-01-05 15:42:39 +0300 64) .BR iitoa(3),
41c271da (kx 2025-01-05 15:42:39 +0300 65) .BR iuitoa(3).