🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #11070

Relatively long cycle time in 486 LOOP instruction

#11070
From: David Fox
Date: Wed, 16 Dec 1992 06:02
24 lines
1483 bytes
Hi.  This is my first posting to this newsgroup.

I and others on a different network have had an ongoing thread about
386/486 assembler programming in general.  One has posted recently
that the 486's LOOP and JMP [E]CX instructions seem to take an
inordinately long time, compared to other instructions that branch.

I don't have a 486 hardware manual, so I cannot be absolutely sure
of the timings, but apparently the LOOP instruction seems to eat
at least 3 cycles more than we think it should.

At most, the various parts of a LOOP instruction (decrementing the
ECX register, testing against zero) should only take maybe two
clocks.  However, the information I got on the clock timings for
LOOP consumes about three cycles in addition to the time we think
the decrement, test, and jump take.

Is the 486 doing anything special in a LOOP instruction to justify
these three extra cycles?  Specifically, is it doing something extra
with the flag register to ensure that the flags don't get modified
in the process?
--
David Fox
dfox@quack.sac.ca.us
Technical Details
Message-ID: <fWFHrqe@quack.sac.ca.us>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!pacbell.com!tandem!UB.com!quack!dfox

Show Full Headers
Complete Article Headers
Newsgroups: comp.arch
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!pacbell.com!tandem!UB.com!quack!dfox
From: dfox@quack.sac.ca.us (David Fox)
Subject: Relatively long cycle time in 486 LOOP instruction
Message-ID: <fWFHrqe@quack.sac.ca.us>
Keywords: 486 LOOP instruction cycle
Organization: The Duck Pond public unix: +1 408 249 9630, log in as 'guest'.
Date: 16 Dec 1992 06:02:51 UTC
Lines: 25