From: Shamus Hammons Date: Sun, 23 Feb 2014 03:46:01 +0000 (-0600) Subject: Fix for extraneous newlines in .print directive. X-Git-Tag: 1.3.0~5 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=9df4696c6d38b7908dd83f95509fc14f2f7c799c;ds=sidebyside Fix for extraneous newlines in .print directive. --- diff --git a/direct.c b/direct.c index 7673d29..3542669 100644 --- a/direct.c +++ b/direct.c @@ -118,15 +118,15 @@ int d_org(void) // int d_print(void) { - char prntstr[LNSIZ]; // String for PRINT directive - char format[LNSIZ]; // Format for PRINT directive - int formatting = 0; // Formatting on/off - int wordlong = 0; // WORD = 0, LONG = 1 - int outtype = 0; // 0:hex, 1:decimal, 2:unsigned - - VALUE eval; // Expression value - WORD eattr; // Expression attributes - SYM * esym; // External symbol involved in expr. + char prntstr[LNSIZ]; // String for PRINT directive + char format[LNSIZ]; // Format for PRINT directive + int formatting = 0; // Formatting on/off + int wordlong = 0; // WORD = 0, LONG = 1 + int outtype = 0; // 0:hex, 1:decimal, 2:unsigned + + VALUE eval; // Expression value + WORD eattr; // Expression attributes + SYM * esym; // External symbol involved in expr. TOKEN r_expr[EXPRSIZE]; while (*tok != EOL) @@ -201,7 +201,7 @@ int d_print(void) } printf("\n"); - println("\n"); +// println("\n"); return 0; diff --git a/listing.c b/listing.c index f930b79..9dfddc5 100644 --- a/listing.c +++ b/listing.c @@ -40,10 +40,12 @@ static char timestr[20]; // Current time hh:mm:ss [am|pm] static char buf[IMAGESIZ]; // Buffer for numbers static long unused; // For supressing 'write' warnings -static char * month[16] = { "", "Jan", "Feb", "Mar", - "Apr", "May", "Jun", "Jul", - "Aug", "Sep", "Oct", "Nov", - "Dec", "", "", "" }; +static char * month[16] = { + "", "Jan", "Feb", "Mar", + "Apr", "May", "Jun", "Jul", + "Aug", "Sep", "Oct", "Nov", + "Dec", "", "", "" +}; // // Eject the Page (Print Empty Lines), Reset the Line Count and Bump the Page Number @@ -134,7 +136,7 @@ void date_string(char * buf, VALUE date) void scopy(char *dest, char *src, int len) { if (len < 0) - len = 1000; // Some large number + len = 1000; // Some large number [Shamus: wha...?] while (len-- && *src) *dest++ = *src++; @@ -209,7 +211,8 @@ void println(const char * ln) { unsigned int length; - if (list_fname != NULL) // Create listing file, if necessary + // Create listing file, if necessary + if (list_fname != NULL) list_setup(); length = strlen(ln); @@ -449,7 +452,8 @@ int d_subttl(void) tok += 2; - if (ejectok && (subflag || pageno > 1)) // Always eject on pages 2+ + // Always eject on pages 2+ + if (ejectok && (subflag || pageno > 1)) eject(); subflag = 1; diff --git a/listing.h b/listing.h index 3a1af65..bef97bc 100644 --- a/listing.h +++ b/listing.h @@ -12,18 +12,18 @@ #include #include "rmac.h" -#define BOT_MAR 1 // #blank lines on bottom of page -#define IMAGESIZ 200 // Max size of a line of text -#define TITLESIZ 200 // Max size of a title -#define LN_COL 0 // Column for line numbers -#define LOC_COL 7 // Location ptr -#define DATA_COL 17 // Data start (for 20 chars, usually 16) -#define DATA_END (DATA_COL+20) // End+1th data column -#define TAG_COL 38 // Tag character -#define SRC_COL 40 // Source start +#define BOT_MAR 1 // #blank lines on bottom of page +#define IMAGESIZ 200 // Max size of a line of text +#define TITLESIZ 200 // Max size of a title +#define LN_COL 0 // Column for line numbers +#define LOC_COL 7 // Location ptr +#define DATA_COL 17 // Data start (for 20 chars, usually 16) +#define DATA_END (DATA_COL+20) // End+1th data column +#define TAG_COL 38 // Tag character +#define SRC_COL 40 // Source start // Globals, externals etc -extern char *list_fname; +extern char * list_fname; extern int listing; extern int pagelen; extern int nlines; diff --git a/riscasm.c b/riscasm.c index 4925adc..2754600 100644 --- a/riscasm.c +++ b/riscasm.c @@ -33,7 +33,7 @@ char reg_err[] = "missing register R0...R31"; // Jaguar Jump Condition Names char condname[MAXINTERNCC][5] = { "NZ", "Z", "NC", "NCNZ", "NCZ", "C", "CNZ", "CZ", "NN", "NNNZ", "NNZ", - "N", "N_NZ", "N_Z ", "T", "A", "NE", "EQ", "CC", "HS", "HI", "CS", "LO", + "N", "N_NZ", "N_Z", "T", "A", "NE", "EQ", "CC", "HS", "HI", "CS", "LO", "PL", "MI", "F" }; @@ -338,7 +338,7 @@ int GenerateRISCCode(int state) warn("MOVEI following JUMP, inserting NOP to fix your BROKEN CODE"); } else - warn("MOVEI following JUMP"); + warn("MOVEI immediately follows JUMP"); } if ((challoc - ch_size) < 4) diff --git a/version.h b/version.h index fc7fd37..ab70e8b 100644 --- a/version.h +++ b/version.h @@ -13,6 +13,6 @@ #define MAJOR 1 // Major version number #define MINOR 2 // Minor version number -#define PATCH 9 // Patch release number +#define PATCH 10 // Patch release number #endif // __VERSION_H__