70 lines
2.7 KiB
HTML
70 lines
2.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Calculations</title>
|
|
<meta name="GENERATOR" content="WinCHM">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<style>
|
|
html,body {
|
|
/* Default Font */
|
|
font-family: Courier New;
|
|
font-size: 11pt;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<P><STRONG>Calculations<BR></STRONG>The debugger allows usage of basic math
|
|
operations, just type an expression in the
|
|
command window and the result will be displayed in the console. Apart from
|
|
calculations, it allows quick variable changes using a C-like syntax.</P>
|
|
<P><STRONG>Operators</STRONG><BR> You can use the following operators in your expression.
|
|
They are processed in the following order (<A
|
|
href="http://en.cppreference.com/w/c/language/operator_precedence"
|
|
target=_blank>source</A>):</P>
|
|
<P><U>1:parentheses/brackets</U>: <EM>(1+2)</EM>, [1+6] have
|
|
priority over other operations.</P>
|
|
<P><U>2:unary minus/binary not/logical not</U>: <EM>-1</EM> (negative 1), <EM>~1</EM> (binary not of 1), <EM>!0</EM>
|
|
(logical not of 0).</P>
|
|
<P><U>
|
|
3:multiplication/division</U>:
|
|
<EM>2*3</EM> (regular multiplication), <EM>2`3</EM> (gets high part of the
|
|
multiplication), 6/3 (regular division), <EM>5%3</EM> (modulo/remainder of
|
|
the division).</P>
|
|
<P><U>4:addition/subtraction</U>:
|
|
<EM>1+3</EM> (addition), <EM>5-2</EM>
|
|
(subtraction).</P>
|
|
<P><U>5:left/right
|
|
shift</U>: <EM>1<<2</EM> (shift left, shl for unsigned, sal for
|
|
signed), <EM>10>>1</EM> (shift right, shl
|
|
for unsigned, sal for signed). </P>
|
|
<P><U>6:smaller (equal)/bigger (equal)</U>: 4<10, 3>6,
|
|
<EM>1<=2</EM>, <EM>6>=7</EM> (resolves to 1 if true,
|
|
0 if false).</P>
|
|
<P><U>7:equal/not equal</U>: <EM>1==1</EM>, <EM>2!=6</EM>
|
|
(resolves to 1 if true, 0 if
|
|
false).</P>
|
|
<P><U>8:binary and</U>: <EM>12&2</EM>
|
|
(regular binary
|
|
and).</P>
|
|
<P><U>9:binary xor</U>: <EM>2^1</EM>
|
|
(regular binary
|
|
xor).</P>
|
|
<P><U>10:binary or</U>: <EM>2|8</EM>
|
|
(regular binary
|
|
or).</P>
|
|
<P><U>11:logical and</U>: <EM>0&&3</EM>
|
|
(resolves to 1 if true, 0 if
|
|
false).</P>
|
|
<P><U>12:logical or</U>: <EM>0||3</EM>
|
|
(resolves to 1 if true, 0 if
|
|
false).</P>
|
|
<P><STRONG><U>Quick-Assigning<BR></U></STRONG>Changing memory, a
|
|
variable, register or flag can be easily done using a C-like
|
|
syntax:</P>
|
|
<P>a?= b: '?' can be any non-logical operator.
|
|
'a' can be any register, flag, variable or memory location. 'b' can be anything that is recognized as an
|
|
expression.</P>
|
|
<P>a++/a--: 'a' can be any register, flag, variable or memory
|
|
location.</P></body> |