diff options
author | somov <somov@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
commit | a5950576e397b1909261050b8c7da16db58f10b1 (patch) | |
tree | 7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /contrib/tools/yasm/modules/arch/lc3b/lc3barch.h | |
parent | 81eddc8c0b55990194e112b02d127b87d54164a9 (diff) | |
download | ydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz |
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/yasm/modules/arch/lc3b/lc3barch.h')
-rw-r--r-- | contrib/tools/yasm/modules/arch/lc3b/lc3barch.h | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/contrib/tools/yasm/modules/arch/lc3b/lc3barch.h b/contrib/tools/yasm/modules/arch/lc3b/lc3barch.h index 9ded8cbef7..745dffc335 100644 --- a/contrib/tools/yasm/modules/arch/lc3b/lc3barch.h +++ b/contrib/tools/yasm/modules/arch/lc3b/lc3barch.h @@ -1,70 +1,70 @@ -/* - * LC-3b Architecture header file - * - * Copyright (C) 2003-2007 Peter Johnson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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 AUTHOR AND OTHER 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 AUTHOR OR OTHER 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. - */ -#ifndef YASM_LC3BARCH_H -#define YASM_LC3BARCH_H - -/* Types of immediate. All immediates are stored in the LSBs of the insn. */ -typedef enum lc3b_imm_type { - LC3B_IMM_NONE = 0, /* no immediate */ - LC3B_IMM_4, /* 4-bit */ - LC3B_IMM_5, /* 5-bit */ - LC3B_IMM_6_WORD, /* 6-bit, word-multiple (byte>>1) */ - LC3B_IMM_6_BYTE, /* 6-bit, byte-multiple */ - LC3B_IMM_8, /* 8-bit, word-multiple (byte>>1) */ - LC3B_IMM_9, /* 9-bit, signed, word-multiple (byte>>1) */ - LC3B_IMM_9_PC /* 9-bit, signed, word-multiple, PC relative */ -} lc3b_imm_type; - -/* Bytecode types */ - -typedef struct lc3b_insn { - yasm_value imm; /* immediate or relative value */ - lc3b_imm_type imm_type; /* size of the immediate */ - - unsigned int opcode; /* opcode */ -} lc3b_insn; - -void yasm_lc3b__bc_transform_insn(yasm_bytecode *bc, lc3b_insn *insn); - -yasm_arch_insnprefix yasm_lc3b__parse_check_insnprefix - (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, - /*@out@*/ /*@only@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); -yasm_arch_regtmod yasm_lc3b__parse_check_regtmod - (yasm_arch *arch, const char *id, size_t id_len, - /*@out@*/ uintptr_t *data); - -int yasm_lc3b__intnum_tobytes - (yasm_arch *arch, const yasm_intnum *intn, unsigned char *buf, - size_t destsize, size_t valsize, int shift, const yasm_bytecode *bc, - int warn); - -/*@only@*/ yasm_bytecode *yasm_lc3b__create_empty_insn(yasm_arch *arch, - unsigned long line); - -void yasm_lc3b__ea_destroy(/*@only@*/ yasm_effaddr *ea); - -#endif +/* + * LC-3b Architecture header file + * + * Copyright (C) 2003-2007 Peter Johnson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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 AUTHOR AND OTHER 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 AUTHOR OR OTHER 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. + */ +#ifndef YASM_LC3BARCH_H +#define YASM_LC3BARCH_H + +/* Types of immediate. All immediates are stored in the LSBs of the insn. */ +typedef enum lc3b_imm_type { + LC3B_IMM_NONE = 0, /* no immediate */ + LC3B_IMM_4, /* 4-bit */ + LC3B_IMM_5, /* 5-bit */ + LC3B_IMM_6_WORD, /* 6-bit, word-multiple (byte>>1) */ + LC3B_IMM_6_BYTE, /* 6-bit, byte-multiple */ + LC3B_IMM_8, /* 8-bit, word-multiple (byte>>1) */ + LC3B_IMM_9, /* 9-bit, signed, word-multiple (byte>>1) */ + LC3B_IMM_9_PC /* 9-bit, signed, word-multiple, PC relative */ +} lc3b_imm_type; + +/* Bytecode types */ + +typedef struct lc3b_insn { + yasm_value imm; /* immediate or relative value */ + lc3b_imm_type imm_type; /* size of the immediate */ + + unsigned int opcode; /* opcode */ +} lc3b_insn; + +void yasm_lc3b__bc_transform_insn(yasm_bytecode *bc, lc3b_insn *insn); + +yasm_arch_insnprefix yasm_lc3b__parse_check_insnprefix + (yasm_arch *arch, const char *id, size_t id_len, unsigned long line, + /*@out@*/ /*@only@*/ yasm_bytecode **bc, /*@out@*/ uintptr_t *prefix); +yasm_arch_regtmod yasm_lc3b__parse_check_regtmod + (yasm_arch *arch, const char *id, size_t id_len, + /*@out@*/ uintptr_t *data); + +int yasm_lc3b__intnum_tobytes + (yasm_arch *arch, const yasm_intnum *intn, unsigned char *buf, + size_t destsize, size_t valsize, int shift, const yasm_bytecode *bc, + int warn); + +/*@only@*/ yasm_bytecode *yasm_lc3b__create_empty_insn(yasm_arch *arch, + unsigned long line); + +void yasm_lc3b__ea_destroy(/*@only@*/ yasm_effaddr *ea); + +#endif |