};
-#define AS_OUTPUT_OBJ 0x00
-#define AS_OUTPUT_BIN 0x01
+#define AS_OUTPUT_IA16_ELKS 0x00
+#define AS_OUTPUT_I386_ELKS 0x01
+
+#define AS_OUTPUT_BIN 0x02
struct as_state {
header.a_magic[1] = (ELKS_MAGIC & 0xff);
header.a_flags = 0x10;
- header.a_cpu = 0x04;
+ header.a_cpu = (state->format == AS_OUTPUT_I386_ELKS) ? 0x10 : 0x04;
header.a_hdrlen = sizeof (header);
if ((symbol = state->end_symbol)) {
fprintf (stderr, " -Uname Undefine 'name'.\n");
fprintf (stderr, "\n");
+ fprintf (stderr, " -f FORMAT Specify the format of object file (default elks-ia16)\n");
+ fprintf (stderr, " Supported formats are:\n");
+ fprintf (stderr, " elks-ia16, elks-i386, binary\n");
fprintf (stderr, " -l FILE Print listings to file FILE.\n");
fprintf (stderr, " -o OBJFILE Name the object-file output OBJFILE (default a.out).\n");
}
- if (xstrcasecmp (optarg, "obj") == 0) {
+ if (xstrcasecmp (optarg, "elks-ia16") == 0) {
- state->format = AS_OUTPUT_OBJ;
+ state->format = AS_OUTPUT_IA16_ELKS;
+ break;
+
+ }
+
+ if (xstrcasecmp (optarg, "elks-i386") == 0) {
+
+ state->format = AS_OUTPUT_I386_ELKS;
break;
}