summaryrefslogtreecommitdiff
path: root/nasm.h
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-07-25 11:09:56 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-07-25 11:09:56 +0400
commita38b86aecff04de02f56d84aabe8eef9baee5959 (patch)
treec6379bd9b7498020428726c059394428d6be4958 /nasm.h
parent2124b7b7dcecd8b68465cf8deca35f46cf17d705 (diff)
downloadnasm-a38b86aecff04de02f56d84aabe8eef9baee5959.tar.gz
move is_register helper to nasm.h
H. Peter Anvin noted: | | Could we avoid putting static code that has no dynamic content in | dynamically generated files... it just complicates things unnecessarily. | | The above can move into nasm.h for example. | Good idea. CC: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.h')
-rw-r--r--nasm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/nasm.h b/nasm.h
index 7ff19027..cbd9462f 100644
--- a/nasm.h
+++ b/nasm.h
@@ -421,6 +421,12 @@ enum {
/* Register names automatically generated from regs.dat */
#include "regs.h"
+/* verify value to be register */
+static inline int is_register(int reg)
+{
+ return reg >= EXPR_REG_START && reg < REG_ENUM_LIMIT;
+}
+
enum ccode { /* condition code names */
C_A, C_AE, C_B, C_BE, C_C, C_E, C_G, C_GE, C_L, C_LE, C_NA, C_NAE,
C_NB, C_NBE, C_NC, C_NE, C_NG, C_NGE, C_NL, C_NLE, C_NO, C_NP,