From 2d5a0b2cbf01a773c15a9331cabd697646bc27f6 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 22 Jun 2018 11:33:39 -0500 Subject: [PATCH] last time i will start wolf3d core port after exam on thursday --- src/lib/16_head.c | 12 ++++++---- src/lib/16_head.h | 58 +++++++++++++++++++++++------------------------ 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/lib/16_head.c b/src/lib/16_head.c index cda97037..c5a5d3cf 100755 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -216,7 +216,7 @@ void hres (void) } } -#define REGIDUMP_HEX +//#define REGIDUMP_HEX #define REGIDUMP_DUMPFLAGS //#define REGIDUMP_USE_CAPS //uncomment to use the assembly //regester dump~ @@ -319,14 +319,16 @@ _dl=_DL; #ifndef REGIDUMP_HEX // printf(" ip=%04u\n\n", _IP); // printf(" cf=%04u\npf=%04u\naf=%04u\nzf=%04u\nsf=%04u\ntf=%04u\nif=%04u\ndf=%04u\nof=%04u\n", _CF, _PF, _AF, _ZF, _SF, _TF, _IF, _DF, _OF); + + printf("cflag: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_cflag>>8), BYTE_TO_BINARY(_cflag)); #else // printf(" ip=%04x\n\n", _IP); // printf(" cf=%04x\npf=%04x\naf=%04x\nzf=%04x\nsf=%04x\ntf=%04x\nif=%04x\ndf=%04x\nof=%04x\n", _CF, _PF, _AF, _ZF, _SF, _TF, _IF, _DF, _OF); - printf("cflag: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_cflag>>8), BYTE_TO_BINARY(_cflag)); -// printf("cflag: %s\n",(_cflag)); + printf("cflag: %016x\n",(_cflag)); #endif - printf("dx: "NIBBLE_TO_BINARY_PATTERN""NIBBLE_TO_BINARY_PATTERN"\n", NIBBLE_TO_BINARY(_dx>>4), NIBBLE_TO_BINARY(_dx)); - printf("dx: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_dx>>8), BYTE_TO_BINARY(_dx)); + printf("testing\n"); +// printf("dx: "NIBBLE_TO_BINARY_PATTERN""NIBBLE_TO_BINARY_PATTERN"\n", NIBBLE_TO_BINARY(_dx>>4), NIBBLE_TO_BINARY(_dx)); +// printf("dx: "BYTE_TO_BINARY_PATTERN""BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(_dx>>8), BYTE_TO_BINARY(_dx)); printf("dx: "WORD_TO_BINARY_PATTERN"\n", WORD_TO_BINARY(_dx)); printf(" ---------------------------------------\n"); #endif diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 3b0322b0..c0559438 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -207,44 +207,44 @@ void regidump(); //For multi-byte types //printf("m: "BYTE_TO_BINARY_PATTERN" "BYTE_TO_BINARY_PATTERN"\n", BYTE_TO_BINARY(m>>8), BYTE_TO_BINARY(m)); #define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" -#define BYTE_TO_BINARY(byte) \ - (byte & 0x80 ? '1' : '0'), \ - (byte & 0x40 ? '1' : '0'), \ - (byte & 0x20 ? '1' : '0'), \ - (byte & 0x10 ? '1' : '0'), \ - (byte & 0x08 ? '1' : '0'), \ - (byte & 0x04 ? '1' : '0'), \ - (byte & 0x02 ? '1' : '0'), \ +#define BYTE_TO_BINARY(byte) \ + (byte & 0x80 ? '1' : '0'), \ + (byte & 0x40 ? '1' : '0'), \ + (byte & 0x20 ? '1' : '0'), \ + (byte & 0x10 ? '1' : '0'), \ + (byte & 0x08 ? '1' : '0'), \ + (byte & 0x04 ? '1' : '0'), \ + (byte & 0x02 ? '1' : '0'), \ (byte & 0x01 ? '1' : '0') #define WORD_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c" -#define WORD_TO_BINARY(word) \ - (word & 0x8000 ? '1' : '0'), \ - (word & 0x4000 ? '1' : '0'), \ - (word & 0x2000 ? '1' : '0'), \ - (word & 0x1000 ? '1' : '0'), \ - (word & 0x0800 ? '1' : '0'), \ - (word & 0x0400 ? '1' : '0'), \ - (word & 0x0200 ? '1' : '0'), \ - (word & 0x0100 ? '1' : '0'), \ - (word & 0x0080 ? '1' : '0'), \ - (word & 0x0040 ? '1' : '0'), \ - (word & 0x0020 ? '1' : '0'), \ - (word & 0x0010 ? '1' : '0'), \ - (word & 0x0008 ? '1' : '0'), \ - (word & 0x0004 ? '1' : '0'), \ - (word & 0x0002 ? '1' : '0'), \ +#define WORD_TO_BINARY(word) \ + (word & 0x8000 ? '1' : '0'), \ + (word & 0x4000 ? '1' : '0'), \ + (word & 0x2000 ? '1' : '0'), \ + (word & 0x1000 ? '1' : '0'), \ + (word & 0x0800 ? '1' : '0'), \ + (word & 0x0400 ? '1' : '0'), \ + (word & 0x0200 ? '1' : '0'), \ + (word & 0x0100 ? '1' : '0'), \ + (word & 0x0080 ? '1' : '0'), \ + (word & 0x0040 ? '1' : '0'), \ + (word & 0x0020 ? '1' : '0'), \ + (word & 0x0010 ? '1' : '0'), \ + (word & 0x0008 ? '1' : '0'), \ + (word & 0x0004 ? '1' : '0'), \ + (word & 0x0002 ? '1' : '0'), \ (word & 0x0001 ? '1' : '0') #define NIBBLE_TO_BINARY_PATTERN "%c%c%c%c" -#define NIBBLE_TO_BINARY(nibble) \ - (nibble & 0x08 ? '1' : '0'), \ - (nibble & 0x04 ? '1' : '0'), \ - (nibble & 0x02 ? '1' : '0'), \ +#define NIBBLE_TO_BINARY(nibble) \ + (nibble & 0x08 ? '1' : '0'), \ + (nibble & 0x04 ? '1' : '0'), \ + (nibble & 0x02 ? '1' : '0'), \ (nibble & 0x01 ? '1' : '0') #define BOOLEAN_TO_BINARY_PATTERN "%c" -#define BOOLEAN_TO_BINARY(boolean) \ +#define BOOLEAN_TO_BINARY(boolean) \ (boolean & 0x01 ? '1' : '0') #define PRINT_OPAQUE_STRUCT(p) print_mem((p), sizeof(*(p))) -- 2.39.5