Hi,
I've been working on an ARM emulator of my own, and using ArcEm
as a reference model of sorts along the way. While debugging the Arthur
desktop I found a "TSTS R14, R15" in which ArcEm incorrectly sets the
Carry flag. The ARM datasheet states that for logical DPI opcodes with
the S bit set, if the shift amount is LSL #0 then the Carry flag is
preserved from the previous state.
This is respected by ArcEm in all cases except when Rm is R15, and
the shift is by an immediate constant. Here we jump into
GetDPSRegRHS even if the shift is LSL #0, and the code says:
------------------------
shamt = BITS(7,11);
switch ((int)BITS(5,6)) {
case LSL: ASSIGNC((base >> (32-shamt)) & 1);
return(base << shamt);
------------------------
A quick fix to this would be something along the lines of:
------------------------
shamt = BITS(7,11);
switch ((int)BITS(5,6)) {
case LSL:
/* BUGFIX: This copes with the case when base = R15 and shamt = 0
*/
if (shamt)
ASSIGNC((base >> (32-shamt)) & 1);
return(base << shamt);
------------------------
Hope this helps,
Patrick
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel