[comp.sys.amiga.programmer] Copper SKIP does not skip WAIT!!!!

mt87692@lehtori.tut.fi (Mikko Tsokkinen) (02/28/91)

 Hello,

 Again I'm programming the copper. From the HRM1.3 page 27:

 The skip intruction causes the Copper to skip the next insruction if video
beam counters are equal to or greater than the value given in the instruction.

Now I was making my copperlist:

Copper2	dc.w	$0001,$8001	; SKIP1 next command allways
	dc.w	$ffff,$fffe	; WAIT1 for frame to end
	dc.w	color,$0fff	; MOVE1 Change bg to white
	dc.w	$ffff,$fffe	; WAIT2 for frame to end

This copperlist should change the bg color to white but it doesn't skip the
WAIT1 instruction.

However this program works fine:

Copper2	dc.w	$0001,$8001	; SKIP1 next command allways
	dc.w	color,$0fff	; MOVE1 change bg to white
	dc.w	$ffff,$fffe	; WAIT1 for frame to end

This copperlist does not change the bg color.

CONCLUSION: SKIP INSTRUCTION SKIPS ONLY MOVE COMMANDS!!!!!!!!!!!

This information is very important to if you are ever making complex
copperlists. Another bug in HRM1.3 (or in the hardware) in two days.

Please someone confirm (from CBM?) is the hardware working wrong or is the
manual wrong or is it just me.

My setup is PAL A2K rev 6.2, 1M CHIP, 8M FAST, A2090, SupraWS, 40MST506 &
Q105LP if that matters.

 MIT

-- 
Bubble Bobble

bairds@eecs.cs.pdx.edu (Shawn L. Baird) (03/01/91)

mt87692@lehtori.tut.fi (Mikko Tsokkinen) writes:

> The skip intruction causes the Copper to skip the next insruction if video
>beam counters are equal to or greater than the value given in the instruction.

>Now I was making my copperlist:

>Copper2	dc.w	$0001,$8001	; SKIP1 next command allways

Try:
	dc.w	$0001,$ff01

This way, you aren't masking off all of the comparison bits so that there is
actually something to compare with, since it only compares the bits that
filter through the mask, and $8001 doesn't leave any bits to compare with.

>	dc.w	$ffff,$fffe	; WAIT1 for frame to end
>	dc.w	color,$0fff	; MOVE1 Change bg to white
>	dc.w	$ffff,$fffe	; WAIT2 for frame to end

>This copperlist should change the bg color to white but it doesn't skip the
>WAIT1 instruction.

True, because of the above. It simply never gets to the color instruction.

>However this program works fine:

>Copper2	dc.w	$0001,$8001	; SKIP1 next command allways
>	dc.w	color,$0fff	; MOVE1 change bg to white
>	dc.w	$ffff,$fffe	; WAIT1 for frame to end

>This copperlist does not change the bg color.

This, I find somewhat odd. It should change the background color since
apparently the skip should fail. Or perhaps the skip will be dependent on
condition codes set earlier or something. Again, try with $ff01, and see
if you get more reasonable results. The skip instruction skips a single
copper command with no prejudices. BTW: you can greatly increase the power
of the skip instruction by having the instructions that you skip over do
things like load a new address into the copper address pointer and then
strobe to it. The copper is a very interesting piece of hardware, probably
more powerful than some of the early micros itself.

>CONCLUSION: SKIP INSTRUCTION SKIPS ONLY MOVE COMMANDS!!!!!!!!!!!

I wouldn't jump to conclusions, as the people who designed the hardware
should have a pretty good idea about how it works. The skip instruction is
documented everywhere to skip a single instruction, and it doesn't make
logical sense to waste time making sure it isn't a wait instruction when
making it skip a wait instruction might be handy.

>This information is very important to if you are ever making complex
>copperlists. Another bug in HRM1.3 (or in the hardware) in two days.

The references to the skip instruction in my 1.3 manual use $ff01 as their
mask value. They probably know what they are doing although they make the
occasionaly typo.

| Shawn L. Baird                        | Or via US Snail:                  |
| bairds@eecs.ee.pdx.edu                | 17650 SE Cason Rd.                |
| ...uunet!tektronix!psueea!eecs!bairds | Gladstone, OR  97027              |

peter@cutmcvax.cs.curtin.edu.au (Peter Wemm) (03/04/91)

smcgerty@vax1.tcd.ie writes:
[....]
>Now that I think of it, I remember someone telling me that it was _quite_
>likely that the Copper _did_ read in the next instruction while waiting for a
>raster position to arrive. This is so that a CWAIT&CMOVE combination will have
>the CMOVE precalculated and 'ready to go' the _instant_ the CWAIT position
>arrives.

