mirror of
https://github.com/VARCem/ihex.git
synced 2026-09-23 07:24:51 +00:00
bin2ihex & ihex2bin command-line options
This commit is contained in:
@@ -91,11 +91,11 @@ Usage by example:
|
||||
# equal to the address of the first data byte read from input):
|
||||
ihex2bin -A -i infile.hex -o outfile.bin
|
||||
|
||||
Both programs also accept the option `-v` to enable some debug messages.
|
||||
Both programs also accept the option `-v` to increase verbosity.
|
||||
|
||||
When using `ihex2bin` on Intel HEX files produced by compilers and such,
|
||||
it is a good idea to specify the command-line option `-A` to autodetect
|
||||
the address offset. Otherwise the program will simply fill any unused
|
||||
addresses, starting from 0, with zero bytes, which may end up being
|
||||
mega- or even gigabytes.
|
||||
addresses, starting from 0, with zero bytes, which may total mega- or
|
||||
even gigabytes.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ main (int argc, char *argv[]) {
|
||||
if (++i == argc) {
|
||||
goto invalid_argument;
|
||||
}
|
||||
if (!(outfile = fopen(++arg, "w"))) {
|
||||
if (!(outfile = fopen(argv[i], "w"))) {
|
||||
goto argument_error;
|
||||
}
|
||||
break;
|
||||
@@ -62,7 +62,7 @@ main (int argc, char *argv[]) {
|
||||
if (++i == argc) {
|
||||
goto invalid_argument;
|
||||
}
|
||||
if (!(infile = fopen(++arg, "rb"))) {
|
||||
if (!(infile = fopen(argv[i], "rb"))) {
|
||||
goto argument_error;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -66,7 +66,7 @@ main (int argc, char *argv[]) {
|
||||
if (++i == argc) {
|
||||
goto invalid_argument;
|
||||
}
|
||||
if (!(outfile = fopen(++arg, "w"))) {
|
||||
if (!(outfile = fopen(argv[i], "w"))) {
|
||||
goto argument_error;
|
||||
}
|
||||
break;
|
||||
@@ -74,7 +74,7 @@ main (int argc, char *argv[]) {
|
||||
if (++i == argc) {
|
||||
goto invalid_argument;
|
||||
}
|
||||
if (!(infile = fopen(++arg, "rb"))) {
|
||||
if (!(infile = fopen(argv[i], "rb"))) {
|
||||
goto argument_error;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user