A forum about the
Hatari ST/STE/Falcon emulator - the current version is v2.5.0
Moderators: simonsunnyboy , npomarede , thothy , Moderator Team
agranlund
Captain Atari
Posts: 151 Joined: Sun Aug 04, 2019 1:49 pm
Post
by agranlund » Thu Sep 14, 2023 7:12 pm
Admittedly a very rare case but it appears Hatari is not emulating a specific use of movem correctly in 68020+ modes
Caught me a bit off-guard when trying to get some code going on real hardware after working in Hatari.
movem.x rl,-(an)
There is a difference if the register used in predecrement mode is also contained in the register list.
For the 68020, 68030 and 68040 the value written to memory is the initial register value decemented by the size of the operation.
The 68000 and 68010 write the initial register value (not decremented).
--Cheers,
Anders
Cyprian
10 GOTO 10
Posts: 3258 Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland
Post
by Cyprian » Thu Sep 14, 2023 9:27 pm
do you mean "movem.l A0,-(A0)"?
Attached you can find my test program and TT shows me:
20230914_232211.jpg
and Hatari:
grab0002.png
I've just sent that report to the Hatari team.
You do not have the required permissions to view the files attached to this post.
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari /
Steem SSE /
Aranym /
Saint
http://260ste.atari.org
ThorstenOtto
Fuji Shaped Bastard
Posts: 3329 Joined: Sun Aug 03, 2014 5:54 pm
Post
by ThorstenOtto » Fri Sep 15, 2023 12:54 pm
Interesting. But what exactly is the ´size of the operation´? Ie when you do a
Then a3 will be saved first. Will the saved value be original value -4, or original value - 16?
agranlund
Captain Atari
Posts: 151 Joined: Sun Aug 04, 2019 1:49 pm
Post
by agranlund » Fri Sep 15, 2023 2:03 pm
ThorstenOtto wrote: ↑ Fri Sep 15, 2023 12:54 pm
Interesting. But what exactly is the ´size of the operation´? Ie when you do a
Then a3 will be saved first. Will the saved value be original value -4, or original value - 16?
It's the .l or .w so should be -4 for movem.l (regardless where the register appears in the register list)
npomarede
Atari God
Posts: 1556 Joined: Sat Dec 01, 2007 7:38 pm
Location: France
Post
by npomarede » Fri Sep 15, 2023 3:21 pm
Hi
what Hatari version are you using for your test ? When using Hatari devel version, this case is correctly suported :
STF :
A0 before: 0000F55E
Saved value: 0000F55E
TT :
A0 before: 000167E8
Saved value: 000167E4
Nicolas
Cyprian
10 GOTO 10
Posts: 3258 Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland
Post
by Cyprian » Fri Sep 15, 2023 4:02 pm
npomarede wrote: ↑ Fri Sep 15, 2023 3:21 pm
Hi
what Hatari version are you using for your test ? When using Hatari devel version, this case is correctly suported :
STF :
A0 before: 0000F55E
Saved value: 0000F55E
TT :
A0 before: 000167E8
Saved value: 000167E4
Nicolas
the issue was reported based on yesterdays build from there:
http://antarctica.no/~hatari/latest/windows/
Today's build shows me:
Hatari_TT_Issue.png
You do not have the required permissions to view the files attached to this post.
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari /
Steem SSE /
Aranym /
Saint
http://260ste.atari.org
npomarede
Atari God
Posts: 1556 Joined: Sat Dec 01, 2007 7:38 pm
Location: France
Post
by npomarede » Fri Sep 15, 2023 4:09 pm
I see you're using "MMU", which I don't by default.
If I use MMU too, then the movem bug is reproducable.
I will have a look at the CPU tables used in MMU mode, maybe sthg is not correctly setup in Hatari for this mode.
Nicolas
Cyprian
10 GOTO 10
Posts: 3258 Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland
Post
by Cyprian » Fri Sep 15, 2023 4:15 pm
ok, I've unchecked the MMU and the result was ok
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari /
Steem SSE /
Aranym /
Saint
http://260ste.atari.org
Eero Tamminen
Fuji Shaped Bastard
Posts: 3899 Joined: Sun Jul 31, 2011 1:11 pm
Post
by Eero Tamminen » Fri Sep 15, 2023 10:21 pm
Cyprian wrote: ↑ Fri Sep 15, 2023 4:15 pm
ok, I've unchecked the MMU and the result was ok
What if you keep MMU enabled, but disable cycle exact "(CE)" and prefetch "(PF)"?
(MMU emu works OK with Linux without them, but breaks when either cache or prefetch emulation is enabled.)
Cyprian
10 GOTO 10
Posts: 3258 Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland
Post
by Cyprian » Sun Sep 17, 2023 9:20 am
Eero Tamminen wrote: ↑ Fri Sep 15, 2023 10:21 pm
Cyprian wrote: ↑ Fri Sep 15, 2023 4:15 pm
ok, I've unchecked the MMU and the result was ok
What if you keep MMU enabled, but disable cycle exact "(CE)" and prefetch "(PF)"?
(MMU emu works OK with Linux without them, but breaks when either cache or prefetch emulation is enabled.)
no change, the same issue.
I'll wait for antarctica build with Andreas' todays patch
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari /
Steem SSE /
Aranym /
Saint
http://260ste.atari.org
npomarede
Atari God
Posts: 1556 Joined: Sat Dec 01, 2007 7:38 pm
Location: France
Post
by npomarede » Mon Sep 18, 2023 8:22 am
Hatari's source have been updated with patch from WinUAE.
Results are now correct when using MMU.
Nicolas