diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-03-03 14:34:31 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-03-03 14:34:31 +0400 |
commit | 83e6924e1a583d432e9a54c68a59779da5d8ce3d (patch) | |
tree | 7b9747b563cce77bb2f20b524b529565d39617d6 /nasm.h | |
parent | bfb581c8e00f3b159cbb67c2235bce15c5b1713a (diff) | |
download | nasm-83e6924e1a583d432e9a54c68a59779da5d8ce3d.tar.gz nasm-83e6924e1a583d432e9a54c68a59779da5d8ce3d.tar.bz2 nasm-83e6924e1a583d432e9a54c68a59779da5d8ce3d.zip |
Move conditional opcodes close to enum ccode definition
Thus if someone need to rework this code he won't need
to jump between files trying to figure out where enum
and opcodes lay.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.h')
-rw-r--r-- | nasm.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -466,6 +466,17 @@ enum ccode { /* condition code names */ C_none = -1 }; +static inline uint8_t get_cond_opcode(enum ccode c) +{ + static const uint8_t ccode_opcodes[] = { + 0x7, 0x3, 0x2, 0x6, 0x2, 0x4, 0xf, 0xd, 0xc, 0xe, 0x6, 0x2, + 0x3, 0x7, 0x3, 0x5, 0xe, 0xc, 0xd, 0xf, 0x1, 0xb, 0x9, 0x5, + 0x0, 0xa, 0xa, 0xb, 0x8, 0x4 + }; + + return ccode_opcodes[(int)c]; +} + /* * REX flags */ |