I am fairly sure you are right.  I understand the next instruction is
prefetched and decoded.  When they say a cwait takes 6 clocks (or is that
pixels??) I assume that includes getting the next unstruction ready.

My guess is that a CWAIT 'breaks' the CSKIP instruction by accessing some
of the components of the copper what are used during the wait.

--
Peter Wemm
------------------------------------------------------------------------------
peter@cutmcvax.cs.curtin.edu.au (if fails, try peter@cutmcvax.oz.au)

smcgerty@vax1.tcd.ie (03/04/91)

In article <MT87692.91Feb28021402@lehtori.tut.fi>, mt87692@lehtori.tut.fi (Mikko Tsokkinen) writes: 
> [Quote from HW ref. manual]
>  The skip intruction causes the Copper to skip the next insruction if video
> beam counters are equal to or greater than the value given in the instruction.
>
> [Examples of CSKIP]
>  
> CONCLUSION: SKIP INSTRUCTION SKIPS ONLY MOVE COMMANDS!!!!!!!!!!!
> 
> This information is very important to if you are ever making complex
> copperlists. Another bug in HRM1.3 (or in the hardware) in two days.

Hang on, what's the point in skiping a CWAIT? CSKIP does everything a CWAIT can
do. CSKIP is intended to be used as part of a CopperList REPEAT..UNTIL loop
constuct, where it skips the 'GOTO' if the 'condition' is TRUE. I can't think
of a CList which needs a conditional CWAIT, that can't just be expanded out
or something. Memory's cheap!! 8-)
 
> Please someone confirm (from CBM?) is the hardware working wrong or is the
> manual wrong or is it just me.

It _is_ a bit unusual though! That seems to imply that the Copper actually
reads the instruction after the CSKIP while Waiting, and either jumps it 
or not depending: 
a) on the raster position (as per norm) and
b) on the actual instruction read after the current CSKIP (a bit odd..)
Now that I think of it, I remember someone telling me that it was _quite_
likely that the Copper _did_ read in the next instruction while waiting for a
raster position to arrive. This is so that a CWAIT&CMOVE combination will have
the CMOVE precalculated and 'ready to go' the _instant_ the CWAIT position
arrives.

Perhaps the 'bug' you noticed is intentional. Perhaps not! 8-)
I'll try it on my Copper, how about some others trying it on theirs? The 'bug'
might have been fixed.
      
> 
>  MIT
> 
> -- 
> Bubble Bobble

Stephen

----------------------------------------------------------------------------
|  / T | /  Stephen John McGerty           |                     Amiga  // |
|  / | |/   smcgerty@vax1.tcd.ie (C.Sci.)  | "Hmm.. No, nothing."    \\//  |
|__________________________________________|_______________________________|

#! r

mt87692@tut.fi (Mikko Tsokkinen) (03/05/91)

In article <1991Mar4.095014.7896@vax1.tcd.ie> smcgerty@vax1.tcd.ie writes:
> Path: news.funet.fi!sunic!mcsun!ukc!tcdcs!swift.cs.tcd.ie!vax1.tcd.ie!smcgerty
> In article <MT87692.91Feb28021402@lehtori.tut.fi>, mt87692@lehtori.tut.fi (Mikko Tsokkinen) writes: 
> > [Quote from HW ref. manual]
> >  The skip intruction causes the Copper to skip the next insruction if video
> > beam counters are equal to or greater than the value given in the instruction.
> >
> > [Examples of CSKIP]
> >  
> > CONCLUSION: SKIP INSTRUCTION SKIPS ONLY MOVE COMMANDS!!!!!!!!!!!
> > 
> > This information is very important to if you are ever making complex
> > copperlists. Another bug in HRM1.3 (or in the hardware) in two days.

> Hang on, what's the point in skiping a CWAIT? CSKIP does everything a CWAIT can
> do. CSKIP is intended to be used as part of a CopperList REPEAT..UNTIL loop
> constuct, where it skips the 'GOTO' if the 'condition' is TRUE. I can't think
> of a CList which needs a conditional CWAIT, that can't just be expanded out
> or something. Memory's cheap!! 8-)

 Hi,

 To me it does not matter is wise or not but WHY DO THEY PRINT LIES IN THE
HARDWARE REFERENCE MANUAL. Everything can be made without the skip command,
or for that matter without wait or move, or the whole copper.
 Orginally my intention was to inform people out there that the copper
is not skipping wait commands (and still is). So forget about "skips
all commands" but edit to your manual instead "Skips following MOVE command".

 MIT


--
      ///                             AMIGA
     ///   Pal A2k rev6.2, Kick1.3, 1MB chip, 2x3.5"floppy, 2090A & 40M HD.
\\\ ///     
 \\X//                                                           MIT