English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 13 January 2020, 17:50   #1
sparhawk
Registered User
 
sparhawk's Avatar
 
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.
sparhawk is offline  
Old 13 January 2020, 17:56   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by sparhawk View Post
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.
A hint: there are two copper pointers
ross is offline  
Old 13 January 2020, 19:33   #3
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
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.
mc6809e is offline  
Old 13 January 2020, 21:02   #4
sparhawk
Registered User
 
sparhawk's Avatar
 
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?
sparhawk is offline  
Old 14 January 2020, 08:45   #5
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
Quote:
Originally Posted by sparhawk View Post
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?
Quoting from http://amigadev.elowar.com/read/ADCD.../node0049.html:

Quote:
SKIP the next instruction if the video beam has already reached a specified screen position.
Kalms is offline  
Old 14 January 2020, 09:05   #6
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
Quote:
Originally Posted by Kalms View Post

I know what it does, but it was not clear to me, under which circumstances this condition occurres.
sparhawk is offline  
Old 14 January 2020, 09:45   #7
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by sparhawk View Post
I know what it does, but it was not clear to me, under which circumstances this condition occurres.
It is a very sporadic use and in any case for complex situations.
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
(I implied the prior setting of the 2 COPxLC pointers)

Off course durig subroutine execution you can completely change copper flux because you can 'jump around' with the two copper pointers.
ross is offline  
Old 14 January 2020, 10:19   #8
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
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.
roondar is offline  
Old 14 January 2020, 10:35   #9
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by roondar View Post
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.
Blitter can do some basic math (with big effort just to do a sum ).
And can modify copper list, so probably a full simple math program can be done.
But I certainly don't try it
ross is offline  
Old 14 January 2020, 11:15   #10
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
Quote:
Originally Posted by roondar View Post
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.
In "De Profundis" on the roto-zoom,it uses combinations of SKIPs and COPJMP's to create loops... it repeats each line of moves, 4 times
DanScott is offline  
Old 14 January 2020, 13:14   #11
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
Quote:
Originally Posted by sparhawk View Post
I know what it does, but it was not clear to me, under which circumstances this condition occurres.
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.
Kalms is offline  
Old 14 January 2020, 13:15   #12
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Quote:
Originally Posted by ross View Post
Blitter can do some basic math (with big effort just to do a sum ).
And can modify copper list, so probably a full simple math program can be done.
But I certainly don't try it
Quote:
Originally Posted by DanScott View Post
In "De Profundis" on the roto-zoom,it uses combinations of SKIPs and COPJMP's to create loops... it repeats each line of moves, 4 times
Ah, I love the Amiga chipset sometime. This kind of stuff is very cool

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
roondar is offline  
Old 14 January 2020, 13:56   #13
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by roondar View Post
Though knowing me, it'll probably take a year
Fully acceptable
ross is offline  
Old 14 January 2020, 17:10   #14
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
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."
NorthWay is offline  
Old 14 January 2020, 18:03   #15
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by NorthWay View Post
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.

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.
StingRay is offline  
Old 14 January 2020, 18:47   #16
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
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.
Toni Wilen is online now  
Old 14 January 2020, 19:50   #17
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,309
Stupid question: When the vertical beam reaches the bottom of the frame the copperlist restarts right?
nogginthenog is offline  
Old 14 January 2020, 21:05   #18
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
AFAIK it restarts with the VBI.
sparhawk is offline  
Old 14 January 2020, 23:43   #19
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by ross View Post
Blitter can do some basic math (with big effort just to do a sum ).
And can modify copper list, so probably a full simple math program can be done.
But I certainly don't try it
The blitter can actually compute any computable function since it can implement cellular automata and there exist universal CA that can compute anything a Turing machine can.

An interesting example of a CA using the blitter to implement Conway's Game of Life is here.
mc6809e is offline  
Old 15 January 2020, 12:53   #20
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Quote:
Originally Posted by mc6809e View Post
The blitter can actually compute any computable function since it can implement cellular automata and there exist universal CA that can compute anything a Turing machine can.

An interesting example of a CA using the blitter to implement Conway's Game of Life is here.
Fascinating stuff... Though probably not all that efficient for solving some problems I guess.
roondar is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09948 seconds with 15 queries