]> granicus.if.org Git - yasm/log
yasm
21 years agoAdd support for the AMD64 syntax [symbol wrt rip]. This is distinct from
Peter Johnson [Sun, 3 Aug 2003 21:13:20 +0000 (21:13 -0000)]
Add support for the AMD64 syntax [symbol wrt rip].  This is distinct from
[rip+symbol] in that the latter adds the symbol offset to rip, whereas the
former is the same as [symbol] but uses rip-relative addressing.  This is
a minor overload of the WRT operator, but reads well and shouldn't conflict
with the use of WRT against sections.

Doing this currently adds a bit of overhead to all effective addresses in
64-bit mode (a $ symbol reference).  This is the cleanest approach I could
figure out; a time/space trade could be made later, such as prescanning for
RIP usage before allocating the symbol.

svn path=/trunk/yasm/; revision=1032

21 years agoAdd yasm_expr_extract_wrt() to separate portions of WRT expression.
Peter Johnson [Sun, 3 Aug 2003 21:06:15 +0000 (21:06 -0000)]
Add yasm_expr_extract_wrt() to separate portions of WRT expression.

svn path=/trunk/yasm/; revision=1031

21 years agoELF objfmt size agnosticism:
Michael Urman [Sun, 3 Aug 2003 01:13:14 +0000 (01:13 -0000)]
ELF objfmt size agnosticism:
* Replace ulongs secthead.size, secthead.align, reloc.addr with intnums
* Calculate relocation size with intnums
* Create macros YASM_WRITE_32I_L, YASM_WRITE_64I_L to write 32/64bit
  intnums to buffer
This doesn't quite cover everything, particularly due to various calls
to yasm_intnum_get_uint for various bits of processing, but it's close!

Miscellany:
* Fix non-call to elf_reloc_delete()
* Remove unused secthead.addr, secthead_set_addr
* Create macro YASM_WRITE_64Z_L to write zero-extended 32bit value to
  64bits of buffer

svn path=/trunk/yasm/; revision=1030

21 years agoMove elf relocation valsize handling to the backend.
Michael Urman [Sat, 2 Aug 2003 21:50:42 +0000 (21:50 -0000)]
Move elf relocation valsize handling to the backend.
Add elf x86 test case to verify it works properly.
Unsure about elf x86-64 status (relocations segfault my objdump), but
 it's no *worse* than last commit.

svn path=/trunk/yasm/; revision=1029

21 years agoContinue adding AMD64 ELF support (without breaking x86!):
Michael Urman [Sat, 2 Aug 2003 20:32:42 +0000 (20:32 -0000)]
Continue adding AMD64 ELF support (without breaking x86!):
Move more machine-specific items to the backend (EHDR_SIZE) and make it
 target machine-dependent there.
Theoretically everything except relocations may work, but since builds
 of amd64 with bits=32 can segfault objdump, don't trust it.
Work to support relocations is next; perhaps then it can be tested.

svn path=/trunk/yasm/; revision=1028

21 years agoFix parsing of WRT operator (it takes two operands, not one).
Peter Johnson [Sat, 2 Aug 2003 19:46:22 +0000 (19:46 -0000)]
Fix parsing of WRT operator (it takes two operands, not one).

svn path=/trunk/yasm/; revision=1027

21 years agoAdd Elf64 constants to elf.h
Michael Urman [Sat, 2 Aug 2003 17:45:53 +0000 (17:45 -0000)]
Add Elf64 constants to elf.h
Add elf_set_arch function to tell elf backend the machine, allow to deny.
Move arch/machine checking into backend.

svn path=/trunk/yasm/; revision=1026

21 years agoHide 386-specific constants from non-internal use.
Michael Urman [Sat, 2 Aug 2003 17:23:48 +0000 (17:23 -0000)]
Hide 386-specific constants from non-internal use.
Change interface of elf_reloc_entry_new() to allow this.

svn path=/trunk/yasm/; revision=1025

21 years agoImplement global constants in elf. Add test to ensure they work; modify
Michael Urman [Sat, 2 Aug 2003 03:43:41 +0000 (03:43 -0000)]
Implement global constants in elf.  Add test to ensure they work; modify
another test such that linked together they verify that
1. It links properly
2. The constant is loaded properly
3. The function is called properly
shown (probably not proved) by the program exiting with error level 0.

svn path=/trunk/yasm/; revision=1024

21 years agoActually use provided relocation type, instead of feeble-minded guessing.
Michael Urman [Sat, 2 Aug 2003 03:31:13 +0000 (03:31 -0000)]
Actually use provided relocation type, instead of feeble-minded guessing.
Add test case that centers on relocations; update test case that uses them.

svn path=/trunk/yasm/; revision=1023

