On Mon, 2001-09-10 at 09:16, Bryan C. Warnock wrote:
> On Monday 10 September 2001 10:28 am, Brian Wheeler wrote:
> >
> > I was thinking about NOP this morning, and I realized that it might very
> > well be necessary.  If someone was writing a "simple" assembler for
> > parrot, it might be useful for padding.
> 
> Pad what?
> 

How about preserving offsets during an optimization phase:

        add i3,i1,1
        add i3,i3,8

could become

        add i3,i1,9
        nop

without having to recompute offsets for later bytecode.

In the same way, you could also use it for reserving space for things
like debugging code, like adding 10 nops if debugging is turned off, and
using those 10 instructions for debugging if it is turned
on....maintaining the relative addresses of things.  Of course, one
could just recompile using the parrot assembler, so this would only be
for those tinkering with their own assembler, I suppose.

Honestly, I don't care either way, since add i0,i0,0 is the same
(basically) as a nop, but takes a little more cpu.  One could always
#define nop add i0,i0,0
:)

Brian



Reply via email to