2020-09-05 16:51:10 +00:00
|
|
|
/* ReC98
|
|
|
|
* -----
|
|
|
|
* Macros to help decompiling the seemingly impossible
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Flag comparisons
|
|
|
|
// ----------------
|
|
|
|
// When used inside a conditional expression like
|
|
|
|
// if(FLAGS_*) { goto some_label; | return; }
|
2020-09-05 17:03:48 +00:00
|
|
|
// these assemble into the single given instruction. Apply the ! operator to
|
|
|
|
// get the N versions.
|
2020-09-05 16:51:10 +00:00
|
|
|
#define FLAGS_ZERO (_FLAGS & 0x40) /* JZ */
|
|
|
|
// ----------------
|
2020-09-11 23:51:37 +00:00
|
|
|
|
|
|
|
// Alternate version that sets the value first
|
|
|
|
#define OUTW2(port, val) __asm { \
|
|
|
|
mov ax, val; \
|
|
|
|
mov dx, port; \
|
|
|
|
out dx, ax; \
|
|
|
|
}
|