21 years agoFix iretq, stosq, etc, which were properly setting the opersize but the REX
Peter Johnson [Fri, 1 Aug 2003 03:52:35 +0000 (03:52 -0000)]
Fix iretq, stosq, etc, which were properly setting the opersize but the REX
generation code wasn't seeing it because it wasn't looking at the modified
opersize.

Bug noticed by: Antoine Leca <antoine64leca@unknown> (x86-64 discuss ML)

svn path=/trunk/yasm/; revision=1022

21 years agoAdd versioning to all loadable module interfaces. The version is checked by
Peter Johnson [Wed, 30 Jul 2003 04:36:29 +0000 (04:36 -0000)]
Add versioning to all loadable module interfaces.  The version is checked by
module users to ensure the module interface they're using matches the
interface the module was compiled with.  The #define YASM_module_VERSION
should be incremented on every functional change to the module interface.

svn path=/trunk/yasm/; revision=1021

21 years agoAdd core pieces for "machine" subtype of "architecture". Needed to
Peter Johnson [Tue, 29 Jul 2003 03:19:12 +0000 (03:19 -0000)]
Add core pieces for "machine" subtype of "architecture".  Needed to
differentiate e.g. AMD64 from x86.  Doesn't prohibit anything in x86 yet,
but does standardize unsupported warnings across objfmts (most objfmts will
not support all machines and/or all architectures).

svn path=/trunk/yasm/; revision=1020

21 years agoRemove check for lex/flex; we no longer have any lex files.
Peter Johnson [Sat, 26 Jul 2003 03:49:57 +0000 (03:49 -0000)]
Remove check for lex/flex; we no longer have any lex files.

svn path=/trunk/yasm/; revision=1019

21 years agoFixed some conversion warnings caused by intnum commit. Missed these due to
Peter Johnson [Sat, 26 Jul 2003 02:32:04 +0000 (02:32 -0000)]
Fixed some conversion warnings caused by intnum commit.  Missed these due to
use of configure.ac's --enable-warnerror, which was set up to disable
conversion errors due to flex's warning-prone generated code.  As we no
longer use flex, fix configure.ac to not disable conversion errors.

svn path=/trunk/yasm/; revision=1018

21 years agoBig output_expr(), intnum_tobytes(), and floatnum_tobytes() changes:
Peter Johnson [Fri, 25 Jul 2003 03:27:21 +0000 (03:27 -0000)]
Big output_expr(), intnum_tobytes(), and floatnum_tobytes() changes:
 - Switch to bit-based output, including shift capability
 - This means the standard intnum output functions can be used for non-byte
   oriented archs like LC-3b (implemented)
 - Default out of range (overflow) warnings for intnum (bugzilla bug 14)
 - Change floating point overflow/underflow errors to warnings
To do (hooks but not implemented):
 - Shifting floatnums into destination
 - Floatnum destinations larger than floatnum value
 - Big endian support for intnum and floatnum
Related simultaneous changes:
 - Use bc instead of ep in objfmt output_expr() functions; while bc->line
   should == (*ep)->line, in case they differ, we want to use the bc->line
   so as not to confuse users.
 - lc3b-mp22NC test was not properly offsetting the accessed variables, but
   since the variable "sections" started at an aligned offset, the output
   was actually correct.  The new intnum warnings uncovered this issue, so
   fix code to be correct (and not generate warnings).

svn path=/trunk/yasm/; revision=1017

