[virtmach] instruction set

Dennis Yelle dennis51@jps.net
Tue, 18 Apr 2000 12:11:06 -0700


Dennis Yelle wrote:
> 
> thaddaeus.frogley@creaturelabs.com wrote:
> >
> > Hi,
> >
> > Quick question.  Don't feel obliged to justify your answer.
> >
> > When trying to create an instruction set for a 3 address machine, assuming
> > that the following already exist:
> >
> >   jump target
> >   jump-if-zero a,target
> >   jump-if-non-zero a,target
> 
> Well, assuming I already have:
> 
> subtract a,b,c
> jump-if-negative a, target
> 
> And assuming I am short of op code space,
> I don't need any of these:
> 
> >   jump-if-equal a,b,target
> >   jump-if-less a,b,target
> >   test-if-equal a,b,result
> >   test-if-less a,b,result

Well, now that I think about that for a few more minutes,
I see that I was wrong about that.

Because this:

   if ( a < b )

is not the same as this:

   if ( (a-b) < 0 )

Sorry.

Dennis Yelle