Commit Graph

7 Commits

Author SHA1 Message Date
H. Peter Anvin
afa56016d4 insns.h: mark resb_bytes() const_func
Usually const_func doesn't matter for inlines, as the compiler can
"see" the innards of the function already, but it doesn't cost to mark
it as such.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-02 11:48:40 -07:00
H. Peter Anvin
7f419dff4e Merge tag 'nasm-2.13.01'
NASM 2.13.01

Resolved Conflicts:
2017-05-02 11:46:34 -07:00
H. Peter Anvin
7c99db15f0 insns.h: change ITEMPLATE_END to not warn on some compilers
The use of negative numbers for some fields in ITEMPLATE_END triggers
a nuisance warning at least with Sun CC.  There is no reason for it:
the only thing that matters in this template is I_none, so declare it
that way.

See BR 3392372.

Reported-by: <noloader@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 22:06:58 -07:00
H. Peter Anvin
2fbc727078 insns.h: db_bytes() should take an enum opcode
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 21:49:24 -07:00
H. Peter Anvin
af9fe8f597 Don't sort opcodes; move all pseudo-ops to the beginning
We don't need to sort opcodes anymore, since we are using an O(1) hash
and not binary search.  Instead, sort them in the order they first
appear in insns.dat; this lets us move all the pseudo-ops to a
contiguous range at the start of the file, for more efficient
handling.

Change the functions that process pseudo-ops accordingly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 21:44:24 -07:00
H. Peter Anvin
3e458a89d8 a) Fix handling of DZ/ZWORD; b) don't crash on TIMES JMP
a) Fix a number of missing instances of DZ and ZWORD.

b) NASM would crash if TIMES was used on an instruction which varies
   in size, e.g. JMP.  Fix this by moving the handling of TIMES at a
   higher level, so we generate the instruction "de novo" for each
   iteration.  The exception is INCBIN, so we can avoid reading the
   included file over and over.

c) When using the RESx instructions, just fold TIMES into the reserved
   space size; there is absolutely no point to iterate over it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-05-01 21:13:15 -07:00
H. Peter Anvin
e1f985c167 Reorganize the source code into subdirectories
Make the source code easier to understand and keep track of by
organizing it into subdirectories depending on the function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-25 12:06:29 -07:00