21 years agoWhen changing a section start into a start-based expression, use the
Peter Johnson [Fri, 25 Jul 2003 02:17:30 +0000 (02:17 -0000)]
When changing a section start into a start-based expression, use the
expression line number instead of the start line number (which may be 0,
which isn't nearly as useful as the expression line number).

svn path=/trunk/yasm/; revision=1016

21 years agoReplace preliminary elf header files with...
Michael Urman [Thu, 24 Jul 2003 04:38:37 +0000 (04:38 -0000)]
Replace preliminary elf header files with...

ELF objfmt implementation.

Assumed to be correct for the test cases, but only tested as far as feasible.
Currently only implements 32bit 386 little-endian, but is mostly abstracted
well enough to easily add more machines.

svn path=/trunk/yasm/; revision=1015

21 years agoActually return the basename from our basename() replacement.
Peter Johnson [Wed, 23 Jul 2003 02:48:13 +0000 (02:48 -0000)]
Actually return the basename from our basename() replacement.

svn path=/trunk/yasm/; revision=1014

21 years agoEnhance return values for yasm_x86__expr_checkea() to fully represent the
Peter Johnson [Sat, 19 Jul 2003 17:53:34 +0000 (17:53 -0000)]
Enhance return values for yasm_x86__expr_checkea() to fully represent the
three possible return states (okay, invalid, or indeterminate).  Propagate
this return change into the yasm_x86__expr_checkea() call tree as necessary.

svn path=/trunk/yasm/; revision=1013

21 years agoFix bad assumption in x86_expr_checkea_getregusage() that was causing bad code,
Peter Johnson [Sat, 19 Jul 2003 17:28:10 +0000 (17:28 -0000)]
Fix bad assumption in x86_expr_checkea_getregusage() that was causing bad code,
internal errors, and mis-optimization as seen in Bugzilla Bug 13.
Reported by: meor@softhome.net

Fix a few minor bugs (not heavily tested) due to use of opersize == 32 as a
comparison; this fails when opersize == 64 due to bits = 64, but the default
size is still 4 bytes, not 2.

There's still a couple cases here where we might end up with internal errors
due to a lack of variety in return values; I'll fix those in the next commit.

svn path=/trunk/yasm/; revision=1012

21 years agoCall/jmp far immediate single-byte instructions are invalid in 64-bit mode.
Peter Johnson [Sat, 19 Jul 2003 16:51:38 +0000 (16:51 -0000)]
Call/jmp far immediate single-byte instructions are invalid in 64-bit mode.

svn path=/trunk/yasm/; revision=1011

21 years agoyasm_intnum_is_zero(), yasm_intnum_is_pos1(): Don't need to check if bitvect,
Peter Johnson [Thu, 17 Jul 2003 02:25:25 +0000 (02:25 -0000)]
yasm_intnum_is_zero(), yasm_intnum_is_pos1(): Don't need to check if bitvect,
all <32 bit positive numbers are collapsed into ul form.
yasm_intnum_is_neg1(): fix bug which would equate 0xffffffff as -1.

svn path=/trunk/yasm/; revision=1010

21 years agoFix bug in edge case of expr_level_op(): single intnum in expression with
Peter Johnson [Wed, 16 Jul 2003 04:55:07 +0000 (04:55 -0000)]
Fix bug in edge case of expr_level_op(): single intnum in expression with
intnum folding on and leveling performed would result in terms getting copied
over due to hitting o != i case after i++ but no o++.

Bugzilla: #12.
Reported by: meor@softhome.net

svn path=/trunk/yasm/; revision=1009

21 years agoyasm_intnum_new_int(): Don't always create -1 intnums (oops)
Peter Johnson [Tue, 15 Jul 2003 06:27:40 +0000 (06:27 -0000)]
yasm_intnum_new_int(): Don't always create -1 intnums (oops)
yasm_intnum_get_int(): Properly overflow and handle INTNUM_UL properly
Elsewhere: use wordptr instead of intptr.
yasm_intnum_check_size() is still broken, but the interface for this will be
changing soon, so fix it then.

svn path=/trunk/yasm/; revision=1008

21 years agoUse /usr/bin/env for finding PERL.
Peter Johnson [Sun, 13 Jul 2003 21:32:29 +0000 (21:32 -0000)]
Use /usr/bin/env for finding PERL.

svn path=/trunk/yasm/; revision=1007

21 years agoFix RIP-relative effective addresses. They always have a 32-bit
Peter Johnson [Sat, 12 Jul 2003 22:55:22 +0000 (22:55 -0000)]
Fix RIP-relative effective addresses.  They always have a 32-bit
displacement.
Noticed by: Ben Skeggs <darktama@dodo.com.au>

svn path=/trunk/yasm/; revision=1006

21 years agoMake cpu_enabled a x86-local variable, and reset it in x86_initialize().
Peter Johnson [Sat, 12 Jul 2003 22:10:40 +0000 (22:10 -0000)]
Make cpu_enabled a x86-local variable, and reset it in x86_initialize().
Make CPU_* constants x86-local visible.

svn path=/trunk/yasm/; revision=1005

21 years agoAvoid warnings in strsep due to glibc's bits/string2.h string inlining by
Peter Johnson [Sat, 12 Jul 2003 19:44:30 +0000 (19:44 -0000)]
Avoid warnings in strsep due to glibc's bits/string2.h string inlining by
defining __NO_STRING_INLINES in strsep.c.  Due to string.h inclusion in
util.h, extra level of indirection is needed
(NO_STRING_INLINES->__NO_STRING_INLINES).

svn path=/trunk/yasm/; revision=1004

21 years agoIn floatnum_mul(), rename "exp" variable to "expon" to avoid compiler warning
Peter Johnson [Sat, 12 Jul 2003 17:55:04 +0000 (17:55 -0000)]
In floatnum_mul(), rename "exp" variable to "expon" to avoid compiler warning
(due to overriding global "exp" function).

svn path=/trunk/yasm/; revision=1003

21 years agoAdd sanity check for computed section size.
Peter Johnson [Sat, 12 Jul 2003 02:07:08 +0000 (02:07 -0000)]
Add sanity check for computed section size.

svn path=/trunk/yasm/; revision=1002

21 years agoCorrectly add in multiples (from TIMES operator) into section length.
Peter Johnson [Sat, 12 Jul 2003 01:58:37 +0000 (01:58 -0000)]
Correctly add in multiples (from TIMES operator) into section length.
Bugzilla #11
Reported by: meor@softhome.net

svn path=/trunk/yasm/; revision=1001

21 years agoRemove reference to yapp; it's been deleted.
Peter Johnson [Fri, 11 Jul 2003 05:42:26 +0000 (05:42 -0000)]
Remove reference to yapp; it's been deleted.

svn path=/trunk/yasm/; revision=1000

21 years agoRemove yapp. It's been disconnected from the build for some time, has
Peter Johnson [Fri, 11 Jul 2003 05:41:21 +0000 (05:41 -0000)]
Remove yapp.  It's been disconnected from the build for some time, has
started to bitrot, and mu@ says it needs rewriting from scratch.

svn path=/trunk/yasm/; revision=999

21 years agoClarify licensing.
Peter Johnson [Fri, 11 Jul 2003 04:35:42 +0000 (04:35 -0000)]
Clarify licensing.

svn path=/trunk/yasm/; revision=998

21 years agoNote bitvect is actually triple-licensed under the Artistic License, GPL,
Peter Johnson [Fri, 11 Jul 2003 04:08:52 +0000 (04:08 -0000)]
Note bitvect is actually triple-licensed under the Artistic License, GPL,
and LGPL.  Bring in the text from the original distribution README.txt and
Artistic.txt, and add an GPL reference.

svn path=/trunk/yasm/; revision=997

21 years agoAdd test for 64-bit ORG.
Peter Johnson [Fri, 11 Jul 2003 03:10:44 +0000 (03:10 -0000)]
Add test for 64-bit ORG.

svn path=/trunk/yasm/; revision=996

21 years agoRevamp intnum internals:
Peter Johnson [Fri, 11 Jul 2003 03:02:58 +0000 (03:02 -0000)]
Revamp intnum internals:
 - Up internal format size to 128 bit.
 - Use full internal format size for all calculations.
 - Always store negative numbers using full internal size
   (avoids 0xffffffff == -1?? issue)
This fixes many inconsistencies in handling of >32-bit intnums.

svn path=/trunk/yasm/; revision=995

21 years agoBitVector_add() and BitVector_sub() take a *carry parameter as an input; we
Peter Johnson [Fri, 11 Jul 2003 02:57:52 +0000 (02:57 -0000)]
BitVector_add() and BitVector_sub() take a *carry parameter as an input; we
were passing it uninitialized.

svn path=/trunk/yasm/; revision=994

21 years agoBitVector_compute(), BitVector_add(), and BitVector_sub() carry parameter is
Peter Johnson [Fri, 11 Jul 2003 02:54:11 +0000 (02:54 -0000)]
BitVector_compute(), BitVector_add(), and BitVector_sub() carry parameter is
both a carry in AND a carry out.

svn path=/trunk/yasm/; revision=993

21 years agoFix bts/btr immediate operands (previously required "byte" specifier).
Peter Johnson [Fri, 11 Jul 2003 02:18:01 +0000 (02:18 -0000)]
Fix bts/btr immediate operands (previously required "byte" specifier).

Bugzilla #10
Reported by: meor@softhome.net

svn path=/trunk/yasm/; revision=992

21 years agoBUGFIX: In yasm_intnum_calc(), use operand->val.bv instead of acc->val.bv if
Peter Johnson [Thu, 10 Jul 2003 04:54:55 +0000 (04:54 -0000)]
BUGFIX: In yasm_intnum_calc(), use operand->val.bv instead of acc->val.bv if
the operand is already a bitvector.

svn path=/trunk/yasm/; revision=991

21 years agoAllow complex (expression) section starts, primarily used for implementation
Peter Johnson [Tue, 8 Jul 2003 02:55:28 +0000 (02:55 -0000)]
Allow complex (expression) section starts, primarily used for implementation
of [ORG] in bin objfmt.  Still need to assess impact of self-referential
(invalid) ORG, and how to detect for that condition.

svn path=/trunk/yasm/; revision=990

21 years agoAdd a \warning that yasm_vps_delete() deletes all val/params.
Peter Johnson [Tue, 8 Jul 2003 02:51:39 +0000 (02:51 -0000)]
Add a \warning that yasm_vps_delete() deletes all val/params.

svn path=/trunk/yasm/; revision=989

21 years agoDocument for Doxygen (comment-only changes).
Peter Johnson [Tue, 8 Jul 2003 02:50:29 +0000 (02:50 -0000)]
Document for Doxygen (comment-only changes).

svn path=/trunk/yasm/; revision=988

21 years agoFix return comment for parse_directive(). Nonzero is returned if a directive
Peter Johnson [Sun, 29 Jun 2003 19:23:28 +0000 (19:23 -0000)]
Fix return comment for parse_directive().  Nonzero is returned if a directive
is NOT recognized.

svn path=/trunk/yasm/; revision=987

21 years agoComment for Doxygen.
Peter Johnson [Sat, 28 Jun 2003 17:39:58 +0000 (17:39 -0000)]
Comment for Doxygen.

svn path=/trunk/yasm/; revision=986

21 years agoAdd \rcs, \endrcs, \license, and \endlicense wrappers around $IdPath$ and
Peter Johnson [Sat, 28 Jun 2003 17:38:08 +0000 (17:38 -0000)]
Add \rcs, \endrcs, \license, and \endlicense wrappers around $IdPath$ and
copyright/license portions to shorten Doxygen output.  Comment only change.

svn path=/trunk/yasm/; revision=985

21 years agoFix a few Doxygen documentation comments and cross-references. Comment only
Peter Johnson [Sat, 28 Jun 2003 17:35:57 +0000 (17:35 -0000)]
Fix a few Doxygen documentation comments and cross-references.  Comment only
changes.

svn path=/trunk/yasm/; revision=984

21 years agoDoxygen comment-only change: \caution does not exist, use \attention instead.
Peter Johnson [Wed, 25 Jun 2003 07:17:05 +0000 (07:17 -0000)]
Doxygen comment-only change: \caution does not exist, use \attention instead.

svn path=/trunk/yasm/; revision=983

21 years agoFix bug in HAMT_insert() found by compiler-generated assembler file (lots of
Peter Johnson [Tue, 24 Jun 2003 08:05:33 +0000 (08:05 -0000)]
Fix bug in HAMT_insert() found by compiler-generated assembler file (lots of
similar label names).

Test also found a bug in COFF parsing of section options; this will be fixed
and a separate test added explicitly for it.

svn path=/trunk/yasm/; revision=982

21 years agoFix twobytemem (two byte memory accessing, no size) opcodes.
Peter Johnson [Fri, 13 Jun 2003 02:34:40 +0000 (02:34 -0000)]
Fix twobytemem (two byte memory accessing, no size) opcodes.
Add testcase to check them.
Found and patched by: Ben Skeggs <darktama@dodo.com.au>

svn path=/trunk/yasm/; revision=981

21 years agoPrevious commit didn't notationally separate x86 from AMD64 very well; be
Peter Johnson [Wed, 11 Jun 2003 02:55:08 +0000 (02:55 -0000)]
Previous commit didn't notationally separate x86 from AMD64 very well; be
more clear.

svn path=/trunk/yasm/; revision=980

21 years agoRename x86-64 to AMD64 in description, as per AMD name change.
Peter Johnson [Wed, 11 Jun 2003 02:49:03 +0000 (02:49 -0000)]
Rename x86-64 to AMD64 in description, as per AMD name change.
TBD: separation of x86 arch into x86 and amd64 archs?

svn path=/trunk/yasm/; revision=979

21 years agoDisplay fatal errors as FATAL, and perform other error display cleanups.
Peter Johnson [Sun, 8 Jun 2003 22:58:21 +0000 (22:58 -0000)]
Display fatal errors as FATAL, and perform other error display cleanups.
Exit immediately after bad arch/objfmt/etc selections to avoid "bad option"
secondary errors.

svn path=/trunk/yasm/; revision=978

21 years agoMissed a couple instances of yasm__error(0, ...) -> yasm_fatal().
Peter Johnson [Sun, 8 Jun 2003 21:30:22 +0000 (21:30 -0000)]
Missed a couple instances of yasm__error(0, ...) -> yasm_fatal().

svn path=/trunk/yasm/; revision=977

21 years agoCheck for supported architectures (for now, just x86).
Peter Johnson [Sun, 8 Jun 2003 21:26:43 +0000 (21:26 -0000)]
Check for supported architectures (for now, just x86).
Call yasm_fatal() instead of yasm__error(0, ...).

svn path=/trunk/yasm/; revision=976

21 years agoMake yasm_fatal() and implementations take a list of printf-like parameters.
Peter Johnson [Sun, 8 Jun 2003 21:21:22 +0000 (21:21 -0000)]
Make yasm_fatal() and implementations take a list of printf-like parameters.
Also, don't abort(), just exit()... unlike internal errors, which we want a
backtrace for, fatal errors may happen during normal operation.

svn path=/trunk/yasm/; revision=975

21 years agoUse standard basename() function if available.
Peter Johnson [Sun, 8 Jun 2003 20:45:02 +0000 (20:45 -0000)]
Use standard basename() function if available.

svn path=/trunk/yasm/; revision=974

21 years agoSimplify preloaded search case by removing any library extension in
Peter Johnson [Sun, 8 Jun 2003 20:17:21 +0000 (20:17 -0000)]
Simplify preloaded search case by removing any library extension in
list_modules() rather than trying to figure it out in list_module_load().
Also avoids the corner failure case when archives aren't named *.a.

svn path=/trunk/yasm/; revision=973

21 years agoChange module loader interface a bit (use enum instead of string to specify
Peter Johnson [Sat, 7 Jun 2003 21:56:47 +0000 (21:56 -0000)]
Change module loader interface a bit (use enum instead of string to specify
module type), and make "yasm -[adfpr] help" work dynamically by scanning
preloaded symbols and filesystem directories.

svn path=/trunk/yasm/; revision=972

21 years agoSimplify RCSID() definition.
Peter Johnson [Sat, 7 Jun 2003 20:48:40 +0000 (20:48 -0000)]
Simplify RCSID() definition.

svn path=/trunk/yasm/; revision=971

21 years agoBe a bit friendlier to those compiling without HAVE_CONFIG_H by always
Peter Johnson [Wed, 4 Jun 2003 05:25:10 +0000 (05:25 -0000)]
Be a bit friendlier to those compiling without HAVE_CONFIG_H by always
including the "standard C" headers.

svn path=/trunk/yasm/; revision=965

21 years agoOnly include config.h if HAVE_CONFIG_H is defined.
Peter Johnson [Wed, 4 Jun 2003 05:03:40 +0000 (05:03 -0000)]
Only include config.h if HAVE_CONFIG_H is defined.

svn path=/trunk/yasm/; revision=964

21 years agoFix some Doxygen documentation nits. Comment-only change.
Peter Johnson [Mon, 2 Jun 2003 00:56:33 +0000 (00:56 -0000)]
Fix some Doxygen documentation nits.  Comment-only change.

svn path=/trunk/yasm/; revision=963

21 years agoDocument for Doxygen.
Peter Johnson [Mon, 2 Jun 2003 00:23:33 +0000 (00:23 -0000)]
Document for Doxygen.

svn path=/trunk/yasm/; revision=962

21 years agoChange parameter name for yasm_expr_extract_segment declaration to ep to
Peter Johnson [Mon, 2 Jun 2003 00:11:14 +0000 (00:11 -0000)]
Change parameter name for yasm_expr_extract_segment declaration to ep to
match documentation and function definition.
No functional change.

svn path=/trunk/yasm/; revision=961

21 years agoAdd an architecture to support the LC-3b ISA as used in the ECE 312 course
Peter Johnson [Sat, 31 May 2003 22:37:58 +0000 (22:37 -0000)]
Add an architecture to support the LC-3b ISA as used in the ECE 312 course
at the University of Illinois, Urbana-Champaign.
See http://courses.ece.uiuc.edu/ece312/ for more details.

svn path=/trunk/yasm/; revision=960

21 years agoReformat multi-file lists to use many += lines instead of using \
Peter Johnson [Sat, 31 May 2003 22:23:08 +0000 (22:23 -0000)]
Reformat multi-file lists to use many += lines instead of using \
(line-continued) lines.  Format-only change, no functional change.

svn path=/trunk/yasm/; revision=959

21 years agoMake architecture selectable at the command line.
Peter Johnson [Sat, 31 May 2003 16:59:54 +0000 (16:59 -0000)]
Make architecture selectable at the command line.
Also, fix bug that caused parser to not actually be selectable (any user
choice was overridden).

svn path=/trunk/yasm/; revision=958

21 years agoBring yasm_x86__bc_print() up-to-date with x86_jmp[rel] changes.
Peter Johnson [Tue, 27 May 2003 05:51:25 +0000 (05:51 -0000)]
Bring yasm_x86__bc_print() up-to-date with x86_jmp[rel] changes.

svn path=/trunk/yasm/; revision=957

21 years agoRename jmprel->jmp, JMPREL->JMP, JR->JMP, and others, as FAR jumps are not
Peter Johnson [Tue, 27 May 2003 05:41:08 +0000 (05:41 -0000)]
Rename jmprel->jmp, JMPREL->JMP, JR->JMP, and others, as FAR jumps are not
relative jumps.

svn path=/trunk/yasm/; revision=956

21 years agoAdd basic FAR test for things like jmp 4:5. The test for CALL FAR procedure
Peter Johnson [Tue, 27 May 2003 04:18:45 +0000 (04:18 -0000)]
Add basic FAR test for things like jmp 4:5.  The test for CALL FAR procedure
will have to wait for an objfmt with support for SEG (such as .OBJ).

svn path=/trunk/yasm/; revision=955

21 years agoAdd support for FAR call/jmp. Because of the jmp label, label equ seg:off
Peter Johnson [Tue, 27 May 2003 04:13:16 +0000 (04:13 -0000)]
Add support for FAR call/jmp.  Because of the jmp label, label equ seg:off
problem, adding this required adding some fields to x86_jmprel (now a
misnomer, as FAR jumps are absolute) to save the far opcode, and additional
support in libyasm's yasm_expr_* to properly handle the YASM_EXPR_SEGOFF
operator.

svn path=/trunk/yasm/; revision=954

21 years agoAdd lindex parameter to yasm_intnum_calc(), and add error messages for SEG,
Peter Johnson [Mon, 26 May 2003 19:16:44 +0000 (19:16 -0000)]
Add lindex parameter to yasm_intnum_calc(), and add error messages for SEG,
WRT, and ':' (SEGOFF) usage.  This change also brings the yasm_intnum_calc()
interface in line with the yasm_floatnum_calc() interface.

Note: This may not be the final place we want these error messages to reside,
but the lindex addition should remain for the sake of consistency.

svn path=/trunk/yasm/; revision=953

21 years agoFix crash in "no non-local label before `%s'" warning (misuse of s.tok).
Peter Johnson [Wed, 21 May 2003 00:39:24 +0000 (00:39 -0000)]
Fix crash in "no non-local label before `%s'" warning (misuse of s.tok).
Add testcase for this warning while we're at it.

svn path=/trunk/yasm/; revision=952

21 years agoFix crash on Linux due to double-fclose(). The NASM preprocessor was closing
Peter Johnson [Sat, 10 May 2003 20:05:39 +0000 (20:05 -0000)]
Fix crash on Linux due to double-fclose().  The NASM preprocessor was closing
the original input file, which was then closed again by the frontend.  Fix
saves the original file passed in and special-checks for it before calling
fclose().

svn path=/trunk/yasm/; revision=951

21 years agoPre-include libyasm/coretype.h to avoid #defining functions such as
Peter Johnson [Sat, 10 May 2003 05:40:44 +0000 (05:40 -0000)]
Pre-include libyasm/coretype.h to avoid #defining functions such as
yasm__strsep() (here) before their prototypes are declared (in coretype.h).
Header protections keep coretype.h from being included again (from libyasm.h).

svn path=/trunk/yasm/; revision=948

21 years agoWe're licensed under the 2-clause BSD license, not the 3-clause.
Peter Johnson [Mon, 5 May 2003 07:01:52 +0000 (07:01 -0000)]
We're licensed under the 2-clause BSD license, not the 3-clause.

svn path=/trunk/yasm/; revision=947

21 years agoRevert previous commit: stamp-h.in is now back in the top directory.
Peter Johnson [Mon, 5 May 2003 06:59:14 +0000 (06:59 -0000)]
Revert previous commit: stamp-h.in is now back in the top directory.

svn path=/trunk/yasm/; revision=946

21 years agoSimplify brief description. Comment-only change.
Peter Johnson [Mon, 5 May 2003 06:14:33 +0000 (06:14 -0000)]
Simplify brief description.  Comment-only change.

svn path=/trunk/yasm/; revision=945

21 years agoClean up and simplify libyasm.h options and symbol visibility:
Peter Johnson [Mon, 5 May 2003 03:42:12 +0000 (03:42 -0000)]
Clean up and simplify libyasm.h options and symbol visibility:
- Move config.h and util.h from libyasm (and installed libyasm) to top level.
- Move yasm_* functions from util.h to coretype.h.
- Remove a number of autoconf-related YASM_*_INTERNAL options from libyasm.h.
- Rename YASM_INTERNAL to YASM_LIB_INTERNAL; it now actually means what the
  comment describes: enables definitions that violate the yasm_* namespace.

While we're at it, no longer define YASM_LIB_INTERNAL from yasm frontend, so
it's closer to what a real typical libyasm-using application would look like.

svn path=/trunk/yasm/; revision=944

21 years agoDon't create a dependency on $(top_builddir)/re2c; BSD make can't figure out
Peter Johnson [Mon, 5 May 2003 01:38:07 +0000 (01:38 -0000)]
Don't create a dependency on $(top_builddir)/re2c; BSD make can't figure out
that it's the same thing as "re2c" in the build directory.

svn path=/trunk/yasm/; revision=943

21 years agoChange how bytecode and section lists are allocated. When YASM_INTERNAL is not
Peter Johnson [Sun, 4 May 2003 22:15:09 +0000 (22:15 -0000)]
Change how bytecode and section lists are allocated.  When YASM_INTERNAL is not
defined, the structures for the list heads are not defined, so the existing
yasm_bcs_initialize() and yasm_sections_initialize() were impossible to use.
Instead, rename these functions to yasm_bcs_new() and yasm_sections_new() and
make them allocate the space internally.  Update yasm_bcs_delete() and
yasm_sections_delete() to free the internally-allocated space.

svn path=/trunk/yasm/; revision=942

21 years agodmalloc expects never to get a NULL deallocation; nasm preproc expects
Peter Johnson [Sun, 4 May 2003 22:12:14 +0000 (22:12 -0000)]
dmalloc expects never to get a NULL deallocation; nasm preproc expects
nasm_free() to handle it, which it does as yasm_xfree().  But to avoid dmalloc
complaints, check for the NULL beforehand if dmalloc is in use.

svn path=/trunk/yasm/; revision=941

21 years agoMake yasm_section_delete() static. It's unsafe to call from outside, because
Peter Johnson [Sun, 4 May 2003 20:31:57 +0000 (20:31 -0000)]
Make yasm_section_delete() static.  It's unsafe to call from outside, because
the only way to allocate a section is when making it a part of a section list,
and at present, the list is singly-linked internally.

svn path=/trunk/yasm/; revision=940

21 years agoComment for Doxygen documentation generation. Comment-only changes.
Peter Johnson [Sun, 4 May 2003 20:28:28 +0000 (20:28 -0000)]
Comment for Doxygen documentation generation.  Comment-only changes.

svn path=/trunk/yasm/; revision=939

21 years agoWatch placement of \internal Doxygen tag.
Peter Johnson [Sun, 4 May 2003 08:40:35 +0000 (08:40 -0000)]
Watch placement of \internal Doxygen tag.

svn path=/trunk/yasm/; revision=938

21 years agoComment for Doxygen documentation generation. Comment-only changes.
Peter Johnson [Sun, 4 May 2003 03:27:29 +0000 (03:27 -0000)]
Comment for Doxygen documentation generation.  Comment-only changes.

svn path=/trunk/yasm/; revision=937

21 years agoComment for Doxygen documentation generation.
Peter Johnson [Sun, 4 May 2003 01:39:10 +0000 (01:39 -0000)]
Comment for Doxygen documentation generation.

svn path=/trunk/yasm/; revision=936

21 years agoUndefine __STRICT__ANSI__ when compiling with gcc -ansi and glibc to avoid many
Peter Johnson [Sat, 3 May 2003 08:02:15 +0000 (08:02 -0000)]
Undefine __STRICT__ANSI__ when compiling with gcc -ansi and glibc to avoid many
spurious compiler warnings.

svn path=/trunk/yasm/; revision=924

21 years agoDon't use "select" as a variable name. Causes warnings on Linux, at the least
Peter Johnson [Sat, 3 May 2003 08:01:09 +0000 (08:01 -0000)]
Don't use "select" as a variable name.  Causes warnings on Linux, at the least
(namespace violation on glibc's part).

svn path=/trunk/yasm/; revision=923

21 years agoRemove typedefs for uint/uchar/ushort/ulong to avoid compiler warnings on Linux.
Peter Johnson [Sat, 3 May 2003 07:29:29 +0000 (07:29 -0000)]
Remove typedefs for uint/uchar/ushort/ulong to avoid compiler warnings on Linux.

svn path=/trunk/yasm/; revision=922

21 years agoInstall modules into pkglibdir rather than libdir, and rename to type_keyword
Peter Johnson [Sat, 3 May 2003 06:26:15 +0000 (06:26 -0000)]
Install modules into pkglibdir rather than libdir, and rename to type_keyword
from yasm_keyword (separating same-keyword modules of different types).  Update
yasm frontend module loader to handle this.

svn path=/trunk/yasm/; revision=921

21 years agoFix crash on the valid NASM preprocessor syntax:
Peter Johnson [Thu, 3 Apr 2003 06:14:29 +0000 (06:14 -0000)]
Fix crash on the valid NASM preprocessor syntax:
var: db 5
varlen equ $-var
%if varlen>100
...
%endif
by always acting like we're in preprocess-only mode and adjusting error
message appropriately.
This would be HARD to truly fix, as yasm only parses the input once.

svn path=/trunk/yasm/; revision=920

21 years agoCorrect typo "keword" in print_list_keyword_desc()
Michael Urman [Wed, 2 Apr 2003 03:38:50 +0000 (03:38 -0000)]
Correct typo "keword" in print_list_keyword_desc()

svn path=/trunk/yasm/; revision=919

21 years agoAvoid "unrecognized option `help'" error on "-[fprg] help".
Peter Johnson [Wed, 2 Apr 2003 03:27:45 +0000 (03:27 -0000)]
Avoid "unrecognized option `help'" error on "-[fprg] help".

svn path=/trunk/yasm/; revision=918

21 years agoAdd module listing on "-[fprg] help" so users know what's available.
Michael Urman [Tue, 1 Apr 2003 20:12:34 +0000 (20:12 -0000)]
Add module listing on "-[fprg] help" so users know what's available.
Lists are still made statically in yasm-module.c, so it's not magic. :(

svn path=/trunk/yasm/; revision=917

21 years agoSplit short and long options when they don't fit in the first column alone.
Michael Urman [Tue, 1 Apr 2003 19:53:30 +0000 (19:53 -0000)]
Split short and long options when they don't fit in the first column alone.
Shrink first column to 22 chars to let -e message fit.

svn path=/trunk/yasm/; revision=916

21 years agoDisable yapp usage and default to "real" nasm preprocessor.
Peter Johnson [Tue, 1 Apr 2003 07:26:33 +0000 (07:26 -0000)]
Disable yapp usage and default to "real" nasm preprocessor.

svn path=/trunk/yasm/; revision=910