casio-emu icon indicating copy to clipboard operation
casio-emu copied to clipboard

Add support for mac.l, clrmac, and addv/subv

Open attilavs2 opened this issue 1 year ago • 4 comments

attilavs2 avatar Sep 13 '24 08:09 attilavs2

addv/subv are incorerct, you should check for signed overflow. Overflow occurs if you add two numbers with the same sign and the result's sign is not the same as the operands'. The logic is the same for subv but flipping the sign of the second operand. You can check the SH4 manual for a pseudo-code version of these.

With the current code, addv reports overflow for -1+0, -1+-1, -1+1...

Also you must set T inconditionally.

lephe avatar Sep 13 '24 08:09 lephe

True, i didn't think enough about it. Will try to find time to fix it tonight.

attilavs2 avatar Sep 13 '24 11:09 attilavs2

Basing myself on the manual, i should have corrected the implementations

attilavs2 avatar Sep 15 '24 13:09 attilavs2

I removed movco/movli at Circuit10's request (on discord)

attilavs2 avatar Oct 02 '24 06:10 attilavs2