01 May 2016, 07:51 | #41 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
|
Probably a good idea. If it was too complicated, you might also only get two entries which would not be much fun. It should be simple enough so that people with mediocre skills could join in and make something (perhaps not win, but at least make a pitch).
|
01 May 2016, 12:46 | #42 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
N-balls colliding on screen
(http://vobarian.com/collisions/2dcollisions2.pdf) |
02 May 2016, 08:19 | #43 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
I second that.
|
03 May 2016, 02:34 | #44 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
We seem to be going around in circles a bit.
Maybe if we just nominate someone to run the first round, they can come up with a goal and judging rules. Then people can enter the round if they find it interesting. If we get enough entries, the competition goes ahead. |
03 May 2016, 07:45 | #45 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 818
|
|
03 May 2016, 10:39 | #46 |
Linux snob
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
|
Nice. I'll be the cheerleading squad.
|
11 May 2016, 22:57 | #47 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,753
|
So... what are we going to write, then?
|
12 May 2016, 14:11 | #48 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,753
|
Guys?
|
12 May 2016, 15:05 | #49 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Appears they are sleeping
Who runs the compo and who participates ? |
12 May 2016, 22:21 | #50 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,753
|
|
12 May 2016, 23:08 | #51 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
DanScott is arranging it I guess, but he's busy with his game too.
I have a small one for you to warm up with: You're given two unsigned 32-bit integers in D0 and D1. Write a subroutine that determines if D0 is greater or equal to 2/3 of D1. F.ex. if D1 is 14, then 2/3 of that is 9.333... and so 9 is not enough, and D1 must be 10 or greater. D0 and D1 can take on all possible 32-bit values. No pre-computed tables are allowed, and it must be plain 68000 code. Other than that you can can return your result in any form and any machine register you want. The shortest subroutine wins. |
12 May 2016, 23:32 | #52 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
I'm alive Been busy with a gazillion things...
Let's go with Leffmans "warm up" challenge... I'll post my result tomorrow evening |
13 May 2016, 08:18 | #53 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
In code size or number of instructions ?
Last edited by meynaf; 13 May 2016 at 08:18. Reason: oops - misread |
13 May 2016, 09:04 | #54 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Ok, first version here anyway :
Code:
move.l d0,d2 lsr.l #1,d2 add.l d2,d0 bcs.s .done cmp.l d0,d1 .done Instead of comparing D0 vs 2/3 *D1, we could do 3*D0 vs 2*D1 but it's the same as 1.5*D0 vs D1. If 1.5*D0 doesn't fit in 32 bits then it can't be <D1 (hence the bcs). Carry generated by lsr doesn't matter (cmp 10 with 9 is same as cmp 10 with 9.5 ; cmp 10 with 10.5 is same as 10 with 10 because it's greater or equal we want to know). |
13 May 2016, 11:54 | #55 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
OK that's a very short solution, but maybe I was a bit too lax on the restrictions when I said "any form and any machine register", because in this form you can't use the code with any branch at all. You have to read the CCR and look at the bits individually, which also means that on M68000 you have to go into supervisor mode to actually make use of that code, and on M68020 and later we don't have MOVE from SR. The idea is that the code should run on all machines.
So let's agree that you either have to set the condition codes correctly so that you can use BHS/BCC, or return a non-zero result in any data register to indicate that the condition holds true. Sorry about that. Though hold off posting any code for a while, other people may want to have a go, and posting a solution right underneath the problem takes away the whole element of competition. |
13 May 2016, 12:13 | #56 |
Registered User
Join Date: Aug 2014
Location: Telemark
Posts: 207
|
@Leffman
We should set a deadline, and pm the answers to a dedicated person. Great little exercise btw... |
13 May 2016, 12:42 | #57 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
PM'ing the answers before a deadline can indeed be the solution to this. |
||
13 May 2016, 12:59 | #58 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
I like the idea of PMing answers.
Now I have seen meynaf's solution I can't unsee it, and i can guarantee I won't be coming up with anything better |
13 May 2016, 13:01 | #59 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
bah! I wasn't thinking "out the box" enough... won't even post my feeble attempt
ah go on then.. but it's not short not tested.. and probably wrong but I used the fact that 2/3 is approx: (1/2) + (1/8) + (1/32) + (1/128) + (1/512) Code:
move.l d1,d2 lsr.l #1,d2 move.l d2,d3 lsr.l #2,d3 move.l d3,d4 lsr.l #2,d4 move.l d4,d5 lsr.l #2,d5 move.l d5,d1 lsr.l #2,d1 add.l d2,d1 add.l d3,d1 add.l d4,d1 add.l d5,d1 moveq #0,d2 cmp.l d0,d1 shi d2 rts |
13 May 2016, 13:45 | #60 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
There is a way to do it shorter (cmp'ing d0*3 with d1*2), but it won't work for very large values :
Code:
sub.l d0,d1 ; b-a add.l d1,d1 ; 2b-2a sub.l d0,d1 ; 2b-3a |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Starting ASM coding on A1200. Which Assembler? | Nosferax | Coders. Asm / Hardware | 68 | 27 November 2015 16:14 |
4th tutorial on ASM- and HW-coding | Vikke | Coders. Asm / Hardware | 11 | 10 April 2013 20:32 |
3rd tutorial on ASM- and HW-coding | Vikke | Coders. Asm / Hardware | 6 | 26 March 2013 15:57 |
First tutorial on ASM- and HW-coding | Vikke | Coders. Asm / Hardware | 46 | 18 March 2013 12:33 |
2nd tutorial on ASM- and HW-coding | Vikke | Coders. Asm / Hardware | 10 | 17 March 2013 11:49 |
|
|