Re: [hatari-devel] Wrong bus error stack frame with 68000 and JSR |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Wrong bus error stack frame with 68000 and JSR
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Fri, 22 Mar 2024 18:53:58 +0100
- Autocrypt: addr=czietz@xxxxxxx; keydata= xsFNBGMHkrYBEACc4fljFVcoEo+DzmhTRd8pOfnj39wkNL+VEIzUpz5OfxFNx/KYWhtHxLN9 VWD3rojS5ww3bNgWiYdqDLisuaO6jLXZ7JNBQU3ruJg+g4iCuwfwFf/tVAHvMCr5U/ibiE94 VZuHs6yYJnXHuKrZEBzWQTEPHltqFLVq+cr4dzMV14SIWP8/OnUCaQeeCE1jdh8itXw75Cv9 Bc4wqhT1eU75WmcUwJ1hNrwZm6M2acFoABmZL0CWm0L8+7PXDgZXlwyNoWuPoupjuAvjsdsY 5x+uWtfyufrC/auTcc7LKiAxRQcZ/ABtLhnAa13Su4BsrVwJIxFIGDrZe/CpX48CvYdWljQF JqElP5ShsaM01odrLhmS8OreMEODo6Vhr3zqs3wUA/bl8gEkxDbSz0LewqC07sajTiYIVABW bVWkyn2T8JANSbtVV9YgUnbK+CsMckruarab1iSrTBB+aTvK5TN7LP4iKHaXfZAbq5wtQfXe yrvyPjkbmzvbYb+lnVe24fqLQS1RVB6p/LGAkKFBT1SjEQWVtzVIiAAlbjhRxIsdOqJK1kl/ 6GyQyGfUlPByUETzzFKe6qcCtQlUZPwd7vquryw+3PSVkhL9PiEtUSMiOIVpRzfomxwKXNGT avDoYjTZL1ROuzQYfL+ekpGu4Ti53GGxagxJT1tBhon1qUkMwwARAQABzSBDaHJpc3RpYW4g WmlldHogPGN6aWV0ekBnbXgubmV0PsLBkQQTAQgAOxYhBElYYBdDcemT9uBa0ocIs0yCexWe BQJjB5K2AhsDBQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJE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+LFOxb6pQEdIuaAy8=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1711130039; x=1711734839; i=czietz@xxxxxxx; bh=V4lodO/bCdxtVZpBNVg7/HzRBGpiOmVhfcgebEZGAkI=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=ovgWTSYHev6/R7frD54KHAIFx4YxN9BQuyeuW9PzCTk8RCryAE7U8QwRQ32LgwKl WWzHyAGvZ5JX2HUPzx2G0lDYihhA1nDuIzl1xPtSBp986MRM0SNeTabEPRaivsQ2W tZOyZQFDrL74q7tcWF0DwB6jD5qSETjw9Rc5S03FhfEGpJJ//DXwSjh0h53bwA0Dk Ab5nb90NIhZtPm0xGjYtvjPbUkXWtY1LZfXd+zFjAUagfkxXjc1qu6F9HkGNNIca1 yOoHRsosnS/1PwQbc8qHtzgm8y5JB2J0OWppLhrN45SWg9pB7Jh7PzsrIhjxWBZU/ evkHLPtEaWY8ob+j1g==
- Ui-outboundreport: notjunk:1;M01:P0:yHzIkgLQwd8=;ew3YnSu+rLI0C966H6+hAJtDKOl VQ6ZIrqdOudsDjQfW/sEl1mtU9aMi1fyTHModiGe6yqRy3m38qX7AYdKWBg+TmhAWoBS5pKVR x9Wo2BQ5HfxsKCqL/sw6OuR/CJjUXiLZ5qag6IO2xfWLbXB7PkugCg7WxfedUcOXeEp8ne4k7 ZD56wqFk9zfIK+lyRl/iVW74OBbgNgW1A2M5JTifZlKwd2vwpIZuLVAO1He2VKSUhJpIXNcx2 ADgwtvFRu2ZRX8cYhh2Y3KeqTe4SidyMv47JHiFroganaM9j5Ms5w37OLVS2RALoJT1EOMXiS NaFnoo8LD9wf/mRfGMjISVxjFpfM2Iwu7xt9v6r5U3JXknDtn8UjfpTo7qdg+wgNDzwArLx/N 93F/gtx8QotsjwXLKYtum/s5fVfVWT4/nOQsBelBYRz7OLMi48PbwPDQi0ilQ7cW96Ztj5xm/ lnrIGlF7+5ABGT+z8J4wKg6u7gxZqJHw4pZ3B/0GMSmkX5LroigqIUH33FebAbTyAGJrqhCm2 4Qs2Dk6nDRp/au2avWDCzMwTi4CK7I6Xr11CS1miPnlRGLk6RIrrSoiz/8sk0ysiOr/KrYccs SexBtKEN7zJo+HoIhJLw76VI1aFzfqZ3+4Y2HBihSUR9gUax2lcke4vXy3GeONulzeW5pa6mc RYZokMO28iNkxs4/3JOvt6P8Do/YOfZqZs0GplZkezA9T/HKp7V872RRBmdabVbRzazakWI4C LyAATdflDkGjn5owi/goUApM8oyycDgHGIPhuf2vSOCwbH/4UxglD5pP5ptvw/8uHVrkKzqeP NiNhf0+PRM/Qw5klJuOPvlP2YO/b4m+zClBfjSAXNsTSk=
Christian Zietz schrieb:
I.e., for branches, jumps and returns, the stacked PC is "near" the PC
of the branch/jump/return instruction, and not the target of this
instruction. Sadly, the exact offset is not documented, and probably
depends on instruction and addressing mode.
Today, I did some more testing on a real 68000. The stacked PC has the
following offset to the offending JSR:
JSR xxx.L 6 bytes
JSR xxx.W 4 bytes
JSR (Ax) 2 bytes
JSR n(Ax) 4 bytes
JSR n(Ax,Dx) 4 bytes
JSR n(PC,Dx) 4 bytes
The offsets correspond to the length of the instruction; in other words,
the stacked PC in the exception frame points to the start of the
instruction after the JSR. I could not test "JSR n(PC)" because I cannot
easily get a bus error with my tester there. My expectation would be a 4
byte offset.
I'd like to leave it to Toni to repeat these tests for JMP, Bcc, BSR,
RTS etc. Or maybe the answer can be found in the 68000 microcode,
without testing.
Regards
Christian
--
Christian Zietz - CHZ-Soft - czietz@xxxxxxx
WWW: https://www.chzsoft.de/
New GnuPG-Key-ID: 0x8708B34C827B159E