Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
stackframe.cpp
Go to the documentation of this file.
1
#define XBYAK_NO_OP_NAMES
2
#include <
xbyak/xbyak_util.h
>
3
4
#ifdef XBYAK32
5
#error "this sample is for only 64-bit mode"
6
#endif
7
8
struct
Code
:
public
Xbyak::CodeGenerator
{
9
Code
()
10
{
11
// see xbyak/sample/sf_test.cpp for how to use other parameter
12
Xbyak::util::StackFrame sf(
this
, 3);
13
mov
(rax, sf.p[0]);
14
add
(rax, sf.p[1]);
15
add
(rax, sf.p[2]);
16
}
17
};
18
19
int
main
()
20
{
21
Code
c;
22
int (*
f
)(int, int, int) = c.
getCode
<
int
(*) (int, int, int)>();
23
int
ret
=
f
(3, 5, 2);
24
if
(
ret
== 3 + 5 + 2) {
25
puts(
"ok"
);
26
}
else
{
27
puts(
"ng"
);
28
}
29
}
f
foo f
Definition
X02-DisabledMacros.cpp:25
Xbyak::CodeArray::getCode
const uint8 * getCode() const
Definition
xbyak.h:905
Xbyak::CodeGenerator
Definition
xbyak.h:1339
Xbyak::CodeGenerator::add
void add(const Operand &op, uint32 imm)
Definition
xbyak.h:6
Xbyak::CodeGenerator::mov
void mov(const Operand ®1, const Operand ®2)
Definition
xbyak.h:2210
main
int main()
Definition
stackframe.cpp:19
Code
Definition
bench.cpp:18
Code::Code
Code()
Definition
stackframe.cpp:9
xbyak_util.h
ret
CK_RV ret
Definition
yubihsm_pkcs11.c:973
libraries
fc
libraries
ff
depends
xbyak
sample
stackframe.cpp
Generated by
1.12.0