aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx/aicasm/aicasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aic7xxx/aicasm/aicasm.c')
-rw-r--r--drivers/scsi/aic7xxx/aicasm/aicasm.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c b/drivers/scsi/aic7xxx/aicasm/aicasm.c
index f936b691232f..924102720b14 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm.c
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm.c
@@ -37,7 +37,7 @@
37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGES. 38 * POSSIBILITY OF SUCH DAMAGES.
39 * 39 *
40 * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#22 $ 40 * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.c#23 $
41 * 41 *
42 * $FreeBSD$ 42 * $FreeBSD$
43 */ 43 */
@@ -609,10 +609,10 @@ output_listing(char *ifilename)
609 609
610 while (line < cur_instr->srcline) { 610 while (line < cur_instr->srcline) {
611 fgets(buf, sizeof(buf), ifile); 611 fgets(buf, sizeof(buf), ifile);
612 fprintf(listfile, "\t\t%s", buf); 612 fprintf(listfile, " \t%s", buf);
613 line++; 613 line++;
614 } 614 }
615 fprintf(listfile, "%03x %02x%02x%02x%02x", instrptr, 615 fprintf(listfile, "%04x %02x%02x%02x%02x", instrptr,
616#ifdef __LITTLE_ENDIAN 616#ifdef __LITTLE_ENDIAN
617 cur_instr->format.bytes[0], 617 cur_instr->format.bytes[0],
618 cur_instr->format.bytes[1], 618 cur_instr->format.bytes[1],
@@ -624,14 +624,23 @@ output_listing(char *ifilename)
624 cur_instr->format.bytes[1], 624 cur_instr->format.bytes[1],
625 cur_instr->format.bytes[0]); 625 cur_instr->format.bytes[0]);
626#endif 626#endif
627 fgets(buf, sizeof(buf), ifile); 627 /*
628 fprintf(listfile, "\t%s", buf); 628 * Macro expansions can cause several instructions
629 line++; 629 * to be output for a single source line. Only
630 * advance the line once in these cases.
631 */
632 if (line == cur_instr->srcline) {
633 fgets(buf, sizeof(buf), ifile);
634 fprintf(listfile, "\t%s", buf);
635 line++;
636 } else {
637 fprintf(listfile, "\n");
638 }
630 instrptr++; 639 instrptr++;
631 } 640 }
632 /* Dump the remainder of the file */ 641 /* Dump the remainder of the file */
633 while(fgets(buf, sizeof(buf), ifile) != NULL) 642 while(fgets(buf, sizeof(buf), ifile) != NULL)
634 fprintf(listfile, "\t\t%s", buf); 643 fprintf(listfile, " %s", buf);
635 644
636 fclose(ifile); 645 fclose(ifile);
637} 646}