Newer
Older
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
#include "cpu/exec.h"
#include "cpu/cc.h"
make_EHelper(jmp) {
// the target address is calculated at the decode stage
rtl_j(decoding.jmp_eip);
print_asm("jmp %x", decoding.jmp_eip);
}
make_EHelper(jcc) {
// the target address is calculated at the decode stage
uint32_t cc = decoding.opcode & 0xf;
rtl_setcc(&t0, cc);
rtl_li(&t1, 0);
rtl_jrelop(RELOP_NE, &t0, &t1, decoding.jmp_eip);
print_asm("j%s %x", get_cc_name(cc), decoding.jmp_eip);
}
make_EHelper(jmp_rm) {
rtl_jr(&id_dest->val);
print_asm("jmp *%s", id_dest->str);
}
make_EHelper(call) {
// the target address is calculated at the decode stage
TODO();
print_asm("call %x", decoding.jmp_eip);
}
make_EHelper(ret) {
TODO();
print_asm("ret");
}
make_EHelper(call_rm) {
TODO();
print_asm("call *%s", id_dest->str);
}