Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: 68000 DBcc command Message-ID: <8807160744.AA20751@cory.Berkeley.EDU> Date: 16 Jul 88 07:44:38 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 36 :had been set by a previous operand earlier in the program. I ran through :the code section several times, checking the looping mechanism (DBEQ) with :the Z flag set and cleared. Strangely, the DBEQ command would only decrement :d3 whenever the Z flag was cleared. According to the Motorola 68000 reference :manual, the condition codes play no role in any DBxx command. What is going on? : What I want to know is: Is this problem caused by my debugger and the :looping problem exists somewhere in MY code OR is this an undocumented :feature for the DBxx series of commands? Specifically, motorola says this: if specified-condition-is-false Dn.W = Dn.W - 1; if (Dn.W != -1) then loop, else break out of the loop else break out of the loop. I.E. the (word sized) data register is only decremented when the condition is FALSE. When the condition is TRUE, the loop is broken out of WITHOUT decrementing the data register. The loop is also broken out of when the data register reaches -1 (word sized). Quoted without permission: "The instruction first tests the condition to determine if the termination condition for the loop has been met, and if so, NO OPERATION is performed. If the termination condition is not true, the low order 16 bits of the counter data register are DECREMENTED by one. If the result is -1, the counter is exhausted and execution contiues with the next instruction" (i.e. no branch) "If the result is not equal to -1, execution continues at the location indicated by the current value of the PC plus the sign-extended 16 bit displacement." (i.e. branch). -Matt