summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-08-29 22:07:55 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-08-29 22:07:55 +0000
commit3de780ea8a63395641b6221d8292743fcd9e7546 (patch)
treed3507171e6aa05aec8713c564414495a5f4ada45 /src
parent1173ae9493eee4874d093f870234f263c33eab6b (diff)
Usage for unidasm now dumps the available achitectures.
Diffstat (limited to 'src')
-rw-r--r--src/tools/unidasm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c
index 89308577900..e95f6afdc1a 100644
--- a/src/tools/unidasm.c
+++ b/src/tools/unidasm.c
@@ -327,6 +327,8 @@ int parse_options(int argc, char *argv[], options *opts)
{
int pending_base = FALSE;
int pending_arch = FALSE;
+ int curarch;
+ int numrows;
int arg;
memset(opts, 0, sizeof(*opts));
@@ -371,7 +373,6 @@ int parse_options(int argc, char *argv[], options *opts)
// architecture
else if (pending_arch)
{
- int curarch;
for (curarch = 0; curarch < ARRAY_LENGTH(dasm_table); curarch++)
if (core_stricmp(curarg, dasm_table[curarch].name) == 0)
break;
@@ -397,6 +398,19 @@ int parse_options(int argc, char *argv[], options *opts)
usage:
printf("Usage: %s <filename> -arch <architecture> [-basepc <pc>] [-norawbytes] [-upper] [-lower]\n", argv[0]);
+ printf("\n");
+ printf("Supported architectures:");
+ numrows = (ARRAY_LENGTH(dasm_table) + 6) / 7;
+ for (curarch = 0; curarch < numrows * 7; curarch++)
+ {
+ int row = curarch / 7;
+ int col = curarch % 7;
+ int index = col * numrows + row;
+ if (col == 0)
+ printf("\n ");
+ printf("%-11s", (index < ARRAY_LENGTH(dasm_table)) ? dasm_table[index].name : "");
+ }
+ printf("\n");
return 1;
};