Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!ucbvax!bloom-beacon!eru!kth.se!sunic!mcsun!ukc!mucs!jdg From: jdg@cs.man.ac.uk (Jim Garside) Newsgroups: comp.arch Subject: Re: What about loop instructions? Message-ID: <2413@m1.cs.man.ac.uk> Date: 16 Apr 91 09:28:37 GMT Sender: news@cs.man.ac.uk Reply-To: jdg@cs.man.ac.uk (Jim Garside) Organization: Department of Computer Science, University of Manchester UK Lines: 21 [ ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:- ] > ... I saw some code which showed me the *right* > way to use the DBRA instruction on a 68000. I was impressed! This > instruction lets you handle an initial loop count of zero without a > separate check. My question: what is the *right* way to use a DBcc instruction and (why does it not have deleterious effects on prefetching)? Seriously: 680x0 DBcc Decrement a (16-bit) register and terminate if it becomes FFFF or if a specified condition is met. 80x86 LOOP Decrement (16-bit) CX register and terminate if 0000 Z80 DJNZ Decrement (8-bit) B register and terminate if 00 Transputer LEND Increment one memory location (16-/32-bit), decrement an adjacent one and terminate if the latter is 0000(0000) ... Jim Garside jdg@cs.man.ac.uk