Move directive processing to its own file, and move nasmlib/error.c to
asm/error.c (it was not used by the disassembler); remove some extern
declarations from .c files, and do some general code cleanups.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Remove casts in switch statements that were intended to keep
OpenWatcom happy. It didn't work, and now we have a more general
solution for the problem, which also ought to be less dangerous.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
There is absolutely no reason to call reloc_value() twice while
processing an immediate. Doing so is both expensive and unnecessary.
Make some more deliberate decorations to try to avoid miscompilation
on OpenWatcom, but I'm not sure this will help enough.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Handle, hopefully correctly, self-relative expressions (that is,
expressions of the form X - Y where Y is a symbol in the current
segment, possibly $ or $$) used as offsets or immediates, as opposed
to arguments to Dx statements (which have already been supported for a
while.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
fixes pvs-studio error 'V707 Giving short names to global variables
is considered to be bad practice. It is suggested to rename 'i' variable.
gorcunov@: Simply define it as local variable.
Signed-off-by: Martin Lindhe <martin-commit@ubique.se>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Instead of using hacks or compiler-specific features, if we have
standard features as defined in ISO C11, use them.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Allow constructs like:
dd foo - $
... where foo is an external symbol. Currently this is only
implemented for extops, i.e. dx opcodes.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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>