English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Asm / Hardware (http://eab.abime.net/forumdisplay.php?f=112)
-   -   Is move.l atomic (http://eab.abime.net/showthread.php?t=100156)

sparhawk 25 December 2019 20:28

Is move.l atomic
 
When I execute something like this:


Code:

lea NewFunction, a0
move.l a0, VBIService


The VBI looks like this (not complete):
Code:

...

move.l VBIService, a0
jsr(a0)
...
rte


So can it happen, that the VBI is happening while one half of the ptr is written, so that the jsr will be corrupted? Or is the instruction atomic, so that it is either written, or the old value is still valid? I would expect that it is safe, since we are dealing only with single core here, right? Or are there any other pitfalls involved which might cause a crash with such code?

deimos 25 December 2019 20:43

Instructions are atomic, yes. Interrupts only happen between instructions.

Plenty of other things can go wrong though.


All times are GMT +2. The time now is 14:16.

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

Page generated in 0.07075 seconds with 11 queries