jeffpar / pcjs

The original IBM PC and other machine emulations in JavaScript
https://www.pcjs.org
Other
809 stars 122 forks source link

Bunch of minor issues #84

Open ecrips opened 7 months ago

ecrips commented 7 months ago

Thanks for your work on this emulator, I've been using the CPU emulation to help find bugs in an x86 emulator I've been writing. In the process I've noticed a few issues in PCjs so I'm reporting them here.

  1. fnXCHGrw in x86func.js has a typo for the [E]BP case - it refers to this.regEBX rather than regEBP.
  2. loadDesc8 in segx86.js assigns fIDT only if (sizeGate > 0) but it's possible to hit a usage without it being assigned (in the !(acc & X86.DESC.ACC.PRESENT) case).
  3. Again in loadDesc8 the member this.addrIOPMLimit is assigned using the value of this.limit but I believe it should be using the local variable limit.

Things that I'm not entirely sure about the correct behaviour:

Once again thanks for providing this emulator - it has helped me track down many tricky bugs in my emulator and the code is nicely modular and readable so I was able to run it synchronised with my emulator and compare the execution.