summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2001-11-19 03:27:56 +0000
committerPeter Johnson <peter@tortall.net>2001-11-19 03:27:56 +0000
commit8cbf2c2312926aba897e87e3b3db31d8fbc1c574 (patch)
tree76488ae3be85834216bf69f45b8443390a4bcda7 /src/main.c
parentb963c38833bca7693fd35fde81d46b23f275ab36 (diff)
downloadyasm-8cbf2c2312926aba897e87e3b3db31d8fbc1c574.tar.gz
- Greatly enhance capabilities of directives (they're actually parsed now).
objfmt interface changed a lot due to this. - New variables cur_objfmt and cur_parser that define what objfmt/parser are active. They're set in main() by searching through the list of objfmts and parsers. This necessitated libyasm.a to be listed twice in LDADD. svn path=/trunk/yasm/; revision=343
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 3d72d5dc..bdc31999 100644
--- a/src/main.c
+++ b/src/main.c
@@ -117,10 +117,24 @@ main(int argc, char *argv[])
/* Set x86 as the architecture */
cur_arch = &x86_arch;
+ /* Set dbg as the object format */
+ cur_objfmt = find_objfmt("dbg");
+ if (!cur_objfmt) {
+ ErrorNow(_("unrecognized output format `%s'"), "dbg");
+ return EXIT_FAILURE;
+ }
+
+ /* Set NASM as the parser */
+ cur_parser = find_parser("nasm");
+ if (!cur_parser) {
+ ErrorNow(_("unrecognized parser `%s'"), "nasm");
+ return EXIT_FAILURE;
+ }
+
/* Get initial BITS setting from object format */
- x86_mode_bits = dbg_objfmt.default_mode_bits;
+ x86_mode_bits = cur_objfmt->default_mode_bits;
- sections = nasm_parser.do_parse(&nasm_parser, &dbg_objfmt, in);
+ sections = cur_parser->do_parse(cur_parser, in);
if (OutputAllErrorWarning() > 0) {
sections_delete(sections);