forked from Treeki/Kamek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreproc_demo.cpp
60 lines (46 loc) · 862 Bytes
/
preproc_demo.cpp
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
#include "k_stdlib/kamek.h"
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x80123456, 0x99998888);
kmWrite32(0x23232323, "beep");
extern int foo();
int multiplier(int a, int b)
{
return a * b;
}
int foo_added()
{
return foo() + foo();
}
int namedFn(int value)
{
foo();
return value;
}
kmBranch(0x80B6C488, namedFn);
kmBranchDefCpp(0x80B6C488, NULL, int, int state)
{
foo();
foo();
foo();
return state;
}
kmBranchDefAsm(0x80B6C488, 0x80B6C48C)
{
li r5, 1;
}
extern "C" void baz();
asm void tryMe()
{
li r3, 1;
li r4, 2;
b baz;
}
kmWrite32(0x64646464, foo_added);
kmWrite32(0x90000000, tryMe);