]> Shamusworld >> Repos - rmac/blobdiff - rmac.h
Various small fixes and additions to the 680x0 parts:
[rmac] / rmac.h
diff --git a/rmac.h b/rmac.h
index bba14d71b29bda02c06117f8e2831d10fe010877..8e4e295e68874ae947734aea590e700604c35f36 100644 (file)
--- a/rmac.h
+++ b/rmac.h
 // Byteswap crap
 #define BYTESWAP16(x) ((((x) & 0x00FF) << 8) | (((x) & 0xFF00) >> 8))
 #define BYTESWAP32(x) ((((x) & 0x000000FF) << 24) | (((x) & 0x0000FF00) << 8) | (((x) & 0x00FF0000) >> 8) | (((x) & 0xFF000000) >> 24))
-#define BYTESWAP64(x) (BYTESWAP32(x>>32)|BYTESWAP32((x&0xffffffff)<<32))
+#define BYTESWAP64(x) ((BYTESWAP32(x >> 32) | (BYTESWAP32(x & 0xFFFFFFFF) << 32)))
 #define WORDSWAP32(x) ((((x) & 0x0000FFFF) << 16) | (((x) & 0xFFFF0000) >> 16))
 
 //
@@ -177,24 +177,18 @@ XEX,                              // COM/EXE/XEX/whatever a8 object format
 // Assembler token
 #define TOKEN  uint32_t
 
-// Token pointer type is a union because we have 64-bit sized tokens now :-P
-#define TOKENPTR union _tokenptr
-TOKENPTR
-{
-       uint32_t * u32;
-       uint64_t * u64;
-};
-
 // Pointer type that can point to (almost) anything
 #define PTR union _ptr
 PTR
 {
-       uint8_t *  cp;                          // Char
-       uint16_t * wp;                          // WORD
-       uint32_t * lp;                          // LONG
-       uint32_t   lw;                          // LONG
-       SYM **     sy;                          // SYM
-       TOKENPTR   tk;                          // TOKEN
+       uint8_t *  cp;                          // Char pointer
+       uint16_t * wp;                          // WORD pointer
+       uint32_t * lp;                          // LONG pointer
+       uint32_t * u32;                         // 32-bit pointer
+       uint64_t * u64;                         // 64-bit pointer
+       uint32_t   lw;                          // LONG (for some reason)
+       SYM **     sy;                          // SYM pointer
+       TOKEN *    tk;                          // TOKEN pointer
 };
 
 // Symbol spaces
@@ -272,6 +266,8 @@ enum
        OPT_INDIRECT_DISP = 3,
        OPT_LEA_ADDQ      = 4,
        OPT_BASE_DISP     = 5,
+       OPT_NULL_BRA      = 6,
+       OPT_CLR_DX        = 7,
        OPT_COUNT   // Dummy, used to count number of optimisation switches
 };