~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/asm-common.h: Add an `IMM' macro for immediate operands.
[catacomb]
/
base
/
asm-common.h
diff --git
a/base/asm-common.h
b/base/asm-common.h
index
040250b
..
3ef0de9
100644
(file)
--- a/
base/asm-common.h
+++ b/
base/asm-common.h
@@
-286,17
+286,26
@@
name:
# define _DECOR_mem_q(addr) qword ptr addr
#endif
# define _DECOR_mem_q(addr) qword ptr addr
#endif
+#define _DECOR_imm_b(imm) byte imm
+#define _DECOR_imm_w(imm) word imm
+#define _DECOR_imm_d(imm) dword imm
+#if CPUFAM_AMD64
+# define _DECOR_imm_q(imm) qword imm
+#endif
+
#if CPUFAM_X86
# define _DECOR_abcd_r(reg) e##reg##x
# define _DECOR_xp_r(reg) e##reg
# define _DECOR_ip_r(reg) e##reg
# define _DECOR_mem_r(addr) dword ptr addr
#if CPUFAM_X86
# define _DECOR_abcd_r(reg) e##reg##x
# define _DECOR_xp_r(reg) e##reg
# define _DECOR_ip_r(reg) e##reg
# define _DECOR_mem_r(addr) dword ptr addr
+# define _DECOR_imm_r(imm) dword imm
#endif
#if CPUFAM_AMD64
# define _DECOR_abcd_r(reg) r##reg##x
# define _DECOR_xp_r(reg) r##reg
# define _DECOR_ip_r(reg) r##reg
# define _DECOR_mem_r(addr) qword ptr addr
#endif
#if CPUFAM_AMD64
# define _DECOR_abcd_r(reg) r##reg##x
# define _DECOR_xp_r(reg) r##reg
# define _DECOR_ip_r(reg) r##reg
# define _DECOR_mem_r(addr) qword ptr addr
+# define _DECOR_imm_r(imm) qword imm
#endif
// R_r(decor) applies decoration decor to register r, which is an internal
#endif
// R_r(decor) applies decoration decor to register r, which is an internal
@@
-326,6
+335,9
@@
name:
// address addr (which should supply its own square-brackets).
#define MEM(decor, addr) _DECOR(mem, decor, addr)
// address addr (which should supply its own square-brackets).
#define MEM(decor, addr) _DECOR(mem, decor, addr)
+// Refer to an immediate datum of the type implied by decor.
+#define IMM(decor, imm) _DECOR(mem, decor, imm)
+
// Applies decoration decor to assembler-level register name reg.
#define _REGFORM(reg, decor) _GLUE(_REGFORM_, reg)(decor)
// Applies decoration decor to assembler-level register name reg.
#define _REGFORM(reg, decor) _GLUE(_REGFORM_, reg)(decor)