Skip to content

IMUL does not sign extend correctly #22

@YJDoc2

Description

@YJDoc2

As from a mail received :

start:
MOV AL, 0xF9 (-7)
MOV BL, 0x02 (2)
IMUL BL

It gives the result of 01F2. This answer is the result of unsigned number multiplication (MUL).
It is expected to give the answer of FFF2 (-14).

This is because of a bug in imul implementation which does the sign extension + expansion incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions