summaryrefslogtreecommitdiff
path: root/man/integer-flags.3mpu
blob: 68f42b43d4ecd434697387afc1cfb74d58586398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.\" Copyright 2026 Andrew V.Kosteltsev (kx@radix-linux.su)
.\"
.\"
.TH integer-flags 3  "September 15, 2026" "libmpu" "LibMPU Programmer's Manual"
.SH NAME
\fBinteger-flags\fP, \fB__mpu_clear_iflags\fP, \fB__mpu_clear_mflags\fP, \fB__mpu_gta\fP, \fB__mpu_gtc\fP, \fB__mpu_gto\fP, \fB__mpu_gts\fP, \fB__mpu_gtp\fP, \fB__mpu_gtz\fP, \fB__mpu_gtr\fP, \fB__mpu_gtv\fP, \fB__mpu_sta\fP, \fB__mpu_stc\fP, \fB__mpu_sto\fP, \fB__mpu_sts\fP, \fB__mpu_stp\fP, \fB__mpu_stz\fP, \fB__mpu_str\fP, \fB__mpu_stv\fP, \fB__mpu_cla\fP, \fB__mpu_clc\fP, \fB__mpu_clo\fP, \fB__mpu_cls\fP, \fB__mpu_clp\fP, \fB__mpu_clz\fP, \fB__mpu_clr\fP, \fB__mpu_clv\fP, \fB__mpu_cma\fP, \fB__mpu_cmc\fP, \fB__mpu_cmo\fP, \fB__mpu_cms\fP, \fB__mpu_cmp\fP, \fB__mpu_cmz\fP, \fB__mpu_cmr\fP, \fB__mpu_cmv\fP \- \fBLibMPU\fP integer\-operation flag handling
.SH SYNOPSIS
.nf
.B #include <libmpu.h>
.PP
.B "void __mpu_clear_iflags( void );"
.B "void __mpu_clear_mflags( void );"
.PP
.B "int __mpu_gta( void );"
.B "int __mpu_gtc( void );"
.B "int __mpu_gto( void );"
.B "int __mpu_gts( void );"
.B "int __mpu_gtp( void );"
.B "int __mpu_gtz( void );"
.B "int __mpu_gtr( void );"
.B "int __mpu_gtv( void );"
.PP
.B "void __mpu_sta( void );"
.B "void __mpu_stc( void );"
.B "void __mpu_sto( void );"
.B "void __mpu_sts( void );"
.B "void __mpu_stp( void );"
.B "void __mpu_stz( void );"
.B "void __mpu_str( void );"
.B "void __mpu_stv( void );"
.PP
.B "void __mpu_cla( void );"
.B "void __mpu_clc( void );"
.B "void __mpu_clo( void );"
.B "void __mpu_cls( void );"
.B "void __mpu_clp( void );"
.B "void __mpu_clz( void );"
.B "void __mpu_clr( void );"
.B "void __mpu_clv( void );"
.PP
.B "void __mpu_cma( void );"
.B "void __mpu_cmc( void );"
.B "void __mpu_cmo( void );"
.B "void __mpu_cms( void );"
.B "void __mpu_cmp( void );"
.B "void __mpu_cmz( void );"
.B "void __mpu_cmr( void );"
.B "void __mpu_cmv( void );"
.fi
.SH DESCRIPTION
\fBLibMPU\fP provides eight integer\-operation flags:
.PP
.nf
  \fBA\fP \- Auxiliary Carry Flag
  \fBC\fP \- Carry Flag
  \fBO\fP \- Overflow Flag
  \fBS\fP \- Sign Flag
  \fBP\fP \- Parity Flag (of lowest significant byte)
  \fBZ\fP \- Zero Flag
  \fBR\fP \- Major | Remainder
  \fBV\fP \- Invalid operation
.fi
.PP
The functions for each flag are grouped by operation below:
.nf
.sp
  ┌───────—┬─────────────┬─────────────┬─────────────┬─────────────┐
  │  \fBFlag\fP  │        \fBGet\fP  │        \fBSet\fP  │      \fBClear\fP  │  \fBComplement\fP │
  ├───────—┼────────────—┼────────────—┼─────────────┼─────────────┤
  │    \fBA\fP   │ __mpu_gta() │ __mpu_sta() │ __mpu_cla() │ __mpu_cma() │
  │    \fBC\fP   │ __mpu_gtc() │ __mpu_stc() │ __mpu_clc() │ __mpu_cmc() │
  │    \fBO\fP   │ __mpu_gto() │ __mpu_sto() │ __mpu_clo() │ __mpu_cmo() │
  │    \fBS\fP   │ __mpu_gts() │ __mpu_sts() │ __mpu_cls() │ __mpu_cms() │
  │    \fBP\fP   │ __mpu_gtp() │ __mpu_stp() │ __mpu_clp() │ __mpu_cmp() │
  │    \fBZ\fP   │ __mpu_gtz() │ __mpu_stz() │ __mpu_clz() │ __mpu_cmz() │
  │    \fBR\fP   │ __mpu_gtr() │ __mpu_str() │ __mpu_clr() │ __mpu_cmr() │
  │    \fBV\fP   │ __mpu_gtv() │ __mpu_stv() │ __mpu_clv() │ __mpu_cmv() │
  └────────┴─────────────┴─────────────┴─────────────┴─────────────┘
.fi
.PP
The \fBget\fP functions return the current value of the corresponding flag. The
\fBset\fP functions set it, the \fBclear\fP functions clear it, and the
\fBcomplement\fP functions invert its current value. All operations refer to
the \fBLibMPU\fP context of the current thread.
.PP
The \fB__mpu_clear_iflags()\fP function clears all integer flags: \fBA\fP, \fBC\fP,
\fBO\fP, \fBS\fP, \fBP\fP, \fBZ\fP, \fBR\fP and \fBV\fP.
.PP
The \fB__mpu_clear_mflags()\fP function clears the complete \fBLibMPU\fP flags
register, including both integer and real/math flags.
.SH RETURN VALUE
The get functions return \fB0\fP if the requested flag is clear and \fB1\fP if
it is set. The functions that set, clear or complement flags do not return a value.
.SH SEE ALSO
.BR real\-flags(3),
.BR libmpu(7).