4 * Copyright (C) 2003, 2004 Jonathan Campbell <jcampbell@mdjk.com>
6 * Decompiler and executioneer for CLC/CLD/CLI/CMC/STC/STD/STI instructions.
8 ***********************************************************************************
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 ************************************************************************************/
30 #include "drooling_duh.h"
32 int Sfx86OpcodeExec_clx(sx86_ubyte opcode
,softx86_ctx
* ctx
)
34 if (opcode
== 0xF5) { // CMC
35 ctx
->state
->reg_flags
.val
^= SX86_CPUFLAG_CARRY
;
39 if (opcode
== 0xF8) { // CLC
40 ctx
->state
->reg_flags
.val
&= ~SX86_CPUFLAG_CARRY
;
44 if (opcode
== 0xF9) { // STC
45 ctx
->state
->reg_flags
.val
|= SX86_CPUFLAG_CARRY
;
49 if (opcode
== 0xFA) { // CLI
50 ctx
->state
->reg_flags
.val
&= ~SX86_CPUFLAG_INTENABLE
;
54 if (opcode
== 0xFB) { // STI
55 ctx
->state
->reg_flags
.val
|= SX86_CPUFLAG_INTENABLE
;
59 if (opcode
== 0xFC) { // CLD
60 ctx
->state
->reg_flags
.val
&= ~SX86_CPUFLAG_DIRECTIONREV
;
64 if (opcode
== 0xFD) { // STD
65 ctx
->state
->reg_flags
.val
|= SX86_CPUFLAG_DIRECTIONREV
;
72 int Sfx86OpcodeDec_clx(sx86_ubyte opcode
,softx86_ctx
* ctx
,char buf
[128])
74 if (opcode
== 0xF5) { // CMC
79 if (opcode
== 0xF8) { // CLC
84 if (opcode
== 0xF9) { // STC
89 if (opcode
== 0xFA) { // CLI
94 if (opcode
== 0xFB) { // STI
99 if (opcode
== 0xFC) { // CLD
104 if (opcode
== 0xFD) { // STD