diff -Naur gpasm-0.0.6/hex.c gpasm-0.0.6.patched/hex.c --- gpasm-0.0.6/hex.c Wed Aug 26 13:23:33 1998 +++ gpasm-0.0.6.patched/hex.c Sun Nov 1 23:02:13 1998 @@ -56,8 +56,14 @@ static void end_record() { + extern int msdos_newlines; /* declared in main.c MJC */ write_byte((-sum) & 0xff); - fprintf(hex, "\n"); + if(msdos_newlines == 1) { + /* print a \r */ + fprintf(hex, "\r"); + } else { + fprintf(hex, "\n"); + } } void dump_hex() diff -Naur gpasm-0.0.6/main.c gpasm-0.0.6.patched/main.c --- gpasm-0.0.6/main.c Wed Aug 26 13:23:33 1998 +++ gpasm-0.0.6.patched/main.c Sun Nov 1 23:03:14 1998 @@ -35,6 +35,9 @@ int yyparse(void); +/* Added by MJC */ +int msdos_newlines = 0; + int main( int argc, char *argv[] ) { int c; @@ -43,12 +46,17 @@ /* #defines are case-insensitive */ state.stDefines = push_symbol_table(NULL, 1); - while ((c = getopt(argc, argv, "?a:cd:e:hp:qr:w:v")) != EOF) { + while ((c = getopt(argc, argv, "?ta:cd:e:hp:qr:w:v")) != EOF) { switch (c) { case '?': case 'h': usage = 1; break; + + case 't': + msdos_newlines = 1; + break; + case 'a': if (strcasecmp(optarg, "inhx8m") == 0) state.hex_format = inhx8m; @@ -119,6 +127,7 @@ printf(" -q Quiet \n"); printf(" -r Select radix \n"); printf(" -v Show version \n"); + printf(" -t Output hex file in MSDOS format\n"); printf("\n"); exit(0); }