C Programming Cheatsheet Page 4

ADVERTISEMENT

C Programming Cheatsheet
> - Autoincrement addressing memory
Trigraphs
Digraphs
long long int
at least 64-bits
[-
operand
922337203685
??= #
<:
[
4775808,
r - General register
922337203685
??/
\
:>
]
i - Immediate integer operand (constant)
4775807]
n - Immediate integer operand (static constant)
??'
^
<% {
[0,
I-P - Machine-dependent immediate integers
184467440737
??(
[
%> }
E - Immediate float operand
09551615]
??)
]
%: #
F - Immediate double or vector operand
int128_t
128-bits
[-
G, H - Machine-dependent float-operand
??!
|
170141183460
s - Non-explicit immediate integer
469231731687
??< {
303715884105
g - Register, memory, or immediate integer
728,
??> }
operand
170141183460
X - Any operand
??- ~
469231731687
0-9 - Specific operand (i.e. r12)
303715884105
Inline Assembly
p - Memory address operand
727]
asm [volatile] (
Inline x86 Assembly Modifiers
uint128_t
128-bits
[0,
{ dialect0 | dialect1 | dialect2... }
R - Legacy register
340282366920
: OutputOperands
q - Any register accessible as rl
938463463374
[ : InputOperands [ : Clobbers ] ]
Q - Any register accessible as rh
607431768211
); // Supported x86 dialects - ("att", "intel")
a - The a register
456]
b - The b register
Floating-Point Datatypes
c - The c register
asm [volatile] goto (
Type
Size
Exponent Significand
d - The d register
{ dialect0 | dialect1 | dialect2... }
S - The si register
float
32-bits
8
24
: InputOperands
D - The di register
: Clobbers
double
64-bits
11
53
A - The a & d registers
: GotoLabels
f - Any 80387 floating-point (stack) register
long double
80-bits
15
64
); // volatile disables some optimizations
t - Top of 80387 floating-point stack (%st(0))
Quadruple
128-bits
15
113
u - %st(1)
y - Any MMX register
Specify the assembler name for data: int
Octuple
256-bits
19
237
x - Any SSE register
var_name asm ("asm_name") = 2;
Yz - First SSE register (%xmm0)
decimal32
32-bits
6
25
Specify the assembler name for functions: int
I - Integer constant in the range 0-31, for 32-bit shifts
decimal64
64-bits
8
55
func(int x, int y) asm ("asm_func");
J - Integer constant in the range 0-63, for 64-bit shifts
K - Signed 8-bit integer constant
decimal128 128-bits
12
115
uint32_t Mask = 1234;
L - 0xFF or 0xFFFF, for andsi as a zero-extending
NOTE: The number of significand bits is implicit
move
uint32_t Index;
Powers of Two
M - 0, 1, 2, or 3 (shifts for the lea instruction)
asm ("bsfl %1, %0;"
2^X Value
N - Unsigned 8-bit integer constant (for in and out
: "=r"(Index)
instructions)
: "r"(Mask)
0
1
G - Standard 80387 floating point constant
: "cc");
1
2
C - SSE constant zero operand
Clobber Arguments
e - 32-bit signed integer constant, or a symbolic
2
4
cc - Indicates that the assembler code modifies the
reference known to fit that range (for immediate operands
flags register
3
8
in sign-extending x86-64 instructions)
memory - Informs the compiler that the assembly
Z - 32-bit unsigned integer constant, or a symbolic
4
16
code performs memory reads or writes to items
reference known to fit that range (for immediate operands
other than those listed in the input and output
in zero-extending x86-64 instructions)
5
32
operands
Inline Assembly Modifiers
6
64
Constraints.html
= - Write
Datatype Limits
7
128
+ - Read & write
char
Smallest
[-128, 127]
8
256
& - Early clobber read & write
addressable unit
[0, 255]
9
512
% - Commutative; Only read-only operands
short int
at least 16-bits
[-32768,
can use "%"
10
1024
32767]
# - Ignored as a constraint
[0, 65535]
11
2048
* - Ignored as a register preference
int
at least 16-bits
[-32768,
12
4096
? - Slightly disparage constraint
32767]
! - Severely disparage constraint
[0, 65535]
13
8192
^ - Like "?", but only if operand needs reload
14
16384
long int
at least 32-bits
[-2147483648,
$ - Like "!", but only if operand needs reload
2147483647]
15
32768
m - Memory operand
[0,
o - Offsetable memory operand
4294967295]
16
65536
V - Non-offsetable memory operand
< - Autodecrement addressing memory
operand
Created by Devyn Collier Johnson <DevynCJohnson@Gmail.com> (2017) More cheatsheets at DCJTech.info

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4