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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "HCALC" 1 "2024-01-10" "1.2u1" "Urchlay's Misc Stuff"
.SH NAME
hcalc \- graphical hex calculator
.\" RST source for hcalc(1) man page. Convert with:
.
.\" rst2man.py hcalc.rst > hcalc.1
.
.SH SYNOPSIS
.sp
hcalc [\fI\-default\fP] [\fI\-small\fP | \fI\-medium\fP | \fI\-large\fP] [\fI\-dec\fP | \fI\-hex\fP | \fI\-oct\fP | \fI\-bin\fP ] [\fI\-quiet\fP] [\fI\-\-version\fP] [\fI\-\-help\fP]
.SH DESCRIPTION
.sp
\fBhcalc\fP is a small (137x174 pixels minimum) TI Programmer II
semi\-clone for Unix/X11 and Windows 95/NT. It doesn\(aqt take up much
space, and supports decimal, hex, binary, and octal modes.
.sp
\fBhcalc\fP is operated with the mouse and/or keyboard. See \fBMOUSE\fP and
\fBKEYBOARD\fP sections, below.
.SH OPTIONS
.sp
Options listed as (persistent) get saved to the config file, so
they\(aqll still apply the next time \fBhcalc\fP is started. This applies
not only to command\-line arguments; the settings get saved if they\(aqre
changed via the mouse or keyboard, too.
.INDENT 0.0
.TP
.B \fB\-small\fP
Display in a 125x147 window (persistent).
.TP
.B \fB\-medium\fP
Display in a 250x294 window (persistent).
.TP
.B \fB\-large\fP
Display in a 500x588 window (persistent). This is the default.
.TP
.B \fB\-dec\fP
Start up in decimal mode (persistent). This is the default.
.TP
.B \fB\-hex\fP
Start up in hexadecimal mode (persistent).
.TP
.B \fB\-oct\fP
Start up in octal mode (persistent).
.TP
.B \fB\-bin\fP
Start up in binary mode (persistent).
.TP
.B \fB\-default\fP
Do not read the config file on startup. \fINOTE:\fP This option must
be the first on the command line, or it will be ignored!
.TP
.B \fB\-quiet\fP
Do not ring the X bell on invalid input (persistent).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Output version number and exit.
.TP
.B \-\-help
Output usage string and exit.
.UNINDENT
.SH DISPLAY
.sp
The numeric display is limited to 15 digits in decimal, hex, or octal
base. In binary mode, it displays 32 bits, but uses narrow "ticks"
rather than 0 and 1.
.sp
In hex mode, the number in the display will always be prefixed with
"0x". In octal mode, it will always be prefixed with "0". In decimal
mode, there is no prefix.
.sp
In case of error (e.g. division by zero), the display will show \fBerr\fP,
and you\(aqll have to press \fICLR\fP to continue.
.SH BUTTONS
.sp
The user interface mimics a pocket calculator, so it\(aqs made of
buttons. Each button can be pressed either by clicking on it with the
mouse, or pressing its keystroke (given in \fBbold\fP). A few buttons
have multiple functions, depending on which mouse button is used.
.sp
The descriptions below assume a right\-handed mouse, and refer to mouse
button 1 as "left" and button 3 as "right". If your mouse is set up
left\-handed, reverse them.
.INDENT 0.0
.TP
.B \fI0\fP to \fI9\fP, \fIA\fP to \fIF\fP (\fB0\-9\fP, \fBa\-f\fP)
Digits. Lowercase only for the hex digits. Entering digits
larger than the current number base is impossible (e.g. hex digits
when in decimal mode, or digits other than 0 or 1 in binary mode) and
will be ignored.
.TP
.B \fI\&.\fP (\fB\&.\fP)
Decimal point. Only works in decimal mode (base 10); other bases
are integer\-only.
.TP
.B \fI+\fP \fI\-\fP \fIx\fP \fI÷\fP (\fB+\fP \fB\-\fP \fB*\fP \fBx\fP \fB/\fP \fB%\fP)
Arithmetic: addition, subtraction, multiplication, division (modulus with
right\-click). Note that the \fBx\fP key is the same as \fB*\fP\&.
.TP
.B \fI=\fP (\fB=\fP \fBEnter\fP)
Finish the calculation and display the result.
.TP
.B \fI+/\-\fP (\fB_\fP \fBi\fP)
Invert sign.
.TP
.B \fIINV\fP (\fB~\fP)
Unary NOT, aka 1\(aqs complement; invert the bits in the current number.
For 32\-bit two\(aqs complement, right\-click or use \fB@\fP on the keyboard.
Integer operation; truncates digits after the decimal point.
.TP
.B \fIOR\fP \fIAND\fP \fIXOR\fP (\fB&\fP \fB|\fP \fB^\fP)
Boolean operations. Integer operations; truncates digits after the decimal point.
.TP
.B \fIDEC\fP \fIHEX\fP \fIOCT\fP \fIBIN\fP (\fBD\fP \fBH\fP \fBO\fP \fBB\fP or \fBF1\fP to \fBF4\fP)
Change the number base. The number being displayed will be converted
to the new base. Truncates digits after the decimal point.
.TP
.B \fIDEL\fP (\fBBackspace\fP or \fBDelete\fP)
Delete the last digit entered. Deleting the last digit results in 0.
.TP
.B \fISTO\fP \fIRCL\fP \fISUM\fP (\fB[\fP, \fB]\fP, \fB}\fP)
Store to memory (like \fIM\fP on most calculators); recall memory (like \fIMR\fP);
add current value to memory (like \fIM+\fP).
.TP
.B \fI<<\fP \fI>>\fP (\fB<\fP \fB>\fP)
Bit shift by one position, left or right.
Integer operation; truncates digits after the decimal point.
.TP
.B \fISHF\fP (\fBS\fP)
Shift left/right by some number of bits (binary
operation, like addition). Shifts left for positive
numbers and right for negative. This is less confusing
than it sounds: 1 shifted left once is 2, \-1 shifted right
once in \-2.
Integer operation; truncates digits after the decimal point.
.TP
.B \fICE\fP (\fBu\fP)
Clears the number being entered, same as backspacing over it,
but does not clear any pending operation.
.TP
.B \fICLR\fP (\fBC\fP, \fBEscape\fP)
Clears the display, memory, and any pending operation. With right\-click,
exits \fBhcalc\fP (use \fBQ\fP or \fB^Q\fP to quit from the keyboard).
.UNINDENT
.SH MOUSE
.sp
Mouse operation is simple: for the most part, just left\-click on the
buttons to press them.
.sp
There\(aqs no \fI%\fP button for the modulus operator, but you can
right\-click on the \fI÷\fP (division) key. Also, right\-click on
the \fIINV\fP key for two\(aqs complement.
.sp
Right\-clicking on the \fICLR\fP key exits \fBhcalc\fP\&.
.sp
For the numeric display, a left\-click copies the number to the X
selection buffer. Right\-click pastes from X, but beware: pasting
anything but a number in the current base might have unexpected
effects, because all pasted characters are treated as keystrokes (so,
e.g. pasting a capital Q quits the application). This can be useful,
e.g. if you paste "2+2=", \fBhcalc\fP will display "4".
.sp
A center\-click (button 2) anywhere in the \fBhcalc\fP window also pastes.
.SH KEYBOARD
.sp
These keys don\(aqt have calculator buttons.
.INDENT 0.0
.TP
.B \fB^C\fP
Copy the current number to the X selection
buffer. Same as clicking mouse button 1 (usually left) on the number display.
.TP
.B \fB^V\fP \fBShift\-Insert\fP
Paste from the X selection buffer.
Same as clicking a mouse button other than 1 (right\-clicking) on the number display.
.TP
.B \fBq\fP
Quiet. Toggles the audible bell.
.TP
.B \fBz\fP
Zoom: change window size. Alternates between the 3 sizes: \fB\-small\fP,
\fB\-medium\fP, \fB\-large\fP\&.
.UNINDENT
.\" other sections we might want, uncomment as needed.
.
.SH FILES
.INDENT 0.0
.TP
.B \fB$HOME/.hcalc.cfg\fP
Config file. This is a binary file, not human\-readable, and not
portable across architectures. It gets read on startup (unless
\fB\-default\fP is given) and written on exit. It stores the
number base, window size (as set on the command line),
the number that was displayed on exit, the contents of the
\fISTO\fP memory, and the \fB\-quiet\fP flag.
.sp
Some care is taken to make sure a config file from a different
architecture won\(aqt be used.
.sp
Since the config file isn\(aqt human\-readable, an easy way to
create one is to run \fBhcalc\fP with \fB\-default\fP plus your preferred
options. Example:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
hcalc \-default \-quiet \-large \-hex
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\&...which will kill any existing config file, and create a new one
that stores the options you gave. Now when you run \fBhcalc\fP with
no options, it will start up in hex mode, in a large window, and won\(aqt
ring the bell.
.sp
An even easier way is just to run \fBhcalc\fP and use the controls to
set the number base, size, and quiet flag. These settings automatically
get saved to the config file.
.UNINDENT
.SH ENVIRONMENT
.INDENT 0.0
.TP
.B \fBHOME\fP
Config file is searched for here. If this is not set, or can\(aqt be
read, no config file will be read or written.
.TP
.B \fBDISPLAY\fP
X display to use.
.UNINDENT
.\" EXIT STATUS
.
.\" ===========
.
.\" BUGS
.
.\" ====
.
.\" EXAMPLES
.
.\" ========
.
.SH COPYRIGHT
.sp
\fBhcalc\fP is released under the terms of the GNU GPL.
.SH AUTHORS
.sp
\fBhcalc\fP was originally written by DJ Delorie, modified by
Theodore Kilgore, and modified again by B. Watson, who also
wrote this man page.
.SH SEE ALSO
.sp
\fBxcalc\fP(1)
.\" Generated by docutils manpage writer.
.
|