Changeset 903
- Timestamp:
- 02/15/07 06:57:10 (2 years ago)
- Files:
-
- libemu/trunk/src/functions/jcc.c (modified) (34 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libemu/trunk/src/functions/jcc.c
r888 r903 7 7 #include "emu/emu_memory.h" 8 8 9 9 #define OF_IS_ONE(cpu) (CPU_FLAG_ISSET(cpu, f_of) != 0) 10 #define OF_IS_ZERO(cpu) (CPU_FLAG_ISSET(cpu, f_of) == 0) 11 #define OF_IS(cpu) (CPU_FLAG_ISSET(cpu, f_of)?1:0) 12 13 #define CF_IS_ONE(cpu) (CPU_FLAG_ISSET(cpu, f_cf) != 0) 14 #define CF_IS_ZERO(cpu) (CPU_FLAG_ISSET(cpu, f_cf) == 0) 15 16 #define ZF_IS_ONE(cpu) (CPU_FLAG_ISSET(cpu, f_zf) != 0) 17 #define ZF_IS_ZERO(cpu) (CPU_FLAG_ISSET(cpu, f_zf) == 0) 18 19 #define SF_IS_ONE(cpu) (CPU_FLAG_ISSET(cpu, f_sf) != 0) 20 #define SF_IS_ZERO(cpu) (CPU_FLAG_ISSET(cpu, f_sf) == 0) 21 #define SF_IS(cpu) (CPU_FLAG_ISSET(cpu, f_sf)?1:0) 22 23 #define PF_IS_ONE(cpu) (CPU_FLAG_ISSET(cpu, f_pf) != 0) 24 #define PF_IS_ZERO(cpu) (CPU_FLAG_ISSET(cpu, f_pf) == 0) 10 25 11 26 … … 13 28 { 14 29 /* 70 cb Jump short if overflow (OF=1) JO rel8 */ 30 if (OF_IS_ONE(c)) 31 { 32 33 } 15 34 return 0; 16 35 } … … 20 39 21 40 /* 71 cb Jump short if not overflow (OF=0) JNO rel8 */ 41 if (OF_IS_ZERO(c)) 42 { 43 44 } 22 45 return 0; 23 46 } … … 29 52 /* 72 cb Jump short if carry (CF=1) JC rel8 */ 30 53 /* 72 cb Jump short if not above or equal (CF=1) JNAE rel8 */ 54 if (CF_IS_ONE(c)) 55 { 56 57 } 31 58 return 0; 32 59 } … … 38 65 /* 73 cb Jump short if not below (CF=0) JNB rel8 */ 39 66 /* 73 cb Jump short if not carry (CF=0) JNC rel8 */ 40 67 if (CF_IS_ZERO(c)) 68 { 69 70 } 41 71 42 72 return 0; … … 48 78 /* 74 cb Jump short if equal (ZF=1) JE rel8 */ 49 79 /* 74 cb Jump short if zero (ZF = 1) JZ rel8 */ 50 80 if (ZF_IS_ONE(c)) 81 { 82 83 } 51 84 52 85 return 0; … … 58 91 /* 75 cb Jump short if not equal (ZF=0) JNE rel8 */ 59 92 /* 75 cb Jump short if not zero (ZF=0) JNZ rel8 */ 60 93 if (ZF_IS_ZERO(c)) 94 { 95 96 } 61 97 62 98 return 0; … … 68 104 /* 76 cb Jump short if below or equal (CF=1 or ZF=1) JBE rel8 */ 69 105 /* 76 cb Jump short if not above (CF=1 or ZF=1) JNA rel8 */ 70 106 if (CF_IS_ONE(c) || ZF_IS_ONE(c)) 107 { 108 109 } 71 110 72 111 return 0; … … 78 117 /* 77 cb Jump short if above (CF=0 and ZF=0) JA rel8 */ 79 118 /* 77 cb Jump short if not below or equal (CF=0 and ZF=0) JNBE rel8 */ 119 if (CF_IS_ZERO(c) && ZF_IS_ZERO(c)) 120 { 121 122 } 80 123 81 124 … … 87 130 88 131 /* 78 cb Jump short if sign (SF=1) JS rel8 */ 89 132 if (SF_IS_ONE(c)) 133 { 134 135 } 90 136 91 137 return 0; … … 96 142 97 143 /* 79 cb Jump short if not sign (SF=0) JNS rel8 */ 98 144 if (SF_IS_ZERO(c)) 145 { 146 147 } 99 148 100 149 return 0; … … 106 155 /* 7A cb Jump short if parity even (PF=1) JPE rel8 */ 107 156 /* 7A cb Jump short if parity (PF=1) JP rel8 */ 108 157 if (PF_IS_ONE(c)) 158 { 159 160 } 109 161 110 162 return 0; … … 116 168 /* 7B cb Jump short if not parity (PF=0) JNP rel8 */ 117 169 /* 7B cb Jump short if parity odd (PF=0) JPO rel8 */ 170 if (PF_IS_ZERO(c)) 171 { 172 173 } 118 174 119 175 … … 126 182 /* 7C cb Jump short if less (SF<>OF) JL rel8 */ 127 183 /* 7C cb Jump short if not greater or equal (SF<>OF) JNGE rel8 */ 184 if (SF_IS(c) != OF_IS(c)) 185 { 186 187 } 128 188 129 189 … … 136 196 /* 7D cb Jump short if greater or equal (SF=OF) JGE rel8 */ 137 197 /* 7D cb Jump short if not less (SF=OF) JNL rel8 */ 138 198 if (SF_IS(c) == OF_IS(c)) 199 { 200 201 } 139 202 140 203 return 0; … … 146 209 /* 7E cb Jump short if less or equal (ZF=1 or SF<>OF) JLE rel8 */ 147 210 /* 7E cb Jump short if not greater (ZF=1 or SF<>OF) JNG rel8 */ 211 if ( ZF_IS_ONE(c) || (SF_IS(c) != OF_IS(c))) 212 { 213 214 } 148 215 149 216 … … 156 223 /* 7F cb Jump short if greater (ZF=0 and SF=OF) JG rel8 */ 157 224 /* 7F cb Jump short if not less or equal (ZF=0 and SF=OF) JNLE rel8 */ 158 225 if ( ZF_IS_ONE(c) && (SF_IS(c) == OF_IS(c))) 226 { 227 228 } 159 229 160 230 return 0; … … 167 237 /* E3 cb Jump short if ECX register is 0 JECXZ rel8 */ 168 238 169 170 239 return 0; 171 240 } … … 175 244 176 245 /* 0F 80 cw/cd Jump near if overflow (OF=1) JO rel16/32 */ 177 246 if (OF_IS_ONE(c)) 247 { 248 249 } 178 250 179 251 return 0; … … 184 256 185 257 /* 0F 81 cw/cd Jump near if not overflow (OF=0) JNO rel16/32 */ 186 258 if (OF_IS_ZERO(c)) 259 { 260 261 } 187 262 188 263 return 0; … … 195 270 /* 0F 82 cw/cd Jump near if carry (CF=1) JC rel16/32 */ 196 271 /* 0F 82 cw/cd Jump near if not above or equal (CF=1) JNAE rel16/32 */ 197 272 if (CF_IS_ONE(c)) 273 { 274 275 } 198 276 199 277 return 0; … … 206 284 /* 0F 83 cw/cd Jump near if not below (CF=0) JNB rel16/32 */ 207 285 /* 0F 83 cw/cd Jump near if not carry (CF=0) JNC rel16/32 */ 208 286 if (CF_IS_ZERO(c)) 287 { 288 289 } 209 290 210 291 return 0; … … 216 297 /* 0F 84 cw/cd Jump near if equal (ZF=1) JE rel16/32 */ 217 298 /* 0F 84 cw/cd Jump near if zero (ZF=1) JZ rel16/32 */ 218 299 if (ZF_IS_ONE(c)) 300 { 301 302 } 219 303 220 304 return 0; … … 226 310 /* 0F 85 cw/cd Jump near if not equal (ZF=0) JNE rel16/32 */ 227 311 /* 0F 85 cw/cd Jump near if not zero (ZF=0) JNZ rel16/32 */ 228 312 if (ZF_IS_ZERO(c)) 313 { 314 315 } 229 316 230 317 return 0; … … 236 323 /* 0F 86 cw/cd Jump near if below or equal (CF=1 or ZF=1) JBE rel16/32 */ 237 324 /* 0F 86 cw/cd Jump near if not above (CF=1 or ZF=1) JNA rel16/32 */ 238 325 if (CF_IS_ONE(c) || ZF_IS_ONE(c)) 326 { 327 328 } 239 329 240 330 return 0; … … 246 336 /* 0F 87 cw/cd Jump near if above (CF=0 and ZF=0) JA rel16/32 */ 247 337 /* 0F 87 cw/cd Jump near if not below or equal (CF=0 and ZF=0) JNBE rel16/32 */ 248 338 if (CF_IS_ZERO(c) && ZF_IS_ZERO(c)) 339 { 340 341 } 342 249 343 250 344 return 0; … … 255 349 256 350 /* 0F 88 cw/cd Jump near if sign (SF=1) JS rel16/32 */ 257 351 if (SF_IS_ONE(c)) 352 { 353 354 } 258 355 259 356 return 0; … … 264 361 265 362 /* 0F 89 cw/cd Jump near if not sign (SF=0) JNS rel16/32 */ 266 363 if (SF_IS_ZERO(c)) 364 { 365 366 } 267 367 268 368 return 0; … … 274 374 /* 0F 8A cw/cd Jump near if parity even (PF=1) JPE rel16/32 */ 275 375 /* 0F 8A cw/cd Jump near if parity (PF=1) JP rel16/32 */ 276 376 if (PF_IS_ONE(c)) 377 { 378 379 } 277 380 278 381 return 0; … … 284 387 /* 0F 8B cw/cd Jump near if not parity (PF=0) JNP rel16/32 */ 285 388 /* 0F 8B cw/cd Jump near if parity odd (PF=0) JPO rel16/32 */ 286 389 if (PF_IS_ZERO(c)) 390 { 391 392 } 287 393 288 394 return 0; … … 294 400 /* 0F 8C cw/cd Jump near if less (SF<>OF) JL rel16/32 */ 295 401 /* 0F 8C cw/cd Jump near if not greater or equal (SF<>OF) JNGE rel16/32 */ 296 402 if (SF_IS(c) != OF_IS(c)) 403 { 404 405 } 297 406 298 407 return 0; … … 304 413 /* 0F 8D cw/cd Jump near if greater or equal (SF=OF) JGE rel16/32 */ 305 414 /* 0F 8D cw/cd Jump near if not less (SF=OF) JNL rel16/32 */ 306 415 if (SF_IS(c) == OF_IS(c)) 416 { 417 418 } 307 419 308 420 return 0; … … 314 426 /* 0F 8E cw/cd Jump near if less or equal (ZF=1 or SF<>OF) JLE rel16/32 */ 315 427 /* 0F 8E cw/cd Jump near if not greater (ZF=1 or SF<>OF) JNG rel16/32 */ 316 428 if (ZF_IS_ONE(c) || SF_IS(c) != OF_IS(c)) 429 { 430 431 } 317 432 318 433 return 0; … … 324 439 /* 0F 8F cw/cd Jump near if greater (ZF=0 and SF=OF) JG rel16/32 */ 325 440 /* 0F 8F cw/cd Jump near if not less or equal (ZF=0 and SF=OF) JNLE rel16/32 */ 326 327 328 return 0; 329 } 330 441 if (ZF_IS_ZERO(c) && SF_IS(c) == OF_IS(c)) 442 { 443 444 } 445 446 447 return 0; 448 } 449
