[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [oc] Processor Instruction reply for Andreas




--- Paul McFeeters <paul.mcfeeters@ntlworld.com>
wrote:
> Andreas,
> 
> > > Old Way:
> > >
> > > 	CMP AX,$2000
> > > 	JC  #4000
> > >
> > > Two instructions to do that? Why use two clock
> cycles for that? Can't we
> > > just have a CMPJxx instruction? Takes two
> values/register combinations
> and
> > > based upon the results of the comparisons jumps
> to the destination or
> not.
> 
> > There are two things to be done.  A subtraction
> and a conditional jump.
> > Just because you put them in the same instruction
> doesn't make them in
> > one cycle.  If they do execute in one cycle, I
> guess the cycles on that
> > machine are generally longer.
> 
> Wrong. I tested it out and it makes simple sense.
> When a compare is done
> then
> the HDL copies the value of '1' into the relevant
> flag. As any HDL
> programmer
> will tell you copying a 32bit value versus 1 bit
> doesn't take a ps longer so
> my way is quicker.

<snip>

I'm not a CPU core developer nor do I have years of
experience programming in assembler, and I haven't
been following this thread, so pardon any
misunderstandings... But I think the reason these sort
of things used to be done in two instructions is
because there weren't enough bits to encode
instruction opcodes. Having CMPJxx, JSRxxx, and so on
would chew up too many opcodes for an 8-bit CPU.

Victor Snesarev

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
--
To unsubscribe from cores mailing list please visit http://www.opencores.org/mailinglists.shtml