wok diff 8086tiny/stuff/8086tiny.u @ rev 24902
Update some web_site
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Apr 09 09:39:20 2022 +0000 (2022-04-09) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/8086tiny/stuff/8086tiny.u Sat Apr 09 09:39:20 2022 +0000 1.3 @@ -0,0 +1,40 @@ 1.4 +--- 8086tiny.c 1.5 ++++ 8086tiny.c 1.6 +@@ -112,8 +112,9 @@ 1.7 + regs16[REG_AX] = op_result, \ 1.8 + set_OF(set_CF(op_result - (op_data_type)op_result))) 1.9 + #define DIV_MACRO(out_data_type,in_data_type,out_regs) (scratch_int = CAST(out_data_type)mem[rm_addr]) && !(scratch2_uint = (in_data_type)(scratch_uint = (out_regs[i_w+1] << 16) + regs16[REG_AX]) / scratch_int, scratch2_uint - (out_data_type)scratch2_uint) ? out_regs[i_w+1] = scratch_uint - scratch_int * (*out_regs = scratch2_uint) : pc_interrupt(0) 1.10 +-#define DAA_DAS(op1,op2,mask,min) set_AF((((scratch2_uint = regs8[REG_AL]) & 0x0F) > 9) || regs8[FLAG_AF]) && (op_result = regs8[REG_AL] op1 6, set_CF(regs8[FLAG_CF] || (regs8[REG_AL] op2 scratch2_uint))), \ 1.11 +- set_CF((((mask & 1 ? scratch2_uint : regs8[REG_AL]) & mask) > min) || regs8[FLAG_CF]) && (op_result = regs8[REG_AL] op1 0x60) 1.12 ++#define DAA_DAS(op1,op2) \ 1.13 ++set_AF((((scratch_uchar = regs8[REG_AL]) & 0x0F) > 9) || regs8[FLAG_AF]) && (op_result = (regs8[REG_AL] op1 6), set_CF(regs8[FLAG_CF] || (regs8[REG_AL] op2 scratch_uchar))), \ 1.14 ++set_CF((regs8[REG_AL] > 0x9f) || regs8[FLAG_CF]) && (op_result = (regs8[REG_AL] op1 0x60)) 1.15 + #define ADC_SBB_MACRO(a) OP(a##= regs8[FLAG_CF] +), \ 1.16 + set_CF(regs8[FLAG_CF] && (op_result == op_dest) || (a op_result < a(int)op_dest)), \ 1.17 + set_AF_OF_arith() 1.18 +@@ -451,7 +452,6 @@ 1.19 + OPCODE 12: // ROL|ROR|RCL|RCR|SHL|SHR|???|SAR reg/mem, 1/CL/imm (80186) 1.20 + scratch2_uint = SIGN_OF(mem[rm_addr]), 1.21 + scratch_uint = extra ? // xxx reg/mem, imm 1.22 +- ++reg_ip, 1.23 + (char)i_data1 1.24 + : // xxx reg/mem, CL 1.25 + i_d 1.26 +@@ -468,7 +468,7 @@ 1.27 + else // Rotate/shift left operations 1.28 + R_M_OP(mem[rm_addr], <<=, scratch_uint); 1.29 + if (i_reg > 3) // Shift operations 1.30 +- set_opcode(0x10); // Decode like ADC 1.31 ++ set_flags_type = FLAGS_UPDATE_SZP; // Shift instructions affect SZP 1.32 + if (i_reg > 4) // SHR or SAR 1.33 + set_CF(op_dest >> (scratch_uint - 1) & 1); 1.34 + } 1.35 +@@ -605,7 +605,7 @@ 1.36 + rep_override_en && rep_override_en++ 1.37 + OPCODE 28: // DAA/DAS 1.38 + i_w = 0; 1.39 +- extra ? DAA_DAS(-=, >=, 0xFF, 0x99) : DAA_DAS(+=, <, 0xF0, 0x90) // extra = 0 for DAA, 1 for DAS 1.40 ++ if (extra) DAA_DAS(-=, >); else DAA_DAS(+=, <) 1.41 + OPCODE 29: // AAA/AAS 1.42 + op_result = AAA_AAS(extra - 1) 1.43 + OPCODE 30: // CBW