summaryrefslogtreecommitdiff
path: root/Docs/src/int.but
blob: 4e70dedcfb6711b291116c8481796dd007c38015 (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
\S1{intinst} Integer Support

\S2{intfmt} IntFmt

\c user_var(output) format numberstring

Formats the number in "numberstring" using the format "format", and sets the output to user variable $x. Example format strings include "%08X" "%u"

\c IntFmt $0 "0x%08X" 195948557
\c IntFmt $0 "%c" 0x41

\S2{intop} IntOp

\c user_var(output) value1 OP [value2]

Combines value1 and (depending on OP) value2 into the specified user variable (\c{user_var}). OP is defined as one of the following:

\b \e{+} ADDs value1 and value2

\b \e{-} SUBTRACTs value2 from value1

\b \e{*} MULTIPLIEs value1 and value2

\b \e{/} DIVIDEs value1 by value2

\b \e{%} MODULUSs value1 by value2

\b \e{|} BINARY ORs value1 and value2

\b \e{&} BINARY ANDs value1 and value2

\b \e{^} BINARY XORs value1 and value2

\b \e{>>} RIGHT SHIFTs value1 by value2

\b \e{<<} LEFT SHIFTs value1 by value2

\b \e{~} BITWISE NEGATEs value1 (i.e. 7 becomes 4294967288)

\b \e{!} LOGICALLY NEGATEs value1 (i.e. 7 becomes 0)

\b \e{||} LOGICALLY ORs value1 and value2

\b \e{&&} LOGICALLY ANDs value1 and value2

\c IntOp $0 1 + 1
\c IntOp $0 $0 + 1
\c IntOp $0 $0 << 2
\c IntOp $0 $0 ~
\c IntOp $0 $0 & 0xF