diff options
Diffstat (limited to 'sys/i386/apm/apm_init/bin2asm.c')
-rw-r--r-- | sys/i386/apm/apm_init/bin2asm.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/i386/apm/apm_init/bin2asm.c b/sys/i386/apm/apm_init/bin2asm.c index 5577247..791798a 100644 --- a/sys/i386/apm/apm_init/bin2asm.c +++ b/sys/i386/apm/apm_init/bin2asm.c @@ -1,9 +1,9 @@ /* - * LP (Laptop Package) + * APM (Advanced Power Management) BIOS Device Driver * - * Copyright (C) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp> + * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp> * - * This software may be used, modified, copied, and distributed, in + * This software may be used, modified, copied, and distributed, in * both source and binary form provided that the above copyright and * these terms are retained. Under no circumstances is the author * responsible for the proper functioning of this software, nor does @@ -12,7 +12,7 @@ * * Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id$ + * $Id: bin2asm.c,v 1.2 1994/10/01 05:12:30 davidg Exp $ */ #include <stdio.h> @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) { - int c, col; + int c, col, lastline; FILE *infile, *outfile; if (argc != 3) { @@ -44,6 +44,8 @@ int main(int argc, char *argv[]) fprintf(outfile, "/* This file is automatically generated by bin2asm */\n"); fprintf(outfile, "/* Original file is '%s' */\n\n", argv[1]); + lastline = 0; + while ((c = fgetc(infile)) != EOF) { if (col % NCOLS == 0) { fprintf(outfile, "\t.byte\t"); @@ -51,12 +53,20 @@ int main(int argc, char *argv[]) fprintf(outfile, "0x%02x", c); if (col % NCOLS == NCOLS - 1) { fprintf(outfile, "\n"); + lastline = 1; } else { fprintf(outfile, ", "); + lastline = 0; } col++; } + if (!lastline) { + do { + fprintf(outfile, "0x00, "); + } while ((col++) % NCOLS < NCOLS - 2); + fprintf(outfile, "0x00\n"); + } fprintf(outfile, "\n/* Total size = 0x%04x */\n", col); |