WinUAE icon indicating copy to clipboard operation
WinUAE copied to clipboard

BKPT instruction (68010) pushes a wrong stack frame

Open dirkwhoffmann opened this issue 2 years ago • 1 comments

As part of the vAmiga regression test suite, I've written a small program which calls BKPT and dumps the generated stack frame:

On my real machine (A500 ECS, 68010, 512 Chip, 0 Slow, 0 Fast) it looks like this:

stackframe3_A500_ECS_68010

In UAE 4.9.1 I get this:

Bildschirmfoto 2022-11-15 um 16 10 53

It seems like the PC pushed by UAE is too high by 2.

dirkwhoffmann avatar Nov 15 '22 15:11 dirkwhoffmann

I am not 100% sure what the output means but if 2/4 means stacked PC is +2/+4 from start of BKPT, I get expected +2 if I check what your test program does in UAE debugger.

00075750 lea.l (pc,$0000) == $00075752,a6 00075754 bkpt #$02

If above suspicious LEA is corrected, it looks like BKPT does not increase PC. I am planning to do full 68010 tester check later.

(and I still hate adf based test programs :))

tonioni avatar Nov 17 '22 18:11 tonioni