Debian Codegraph @

src/cpu/core_full/save.h

raw symbols SCIP
1 /* Write the data from the opcode */
2 switch (inst.code.save) {
3 /* Byte */
4 case S_C_Eb:
5 inst_op1_b=inst.cond ? 1 : 0;
6 case S_Eb:
7 if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b);
8 else reg_8(inst.rm_eai)=inst_op1_b;
9 break;
10 case S_Gb:
11 reg_8(inst.rm_index)=inst_op1_b;
12 break;
13 case S_EbGb:
14 if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b);
15 else reg_8(inst.rm_eai)=inst_op1_b;
16 reg_8(inst.rm_index)=inst_op2_b;
17 break;
18 /* Word */
19 case S_Ew:
20 if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w);
21 else reg_16(inst.rm_eai)=inst_op1_w;
22 break;
23 case S_Gw:
24 reg_16(inst.rm_index)=inst_op1_w;
25 break;
26 case S_EwGw:
27 if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w);
28 else reg_16(inst.rm_eai)=inst_op1_w;
29 reg_16(inst.rm_index)=inst_op2_w;
30 break;
31 /* Dword */
32 case S_Ed:
33 if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d);
34 else reg_32(inst.rm_eai)=inst_op1_d;
35 break;
36 case S_EdMw: /* Special one 16 to memory, 32 zero extend to reg */
37 if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w);
38 else reg_32(inst.rm_eai)=inst_op1_d;
39 break;
40 case S_Gd:
41 reg_32(inst.rm_index)=inst_op1_d;
42 break;
43 case S_EdGd:
44 if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d);
45 else reg_32(inst.rm_eai)=inst_op1_d;
46 reg_32(inst.rm_index)=inst_op2_d;
47 break;
48
49 case S_REGb:
50 reg_8(inst.code.extra)=inst_op1_b;
51 break;
52 case S_REGw:
53 reg_16(inst.code.extra)=inst_op1_w;
54 break;
55 case S_REGd:
56 reg_32(inst.code.extra)=inst_op1_d;
57 break;
58 case S_SEGm:
59 if (CPU_SetSegGeneral((SegNames)inst.rm_index,inst_op1_w)) RunException();
60 break;
61 case S_SEGGw:
62 if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException();
63 reg_16(inst.rm_index)=inst_op1_w;
64 break;
65 case S_SEGGd:
66 if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException();
67 reg_32(inst.rm_index)=inst_op1_d;
68 break;
69 case S_PUSHw:
70 Push_16(inst_op1_w);
71 break;
72 case S_PUSHd:
73 Push_32(inst_op1_d);
74 break;
75
76 case S_C_AIPw:
77 if (!inst.cond) goto nextopcode;
78 case S_AIPw:
79 SaveIP();
80 reg_eip+=inst_op1_d;
81 reg_eip&=0xffff;
82 continue;
83 case S_C_AIPd:
84 if (!inst.cond) goto nextopcode;
85 case S_AIPd:
86 SaveIP();
87 reg_eip+=inst_op1_d;
88 continue;
89 case S_IPIw:
90 reg_esp+=Fetchw();
91 case S_IP:
92 SaveIP();
93 reg_eip=inst_op1_d;
94 continue;
95 case 0:
96 break;
97 default:
98 LOG(LOG_CPU,LOG_ERROR)("SAVE:Unhandled code %d entry %X",inst.code.save,inst.entry);
99 }