Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!psuvax1!rutgers!cbmvax!cbmehq!cbmger!peterk From: peterk@cbmger.UUCP (Peter Kittel GERMANY) Newsgroups: comp.sys.amiga.tech Subject: Re: Assembly question from turnip Keywords: can allocmem crash? Message-ID: <543@cbmger.UUCP> Date: 30 Oct 90 13:31:59 GMT References: <2169@lpami.wimsey.bc.ca> <1990Oct29.205140.28826@zorch.SF-Bay.ORG> Reply-To: peterk@cbmger.UUCP (Peter Kittel GERMANY) Organization: Commodore Bueromaschinen GmbH, West Germany Lines: 23 In article <1990Oct29.205140.28826@zorch.SF-Bay.ORG> xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) writes: >lphillips@lpami.wimsey.bc.ca (Larry Phillips) writes: > >>There is no guarantee that the last operation to affect the condition codes is >>the one you are interested in (the move of the result to D0). In other words, >>the result might be moved to D0, then something else moved to or from another >>data reg, before control is returned to your program. > >WHAT? How can you do multitasking at all, if whatever's the 68000's >version of the program status register's set of condition flags, isn't >restored after a context switch? ^^^^^^^ He didn't talk about a context switch but about returning from a system function called by your program, and this hasn't anything to do with multitasking and task switching. He explained what can happen near the very end of such a library routine, shortly before the finishing RTS. The simple summary is: Do a TSTB or other check for the flags by your own, but don't rely on the flags being set just after RTSing. -- Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk