aboutsummaryrefslogtreecommitdiff
path: root/sim/v850/simops.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-08-30 05:49:07 +0000
committerJeff Law <law@redhat.com>1996-08-30 05:49:07 +0000
commit3cb6bf7818b30b5501abf49022451e10fcd499f0 (patch)
tree06027ff8d36e5f0a949bfe2d1bca917c65a8ad8a /sim/v850/simops.c
parent28647e4c0c74b2426a530b2b9ec3c95b92944662 (diff)
downloadgdb-3cb6bf7818b30b5501abf49022451e10fcd499f0.zip
gdb-3cb6bf7818b30b5501abf49022451e10fcd499f0.tar.gz
gdb-3cb6bf7818b30b5501abf49022451e10fcd499f0.tar.bz2
* interp.c (do_format_4): Get operands correctly and
call the target function. * simops.c: Rough cut at "sld.b", "sld.h", "sld.w", "sst.b", "sst.h", and "sst.w".
Diffstat (limited to 'sim/v850/simops.c')
-rw-r--r--sim/v850/simops.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index 8a0bc98..f763d02 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -6,36 +6,86 @@
void
OP_300 ()
{
+ unsigned int op0, op1, op2;
+ int result, temp;
+
+ temp = OP[1];
+ temp = (temp << 25) >> 25;
+ op2 = temp;
+ result = get_byte (State.mem + State.regs[30] + op2);
+ result = (result << 24) >> 24;
+ State.regs[OP[0]] = result;
}
/* sld.h */
void
OP_400 ()
{
+ unsigned int op0, op1, op2;
+ int result, temp;
+
+ temp = OP[1];
+ temp = (temp << 25) >> 25;
+ op2 = temp << 1;
+ result = get_half (State.mem + State.regs[30] + op2);
+ result = (result << 16) >> 16;
+ State.regs[OP[0]] = result;
}
/* sld.w */
void
OP_500 ()
{
+ unsigned int op0, op1, op2;
+ int result, temp;
+
+ temp = OP[1];
+ temp = (temp << 25) >> 25;
+ op2 = temp << 2;
+ result = get_word (State.mem + State.regs[30] + op2);
+ State.regs[OP[0]] = result;
}
/* sst.b */
void
OP_380 ()
{
+ unsigned int op0, op1, op2;
+ int result, temp;
+
+ op0 = State.regs[OP[0]];
+ temp = OP[1];
+ temp = (temp << 25) >> 25;
+ op1 = temp;
+ put_byte (State.mem + State.regs[30] + op1, op0);
}
/* sst.h */
void
OP_480 ()
{
+ unsigned int op0, op1, op2;
+ int result, temp;
+
+ op0 = State.regs[OP[0]];
+ temp = OP[1];
+ temp = (temp << 25) >> 25;
+ op1 = temp << 1;
+ put_half (State.mem + State.regs[30] + op1, op0);
}
/* sst.w */
void
OP_501 ()
{
+ unsigned int op0, op1, op2;
+ int result, temp;
+
+ op0 = State.regs[OP[0]];
+ temp = OP[1];
+ temp = (temp << 25) >> 25;
+ op1 = temp << 2;
+ put_word (State.mem + State.regs[30] + op1, op0);
}
/* ld.b */