13 January 2020, 17:50 | #1 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Copper SKIP instruction
While the copper instructions are easy to understand in itslef, it's really cool what kind of stuff you can do with it. However, I was wondering what an actual use case would be where the SKIP instructions can be used. I don't see how much benefit it would be to skip the next move instructions, because you can only skip a single line which hast to be a MOVE, right?
I also don't see when the SKIP instruction would actually trigger, or is this only the case when the copper starts the blitter and waits for it? In that case I could see that the SKIP can trigger, but I don't see how a single MOVE can make much of a difference then. |
13 January 2020, 17:56 | #2 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
Quote:
|
|
13 January 2020, 19:33 | #3 |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 373
|
Skip allows for conditional execution.
The logic of it can be confusing. Often the instruction being skipped is a strobe to change the flow of execution. In effect this causes execution of the current list to continue if the condition is TRUE. The current list may be a loop so the skip can be seen as skipping a break statement as in C. |
13 January 2020, 21:02 | #4 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Now the piucture becomes clearer. I was not aware when I started to with the copper, that the copper can wait for the blitter to finish which is probably the only condition that can cause the SKIP to trigger, right?
|
14 January 2020, 08:45 | #5 | ||
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
Quote:
Quote:
|
||
14 January 2020, 09:05 | #6 | |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
I know what it does, but it was not clear to me, under which circumstances this condition occurres. |
|
14 January 2020, 09:45 | #7 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
Quote:
Suppose you wrote a copper subroutine (which is not very common already). You want to execute it only if you are in or after the 100th line of the screen, otherwise immediately returns to the main flow. The subroutine could start with: Code:
SKIP if yPOS >= 100 MOVE to COPJMP1 ;return copper_subroutine MOVE to COPJMP1 ;return Off course durig subroutine execution you can completely change copper flux because you can 'jump around' with the two copper pointers. |
|
14 January 2020, 10:19 | #8 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
|
I always wondered how close you can get to a 'full program' using the Copper. Using skip and move to COPJMPx you should be able to at least conditionally jump. It seems to me you should also be able to create loops. Perhaps other common programming constructs are also possible using skip/move?
Probably breaks down if you want to start doing math, though. |
14 January 2020, 10:35 | #9 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
Quote:
And can modify copper list, so probably a full simple math program can be done. But I certainly don't try it |
|
14 January 2020, 11:15 | #10 | |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
|
Quote:
|
|
14 January 2020, 13:14 | #11 |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
Alright. Think about it like this: when the Copper reaches the SKIP instruction, it will test the blitter busy flag (if requested), and perform a masked comparison against the current VHPOSR register value. It will then increment the current copper read pointer by 4 or 8, depending on the comparison results. It will not wait for anything to happen.
Last edited by Kalms; 14 January 2020 at 14:17. |
14 January 2020, 13:15 | #12 | ||
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
|
Quote:
Quote:
I'm gonna go and think about Copper loops, Copper subroutines and Blitters doing basic math a bit now. Might come up with something cool. Though knowing me, it'll probably take a year |
||
14 January 2020, 13:56 | #13 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
|
14 January 2020, 17:10 | #14 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 853
|
I had this rough idea that you could do a complete blitter+copper basic logic building blocks where you run a simple demo purely by them with the cpu halted with a STOP instruction.
"You can now remove your cpu." |
14 January 2020, 18:03 | #15 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Something like this has been already done back in the early 90s, I think it was Amicom/Spreadpoint who made a demo that would be able to run without CPU once the init code was run. |
|
14 January 2020, 18:47 | #16 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Just a quick reminder that SKIP isn't actually skipping much:
"Skipped" instruction is still processed normally (DMA slot usage won't change, no DMA slots saved). Only difference is that if following instruction is MOVE, MOVE's register write becomes dummy write. If following instruction is WAIT or SKIP: it is executed normally. |
14 January 2020, 19:50 | #17 |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,317
|
Stupid question: When the vertical beam reaches the bottom of the frame the copperlist restarts right?
|
14 January 2020, 21:05 | #18 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
AFAIK it restarts with the VBI.
|
14 January 2020, 23:43 | #19 | |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 373
|
Quote:
An interesting example of a CA using the blitter to implement Conway's Game of Life is here. |
|
15 January 2020, 12:53 | #20 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Combining copper scrolling with copper background | phx | Coders. Asm / Hardware | 16 | 13 February 2021 12:41 |
Bug with the Copper SKIP instruction ? | Yragael | support.WinUAE | 5 | 08 August 2017 20:13 |
Best way to mix blitting with copper and copper effects | roondar | Coders. Asm / Hardware | 3 | 12 September 2016 13:12 |
Copper SKIP after SKIP | neoman | support.WinUAE | 3 | 29 June 2015 16:46 |
The Settlers... intro skip | Djay | support.Games | 4 | 13 November 2003 23:37 |
|
|