}
- case 0x0C: { /* OR AL, imm8 */
+ case 0x0C: { /* OR AL, imm8 */
uint8_t imm8 = fetch8 (cpu);
uint8_t al = get_reg8 (cpu, REG_AX);
}
- case 0x0D: { /* OR AX, imm16 */
+ case 0x0D: { /* OR AX, imm16 */
uint16_t imm16 = fetch16 (cpu); /* Fetch the 16-bit immediate value */
}
- case 0x19: { /* SBB r/m16, r16 */
+ case 0x19: { /* SBB r/m16, r16 */
uint8_t modrm = fetch8 (cpu);
OperandRef rm = decode_rm_operand (cpu, modrm);
}
- case 0x1A: { /* SBB r8, r/m8 */
+ case 0x1A: { /* SBB r8, r/m8 */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0x1B: { /* SBB r16, r/m16 */
+ case 0x1B: { /* SBB r16, r/m16 */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0x1C: { /* SBB AL, imm8 */
+ case 0x1C: { /* SBB AL, imm8 */
uint8_t imm8 = fetch8 (cpu);
uint8_t al = get_reg8 (cpu, 0);
}
- case 0x1D: { /* SBB AX, imm16 */
+ case 0x1D: { /* SBB AX, imm16 */
uint16_t imm16 = fetch16 (cpu);
break;
/* --- Segment Registers --- */
- case 0x06: /* PUSH ES */
+ case 0x06: /* PUSH ES */
push16 (cpu, cpu->es);
break;
- case 0x07: { /* POP ES */
+ case 0x07: { /* POP ES */
if (cpu_load_segment (cpu, 0, pop16 (cpu)) != 0) {
return -1;
}
- case 0x0E: /* PUSH CS */
+ case 0x0E: /* PUSH CS */
push16 (cpu, cpu->cs);
break;
OperandRef rm = decode_rm_operand (cpu, modrm);
- if (subop == 4) { /* SMSW r/m16 */
+ if (subop == 4) { /* SMSW r/m16 */
operand_write16 (cpu, &rm, (uint16_t) cpu->cr0);
- } else if (subop == 6) { /* LMSW r/m16 */
+ } else if (subop == 6) { /* LMSW r/m16 */
uint16_t value = operand_read16 (cpu, &rm);
uint32_t old_cr0 = cpu->cr0;
}
+ case 0xB2: { /* LSS r16/32, m16:16/32 */
+
+ uint8_t modrm = fetch8 (cpu);
+ int reg = (modrm >> 3) & 7;
+
+ OperandRef rm = decode_rm_operand (cpu, modrm);
+ OperandRef selector_ref = rm;
+
+ uint32_t offset;
+ uint16_t selector;
+
+ if (!rm.is_mem) {
+
+ fprintf (stderr, "LSS requires memory operand at %04X:%04X\n", cpu->cs, old_ip);
+ return -1;
+
+ }
+
+ offset = cpu->has_operand_override ? operand_read32 (cpu, &rm) : operand_read16 (cpu, &rm);
+
+ selector_ref.addr = cpu->has_addr_override ? rm.addr + (cpu->has_operand_override ? 4 : 2) : (uint16_t) (rm.addr + (cpu->has_operand_override ? 4 : 2));
+ selector = operand_read16 (cpu, &selector_ref);
+
+ if (cpu_load_segment (cpu, 2, selector) != 0) {
+ return -1;
+ }
+
+ trap_inhibit = 1;
+
+ if (cpu->has_operand_override) {
+ set_reg32 (cpu, reg, offset);
+ } else {
+ cpu->regs[reg] = (uint16_t) offset;
+ }
+
+ break;
+
+ }
+
case 0xB6: case 0xB7: case 0xBE: case 0xBF: {
uint8_t modrm = fetch8 (cpu);
break;
- case 0xAC: case 0xAD: { /* SHRD r/m16/32, r16/32, imm8/CL */
+ case 0xAC: case 0xAD: { /* SHRD r/m16/32, r16/32, imm8/CL */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0x15: { /* ADC AX, imm16 */
+ case 0x15: { /* ADC AX, imm16 */
uint16_t imm16 = fetch16 (cpu);
}
- case 0x16: /* PUSH SS */
+ case 0x16: /* PUSH SS */
push16 (cpu, cpu->ss);
break;
- case 0x17: /* POP SS */
+ case 0x17: /* POP SS */
if (cpu_load_segment (cpu, 2, pop16 (cpu)) != 0) {
return -1;
trap_inhibit = 1;
break;
- case 0x1E: /* PUSH DS */
+ case 0x1E: /* PUSH DS */
push16 (cpu, cpu->ds);
break;
- case 0x1F: /* POP DS */
+ case 0x1F: /* POP DS */
if (cpu_load_segment (cpu, 3, pop16 (cpu)) != 0) {
return -1;
aaa (cpu);
break;
- case 0x3C: { /* CMP AL, imm8 */
+ case 0x3C: { /* CMP AL, imm8 */
uint8_t imm8 = fetch8 (cpu);
uint8_t al = get_reg8 (cpu, REG_AX);
break;
- case 0x60: { /* PUSHA (80186+) */
+ case 0x60: { /* PUSHA (80186+) */
if (cpu->has_operand_override) {
}
- case 0x61: { /* POPA (Pop All - 80186+) */
+ case 0x61: { /* POPA (Pop All - 80186+) */
if (cpu->has_operand_override) {
}
- case 0x62: { /* BOUND r16, m16&16 */
+ case 0x62: { /* BOUND r16, m16&16 */
uint8_t modrm = fetch8 (cpu);
int reg_idx = (modrm >> 3) & 7;
}
- case 0x63: { /* ARPL r/m16, r16 (80286+ Protected Mode instruction) */
+ case 0x63: { /* ARPL r/m16, r16 (80286+ Protected Mode instruction) */
uint8_t modrm = fetch8 (cpu);
int reg_src = (modrm >> 3) & 7; /* The source register */
}
- case 0x6A: { /* PUSH imm8 (80186+) */
+ case 0x6A: { /* PUSH imm8 (80186+) */
/* Sign-extend the 8-bit immediate to 16-bits before pushing */
int16_t imm8 = (int8_t) fetch8 (cpu);
}
- case 0x84: { /* TEST r/m8, r8: */
+ case 0x84: { /* TEST r/m8, r8: */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0x8A: { /* MOV r8, r/m8 */
+ case 0x8A: { /* MOV r8, r/m8 */
uint8_t modrm = fetch8 (cpu);
}
- case 0x8C: { /* MOV r/m16, Sreg */
+ case 0x8C: { /* MOV r/m16, Sreg */
uint8_t modrm = fetch8 (cpu);
uint8_t sreg_idx = (modrm >> 3) & 0x07; /* ONLY 0–3 */
}
- case 0x8D: { /* LEA r16, m */
+ case 0x8D: { /* LEA r16, m */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0x8E: { /* MOV Sreg, r/m16 */
+ case 0x8E: { /* MOV Sreg, r/m16 */
uint8_t modrm = fetch8 (cpu);
int sreg = (modrm >> 3) & 7;
}
- case 0x90: /* NOP (XCHG AX, AX) */
+ case 0x90: /* NOP (XCHG AX, AX) */
break;
}
- case 0x98: { /* CBW - Convert Byte to Word */
+ case 0x98: { /* CBW - Convert Byte to Word */
/* Sign-extend AL into AX */
if (cpu->regs[REG_AX] & 0x80) {
}
- case 0x99: /* CWD - Convert Word to Doubleword */
+ case 0x99: /* CWD - Convert Word to Doubleword */
if (cpu->regs[REG_AX] & 0x8000) {
cpu->regs[REG_DX] = 0xFFFF;
}
- case 0x9C: /* PUSHF (Push Flags onto Stack) */
+ case 0x9C: /* PUSHF (Push Flags onto Stack) */
if (cpu->has_operand_override) {
push32 (cpu, (cpu->eflags_high & 0x003F0000UL) | cpu->flags);
break;
- case 0x9D: { /* POPF */
+ case 0x9D: { /* POPF */
uint32_t f = cpu->has_operand_override ? pop32 (cpu) : pop16 (cpu);
}
- case 0x9E: { /* SAHF */
+ case 0x9E: { /* SAHF */
uint8_t ah = get_reg8 (cpu, 4);
cpu->flags &= ~(FLAG_CF | FLAG_PF | FLAG_AF | FLAG_ZF | FLAG_SF);
cpu->flags |= FLAG_SF;
}
- cpu->flags |= 0x0002; /* bit 1 always set */
+ cpu->flags |= 0x0002; /* bit 1 always set */
break;
}
- case 0x9F: { /* LAHF */
+ case 0x9F: { /* LAHF */
- uint8_t ah = 0x02; /* bit 1 always set */
+ uint8_t ah = 0x02; /* bit 1 always set */
if (cpu->flags & FLAG_CF) {
ah |= 0x01;
}
- case 0xA4: { /* MOVSB */
+ case 0xA4: { /* MOVSB */
unsigned src_index = cpu->has_seg_override ? cpu->seg_override_index : 3;
}
- case 0xA5: { /* MOVSW / MOVSD */
+ case 0xA5: { /* MOVSW / MOVSD */
unsigned src_index = cpu->has_seg_override ? cpu->seg_override_index : 3;
}
- case 0xA6: { /* CMPSB */
+ case 0xA6: { /* CMPSB */
uint16_t src_seg = cpu->has_seg_override ? cpu->seg_override : cpu->ds;
int step = (cpu->flags & FLAG_DF) ? -1 : 1;
}
- case 0xA7: { /* CMPSW */
+ case 0xA7: { /* CMPSW */
uint16_t src_seg = cpu->has_seg_override ? cpu->seg_override : cpu->ds;
int step = (cpu->flags & FLAG_DF) ? -2 : 2;
}
- case 0xA8: { /* TEST AL, imm8 */
+ case 0xA8: { /* TEST AL, imm8 */
uint8_t imm8 = fetch8 (cpu);
}
- case 0xA9: { /* TEST AX, imm16 */
+ case 0xA9: { /* TEST AX, imm16 */
uint16_t imm16 = fetch16 (cpu);
}
- case 0xAA: { /* STOSB */
+ case 0xAA: { /* STOSB */
int step = (cpu->flags & FLAG_DF) ? -1 : 1;
uint8_t value = get_al (cpu);
}
- case 0xAB: { /* STOSW / STOSD */
+ case 0xAB: { /* STOSW / STOSD */
unsigned size = cpu->has_operand_override ? 4 : 2;
int step = (cpu->flags & FLAG_DF) ? -(int) size : (int) size;
}
- case 0xAE: { /* SCASB */
+ case 0xAE: { /* SCASB */
int step = (cpu->flags & FLAG_DF) ? -1 : 1;
uint8_t al = get_al (cpu);
}
- case 0xAF: { /* SCASW */
+ case 0xAF: { /* SCASW */
int step = (cpu->flags & FLAG_DF) ? -2 : 2;
break;
- case 0xC0: { /*8-bit shift/Rotate by imm8 (80186+) */
+ case 0xC0: { /*8-bit shift/Rotate by imm8 (80186+) */
uint8_t modrm = fetch8 (cpu), result;
int subop = (modrm >> 3) & 7;
}
- case 0xC1: { /*16-bit shift/Rotate by imm8 (80186+) */
+ case 0xC1: { /* 16-bit shift/Rotate by imm8 (80186+) */
if (cpu->has_operand_override) {
}
- } else if (subop == 7) { /* SAR r/m32, imm8 */
+ } else if (subop == 7) { /* SAR r/m32, imm8 */
result = (uint32_t) ((int32_t) value >> count);
switch (subop) {
- case 0: { /* ROL */
+ case 0: { /* ROL */
for (int i = 0; i < count; i++) {
}
- case 1: { /* ROR */
+ case 1: { /* ROR */
for (int i = 0; i < count; i++) {
}
- case 2: { /* RCL */
+ case 2: { /* RCL */
for (int i = 0; i < count; i++) {
}
- case 3: { /* RCR */
+ case 3: { /* RCR */
for (int i = 0; i < count; i++) {
}
- case 4: { /* SHL / SAL */
+ case 4: { /* SHL / SAL */
if (count > 16) {
}
- case 5: { /* SHR */
+ case 5: { /* SHR */
if (count > 16) {
}
- case 7: { /* SAR */
+ case 7: { /* SAR */
if (count > 16) {
}
- case 0xC2: { /* RET imm16 */
+ case 0xC2: { /* RET imm16 */
uint16_t add_sp = fetch16 (cpu);
uint32_t new_ip = cpu->has_operand_override ? pop32 (cpu) : pop16 (cpu);
}
- case 0xC3: { /* RET near */
+ case 0xC3: { /* RET near */
cpu->ip = cpu->has_operand_override ? pop32 (cpu) : pop16 (cpu);
break;
}
- case 0xC4: { /* LES r16, m16:16 */
+ case 0xC4: { /* LES r16, m16:16 */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0xC5: { /* LDS r16, m16:16 */
+ case 0xC5: { /* LDS r16, m16:16 */
uint8_t modrm = fetch8 (cpu);
int reg = (modrm >> 3) & 7;
}
- case 0xC8: { /* ENTER imm16, imm8 (80186+) */
+ case 0xC8: { /* ENTER imm16, imm8 (80186+) */
uint16_t size = fetch16 (cpu);
unsigned level = fetch8 (cpu) & 0x1F;
}
- case 0xC9: /* LEAVE */
+ case 0xC9: /* LEAVE */
if (cpu->has_operand_override) {
break;
- case 0xCA: { /* RETF imm16 */
+ case 0xCA: { /* RETF imm16 */
uint16_t add_sp = fetch16 (cpu);
}
- case 0xCD: { /* INT imm8 */
+ case 0xCD: { /* INT imm8 */
uint8_t inum = fetch8 (cpu);
}
- case 0xCC: { /* INT 3 (Breakpoint) */
+ case 0xCC: { /* INT 3 (Breakpoint) */
if (cpu->cr0 & 1) {
}
- case 0xCE: { /* INTO (Interrupt on Overflow) */
+ case 0xCE: { /* INTO (Interrupt on Overflow) */
if (cpu->flags & FLAG_OF) {
handle_interrupt (cpu, 4);
}
- case 0xD4: { /* AAM imm8 */
+ case 0xD4: { /* AAM imm8 */
uint8_t base = fetch8 (cpu);
uint8_t al = get_al (cpu);
}
- case 6: /* PUSH r/m16/32 */
+ case 6: /* PUSH r/m16/32 */
if (cpu->has_operand_override) {
push32 (cpu, operand_read32 (cpu, &rm));
}
- case 0xD0: { /*8-bit shift/Rotate by 1 */
+ case 0xD0: { /*8-bit shift/Rotate by 1 */
uint8_t modrm = fetch8 (cpu);
int subop = (modrm >> 3) & 7;
}
- case 0xD1: { /* shift/Rotate by 1 */
+ case 0xD1: { /* shift/Rotate by 1 */
uint8_t modrm = fetch8 (cpu);
int subop = (modrm >> 3) & 7;
switch (subop) {
- case 0: /* ROL */
+ case 0: /* ROL */
result = (value << 1) | (value >> 31);
break;
- case 1: /* ROR */
+ case 1: /* ROR */
result = (value >> 1) | (value << 31);
break;
- case 2: /* RCL */
+ case 2: /* RCL */
result = (value << 1) | old_cf;
break;
- case 3: /* RCR */
+ case 3: /* RCR */
result = (value >> 1) | ((uint32_t) old_cf << 31);
break;
- case 4: /* SHL / SAL */
+ case 4: /* SHL / SAL */
result = value << 1;
update_common_flags32 (cpu, result);
break;
- case 5: /* SHR */
+ case 5: /* SHR */
result = value >> 1;
update_common_flags32 (cpu, result);
break;
- case 7: /* SAR */
+ case 7: /* SAR */
result = (uint32_t) ((int32_t) value >> 1);
switch (subop) {
- case 0: /* ROL (Rotate Left) */
+ case 0: /* ROL (Rotate Left) */
result = (val << 1) | (val >> 15);
break;
- case 1: /* ROR (Rotate Right) */
+ case 1: /* ROR (Rotate Right) */
result = (val >> 1) | (val << 15);
break;
- case 2: /* RCL (Rotate through Carry Left) */
+ case 2: /* RCL (Rotate through Carry Left) */
result = (val << 1) | old_cf;
break;
- case 3: /* RCR (Rotate through Carry Right) */
+ case 3: /* RCR (Rotate through Carry Right) */
result = (val >> 1) | ((uint16_t) old_cf << 15);
break;
- case 4: /* SHL / SAL */
+ case 4: /* SHL / SAL */
result = val << 1;
update_common_flags16 (cpu, result);
break;
- case 5: /* SHR */
+ case 5: /* SHR */
result = val >> 1;
update_common_flags16 (cpu, result);
break;
- case 7: /* SAR */
+ case 7: /* SAR */
result = (uint16_t) ((int16_t) val >> 1);
}
- case 0xD2: { /*8-bit shift/Rotate by CL */
+ case 0xD2: { /* 8-bit shift/Rotate by CL */
uint8_t modrm = fetch8 (cpu), result;
int subop = (modrm >> 3) & 7;
}
- case 0xD7: { /* XLAT */
+ case 0xD7: { /* XLAT */
uint16_t index = (uint16_t) (cpu->regs[REG_BX] + get_reg8 (cpu, REG_AX));
uint16_t seg = cpu->has_seg_override ? cpu->seg_override : cpu->ds;
}
- case 0xE0: { /* LOOPNE / LOOPNZ */
+ case 0xE0: { /* LOOPNE / LOOPNZ */
int8_t rel = (int8_t) fetch8 (cpu);
}
- case 0xE1: { /* LOOPE / LOOPZ */
+ case 0xE1: { /* LOOPE / LOOPZ */
int8_t rel = (int8_t) fetch8 (cpu);
}
- case 0xE2: { /* LOOP */
+ case 0xE2: { /* LOOP */
int8_t rel = (int8_t) fetch8 (cpu);
}
- case 0xE3: { /* JCXZ */
+ case 0xE3: { /* JCXZ */
int8_t rel = (int8_t) fetch8 (cpu);
}
- case 0xE4: { /* IN AL, imm8 */
+ case 0xE4: { /* IN AL, imm8 */
uint8_t port = fetch8 (cpu);
set_reg8 (cpu, 0, io_read8 (cpu, port));
}
- case 0xE5: { /* IN AX, imm8 */
+ case 0xE5: { /* IN AX, imm8 */
uint8_t port = fetch8 (cpu);
cpu->regs[REG_AX] = io_read16 (cpu, port);
}
- case 0xE6: { /* OUT imm8, AL */
+ case 0xE6: { /* OUT imm8, AL */
uint8_t port = fetch8 (cpu);
io_write8 (cpu, port, get_reg8 (cpu, 0));
}
- case 0xE7: { /* OUT imm8, AX */
+ case 0xE7: { /* OUT imm8, AX */
uint8_t port = fetch8 (cpu);
io_write16 (cpu, port, cpu->regs[REG_AX]);
}
- case 0xEC: { /* IN AL, DX */
+ case 0xEC: { /* IN AL, DX */
uint16_t port = cpu->regs[REG_DX];
set_reg8 (cpu, 0, io_read8 (cpu, port));
}
- case 0xED: { /* IN AX, DX */
+ case 0xED: { /* IN AX, DX */
uint16_t port = cpu->regs[REG_DX];
cpu->regs[REG_AX] = io_read16 (cpu, port);
}
- case 0xEE: { /* OUT DX, AL */
+ case 0xEE: { /* OUT DX, AL */
io_write8 (cpu, cpu->regs[REG_DX], get_reg8 (cpu, 0));
break;
}
- case 0xEF: { /* OUT DX, AX */
+ case 0xEF: { /* OUT DX, AX */
io_write16 (cpu, cpu->regs[REG_DX], cpu->regs[REG_AX]);
break;
}
- case 0xF0: /* LOCK prefix */
+ case 0xF0: /* LOCK prefix */
goto fetch_instruction;
- case 0xF2: /* REPNZ */
+ case 0xF2: /* REPNZ */
cpu->rep_type = 2;
goto fetch_instruction;
- case 0xF3: /* REP / REPE */
+ case 0xF3: /* REP / REPE */
cpu->rep_type = 1;
goto fetch_instruction;
}
- if (op == 0xF6) { /*8-bit Operations */
+ if (op == 0xF6) { /* 8-bit Operations */
switch (subop) {
break;
}
- case 2: /* NOT rm8 */
+ case 2: /* NOT rm8 */
operand_write8 (cpu, &rm, ~operand_read8 (cpu, &rm));
break;
- case 3: /* NEG rm8 */
+ case 3: /* NEG rm8 */
operand_write8 (cpu, &rm, sub8 (cpu, 0, operand_read8 (cpu, &rm)));
break;
- case 4: { /* MUL rm8 (AL * rm8 -> AX) */
+ case 4: { /* MUL rm8 (AL * rm8 -> AX) */
uint8_t src = operand_read8 (cpu, &rm);
uint16_t res = (uint16_t) get_reg8 (cpu, 0) * (uint16_t) src; /* 0 = AL */
}
- case 5: { /* IMUL rm8 (AL * rm8 -> AX) */
+ case 5: { /* IMUL rm8 (AL * rm8 -> AX) */
int8_t src = (int8_t) operand_read8 (cpu, &rm);
int16_t res = (int16_t) (int8_t) get_reg8 (cpu, 0) * (int16_t) src;
}
- case 6: { /* DIV rm8 (AX / rm8) */
+ case 6: { /* DIV rm8 (AX / rm8) */
uint16_t dividend, quotient, remainder;
uint8_t divisor = operand_read8 (cpu, &rm);
}
- } else { /*0xF7: 16-bit Operations */
+ } else { /* 0xF7: 16-bit Operations */
switch (subop) {
and16 (cpu, operand_read16 (cpu, &rm), fetch16 (cpu));
break;
- case 2: /* NOT rm16 */
+ case 2: /* NOT rm16 */
operand_write16 (cpu, &rm, ~operand_read16 (cpu, &rm));
break;
- case 3: /* NEG rm16 */
+ case 3: /* NEG rm16 */
operand_write16 (cpu, &rm, sub16 (cpu, 0, operand_read16 (cpu, &rm)));
break;
- case 4: { /* MUL rm16 (AX * rm16 -> DX:AX) */
+ case 4: { /* MUL rm16 (AX * rm16 -> DX:AX) */
uint16_t src = operand_read16 (cpu, &rm);
uint32_t res = (uint32_t) cpu->regs[REG_AX] * (uint32_t) src;
}
- case 5: { /* IMUL rm16 (AX * rm16 -> DX:AX) */
+ case 5: { /* IMUL rm16 (AX * rm16 -> DX:AX) */
int16_t src = (int16_t) operand_read16 (cpu, &rm);
int32_t res = (int32_t) (int16_t) cpu->regs[REG_AX] * (int32_t) src;
}
- case 6: { /* DIV rm16 (Unsigned DX:AX / rm16) */
+ case 6: { /* DIV rm16 (Unsigned DX:AX / rm16) */
uint32_t dividend, quotient, remainder;
uint16_t divisor = operand_read16 (cpu, &rm);
}
- case 7: { /* IDIV rm16 (Signed DX:AX / rm16) */
+ case 7: { /* IDIV rm16 (Signed DX:AX / rm16) */
int32_t dividend, quotient, remainder;
int16_t divisor = (int16_t) operand_read16 (cpu, &rm);
}
- case 0xF8: /* CLC (Clear Carry Flag) */
+ case 0xF8: /* CLC (Clear Carry Flag) */
cpu->flags &= (uint16_t) ~FLAG_CF;
break;
- case 0xF9: /* STC (Set Carry Flag) */
+ case 0xF9: /* STC (Set Carry Flag) */
cpu->flags |= FLAG_CF;
break;
- case 0xF5: /* CMC (Complement Carry Flag) */
+ case 0xF5: /* CMC (Complement Carry Flag) */
cpu->flags ^= FLAG_CF;
break;
}
- case 0xFC: /* CLD (Clear Direction Flag) */
+ case 0xFC: /* CLD (Clear Direction Flag) */
cpu->flags &= (uint16_t) ~FLAG_DF;
break;
- case 0xFD: /* STD (Set Direction Flag) */
+ case 0xFD: /* STD (Set Direction Flag) */
cpu->flags |= FLAG_DF;
break;