summaryrefslogtreecommitdiff
path: root/sim/h8300
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2000-08-11 02:03:02 +0000
committerKazu Hirata <kazu@codesourcery.com>2000-08-11 02:03:02 +0000
commit8f28559ed3731c37de8455cdebbaa6595c59e944 (patch)
treeb1bfb6a09589f7e679653e4574bcc43a99137672 /sim/h8300
parent8bcb8c7f8e758f07bed8e0ceff58782a95f1f9ea (diff)
downloadgdb-8f28559ed3731c37de8455cdebbaa6595c59e944.tar.gz
2000-08-10 Kazu Hirata <kazu@hxi.com>
* compile.c (decode): Clean up the code.
Diffstat (limited to 'sim/h8300')
-rw-r--r--sim/h8300/ChangeLog4
-rw-r--r--sim/h8300/compile.c14
2 files changed, 10 insertions, 8 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index 46f99722878..0eb353c0fe7 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,7 @@
+2000-08-10 Kazu Hirata <kazu@hxi.com>
+
+ * compile.c (decode): Clean up the code.
+
2000-06-15 Kazu Hirata <kazu@hxi.com>
* compile.c (decode): Distinguish inc/dec.[wl] and adds/subs
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 3a22190fefc..d567cb131eb 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -172,20 +172,18 @@ decode (addr, data, dst)
int abs = 0;
int bit = 0;
int plen = 0;
- struct h8_opcode *q = h8_opcodes;
+ struct h8_opcode *q;
int size = 0;
dst->dst.type = -1;
dst->src.type = -1;
/* Find the exact opcode/arg combo. */
- while (q->name)
+ for (q = h8_opcodes; q->name; q++)
{
- op_type *nib;
+ op_type *nib = q->data.nib;
unsigned int len = 0;
- nib = q->data.nib;
-
while (1)
{
op_type looking_for = *nib;
@@ -356,8 +354,8 @@ decode (addr, data, dst)
}
else if (x & REG)
{
- /* Reset the size, some
- ops (like mul) have two sizes */
+ /* Reset the size.
+ Some ops (like mul) have two sizes. */
size = bitfrom (x);
p->type = X (OP_REG, size);
@@ -456,7 +454,7 @@ decode (addr, data, dst)
}
fail:
- q++;
+ ;
}
/* Fell off the end. */