English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Asm / Hardware (https://eab.abime.net/forumdisplay.php?f=112)
-   -   68040 CHK.L bug (https://eab.abime.net/showthread.php?t=102469)

Toni Wilen 29 May 2020 17:18

68040 CHK.L bug
 
Can anyone with 68040 confirm this strange bug:

moveq #0,d1
chk.l #$40000000,d1
moveq #1,d1
rts

This code unexpectedly skips "moveq #1,d1" (d1 is still 0 when RTS is executed). It seems to jump over next word, any single word instruction after CHK.L gets skipped.

But if CHK.L immediate value is for example #$20000000, it works correctly.

My tester found this last year. There is many undefined differences between models but this appears to be real bug. (I can attach test executable later if needed)

daxb 29 May 2020 20:17

Confirmed here on A1200 Apollo 1240.

alexh 29 May 2020 22:46

I'd be curious to know if this bug is only in the XC68040 chips and not in the later MC68040?

Motorola CPUs usually gain MC status only if it has no bugs or they've all been documented.

The MC68040 L88M mask of the 68040 was a very late rework and shrink. Unlike their XC counterparts they are cold to touch at 25MHz

Toni Wilen 30 May 2020 09:49

My 68040 is in Warp Engine and it has glued heatsink (not going to remove it).

68040 also seems to have another bug: RTR or RTE with odd PC in stack: address error stack frame SR is different than actual SR register contents at the start of address error handler. Stacked SR is SR before RTR modifications, real SR is correct.

This bug isn't going to affect any normal code :)


All times are GMT +2. The time now is 18:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05817 seconds with 11 queries