bugmeout / pyemu

Automatically exported from code.google.com/p/pyemu
0 stars 0 forks source link

Few new instruction and some issues. #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Attached diff addresses this:

1. 3 new instructions JP, JNP, JPO.

2. ROR instruction was not working "correctly". 

Now it behaves not exactly as the documentation says.
If you look at what the doc says.
(* ROR instruction operation *)
IF tempCOUNT > 0) (* Prevent updates to CF *)
    WHILE (tempCOUNT ≠ 0)
         DO
             tempCF ← LSB(SRC);
             DEST ← (DEST / 2) + (tempCF ∗ 2^SIZE);
             tempCOUNT ← tempCOUNT – 1;
         OD;
    ELIHW;
    CF ← MSB(DEST);
    IF COUNT = 1
         THEN OF ← MSB(DEST) XOR MSB − 1(DEST);
         ELSE OF is undefined;
    FI;
FI;

This
    DEST ← (DEST / 2) + (tempCF ∗ 2^SIZE);
does not really make sense to me as (tempCF * 2^SIZE) is always zero. 
So I change it so it does tempCF * 2^(SIZE-1). That way the PyEmu
produces the same result as the real CPU.

3. PyLinux was not initialized properly.

4. Few little thing live wrong variable name etc. in TEST, MOVZX, MOVSX. 
(Actually, it looks like libdasm in the repository does not disassemble
MOVZX properly, the fix was submitted to http://code.google.com/p/libdasm/)

Here is the issues I bumped into but did not address them in any way.

1.  PyEmu.dump_register may result into infinite recursion as
PyEmu.raise_exception uses
 PyEmu.dump_register. And PyEmu.dump_register may cause a call to raise
exception. 

2. While trying to manipulate the memory at high address (greater then
0x80000000) i got 
OverflowError: long int too large to convert to int
in PyMemory.py. Apparently, pages list index is to big for xrange or
something. I guess it can be fixed by using only 20 bits integers for those
indexes, first 12 bits are all zero anyhow.
I saw it only on 32-bit system, on 64-bit system did not see anything like
that.

Original issue reported on code.google.com by dima...@gmail.com on 15 Jun 2009 at 2:14

Attachments:

GoogleCodeExporter commented 9 years ago
Typos fixed in rev. 18
New Instructions and PyLinux changes in rev. 19

Thank you a lot for the help. Im still looking at redoing PyMemory.

Original comment by codyrpie...@gmail.com on 23 Jul 2009 at 7:06