Subject: Re: [stella] An Efficient Waste Of Time From: "Andrew Davie" <adavie@xxxxxxxxxxx> Date: Fri, 18 Oct 2002 20:01:20 +1100 |
Chris check out the thread http://www.biglist.com/lists/stella/archives/199805/msg00090.html Cheers A ----- Original Message ----- From: "Christopher Tumber" <christophertumber@xxxxxxxxxx> To: <stella@xxxxxxxxxxx> Sent: Friday, October 18, 2002 8:01 AM Subject: [stella] An Efficient Waste Of Time > One thing I've found... annoying if wasting a bunch of ROM space doing noting. That is, burning cycles for timing purposes but at the cost of ROM space. Ideal solution would be various flavour NOPs, all using 1 byte but consuming 2-a bunch of cycles. Unfortunately that's just not the case. > > So these are the instructions and instruction combinations that I've been using to waste cycles. Anybody have any better ones? > > > > > -------------------------------------------------------------------------- > > 1 Cycle (0 or 1 byte) > .w (Make a zero page instruction an absolute instruction) > or > ,x (Make a zero page or absolute instruction an indexed instruction) > > Notes: .w adds a byte of code. > ,x needs x=0 (can also use y register) > > -------------------------------------------------------------------------- > > 2 Cycles (1 byte) > NOP > > -------------------------------------------------------------------------- > > 3 Cycles (2 bytes) > STA $ZeroPage > or > LDA $ZeroPage > or > DOP $ZeroPage > > Notes: STA/LDA Destroys register or RAM location (use scratch variable) > > -------------------------------------------------------------------------- > > 4 Cycles (2 bytes) > NOP > NOP > > -------------------------------------------------------------------------- > > 5 Cycles (2 bytes) > dec $ZeroPage > > Notes: Destroys RAM location (use scratch variable) > > -------------------------------------------------------------------------- > > 6 Cycles (3 bytes) > NOP > NOP > NOP > > -------------------------------------------------------------------------- > > 7 Cycles (2 bytes) > PHA > PLA > > Notes: Don't overflow stack > > -------------------------------------------------------------------------- > 8 Cycles and more - combinations of the above, or loop. > > > [You can use PHA/PHP (1 byte 3 cycles) or PLA/PLP (1 byte 4 cycles) alone but you have to be carefull not to mess up your stack (PLP/PHA would be usefull if you have no stack!)] > > > > Chris... > > -------------------------------------------------------------------------- -------------------- > Archives (includes files) at http://www.biglist.com/lists/stella/archives/ > Unsub & more at http://www.biglist.com/lists/stella/ > > ---------------------------------------------------------------------------------------------- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] An Efficient Waste Of , Christopher Tumber | Thread | Re: RE: [stella] Space Instigators , Thomas Jentzsch |
Re: [stella] An Efficient Waste Of , Manuel Polik | Date | Re: [stella] An Efficient Waste Of , Thomas Jentzsch |
Month |