diff options
author | Jin Kyu Song <jin.kyu.song@intel.com> | 2013-11-20 15:32:52 -0800 |
---|---|---|
committer | Jin Kyu Song <jin.kyu.song@intel.com> | 2013-11-20 15:40:55 -0800 |
commit | 5f3bfee708deba146302df4bb33d081f496399c0 (patch) | |
tree | 948e7a4c7a4db0dd6b120e672ae9cc7552e7e686 /disp8.h | |
parent | 28d5bf811b02b4ffa61b4100df11bc0872ea84bf (diff) | |
download | nasm-5f3bfee708deba146302df4bb33d081f496399c0.tar.gz nasm-5f3bfee708deba146302df4bb33d081f496399c0.tar.bz2 nasm-5f3bfee708deba146302df4bb33d081f496399c0.zip |
disp8: Consolidate a logic to get compressed displacement
Consolidated two separate but similar functions in nasm and ndisasm
into a commonly linked source code.
To encode and decode the compressed displacement (disp8*N) for EVEX,
N value should be derived using various conditions.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Diffstat (limited to 'disp8.h')
-rw-r--r-- | disp8.h | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -0,0 +1,45 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 1996-2013 The NASM Authors - All Rights Reserved + * See the file AUTHORS included with the NASM distribution for + * the specific copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following + * conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ----------------------------------------------------------------------- */ + +/* + * disp8.h header file for disp8.c + */ + +#ifndef NASM_DISP8_H +#define NASM_DISP8_H + +#include "nasm.h" + +uint8_t get_disp8N(insn *ins); +bool is_disp8n(operand *input, insn *ins, int8_t *compdisp); +#endif /* NASM_DISP8_H */ |