Commit Graph

7 Commits

Author SHA1 Message Date
Maxwell Bernstein
cff2cd82c2 Use size-specific MAX/MIN constants
Don't rely on platform sizes.
2020-10-22 13:21:07 -07:00
Kartik Agaram
c82d149b3f 7089 2020-10-22 00:59:46 -07:00
Kartik Agaram
d44bd51f90 6912 2020-09-30 22:56:45 -07:00
Kartik Agaram
8f256f1f2e 6090 - new instruction: multiply by immediate
This is a 3-operand instruction:
  r32 = rm32 * imm32

It looks like https://c9x.me/x86/html/file_module_x86_id_138.html has a
bug, implying the same opcode supports a 2-operand version. I don't see
that in the Intel manual pdf, or at alternative sites like https://www.felixcloutier.com/x86/imul

Native runs seem to validate my understanding.

In the process I also fixed a bug in the existing multiply instruction
0f af: the only flags it sets are OF and CF. The other existing multiply
instruction f7 was doing things right.
2020-03-06 18:34:27 -08:00
Kartik Agaram
9ee351f37f 5983 - fix an emulator bounds-check bug
It was possible for an instruction to write out of bounds of the memory
data structure. Most of the time this worked fine. However if the block
ever got resized and moved the out-of-bounds bytes no longer went along.
2020-02-05 14:57:52 -08:00
Kartik Agaram
c357b103d1 5818 2019-12-22 07:41:52 -08:00
Kartik Agaram
6e1eeeebfb 5485 - promote SubX to top-level 2019-07-27 17:47:59 -07:00