flat assembler
Message board for the users of flat assembler.

Index > Main > 512b contest 2011?

Goto page Previous  1, 2

512b 2011?
YES
90%
 90%  [ 18 ]
NO
10%
 10%  [ 2 ]
Total Votes : 20

Author
Thread Post new topic Reply to topic
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
I have written a 512 byte bootable OS demo and refined it
over the last couple of years, maybe now is the time to share...
Post 16 May 2011, 00:00
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
Why not define a goal, something interesting and useful, that the program has to do. The person who make it faster and smaller will be the winner, using a simple formula, something like:

G = {3*[(your prog speed)/(fastest contest entry speed)] + 2*[(your prog size)/(smallest contest entry size)]}/5

Score = 1/G

The winner is the one who gets the best score.

Example:
fastest entry speed: 200ms
smallest entry size: 2Kb

my prog speed: 400ms
my prog size: 4Kb
G = {3*(400/200) + 2*(4/2)}/5 = (6 + 4) / 5 = 2
Score = 1/G = 0.5
Post 16 May 2011, 00:30
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
ctl3d32 wrote:

G = {3*[(your prog speed)/(fastest contest entry speed)] + 2*[(your prog size)/(smallest contest entry size)]}/5

If you expect that to make it easier to decide the winner, you may be surprised. All it takes is some knowledge about multivariable optimization problems to find the maximum 1/G, and give someone a definite target to work towards.

A vote (of unspecified kind) is the easiest and fairest way to do it. I know at least I and MHajduk can find that maximum, and I'm sure there are others; I consider that an unfair advantage.

You should probably consult MHajduk on the type of vote, he undoubtedly had to have encountered some fairness theory in getting a Master's in discrete math.
Post 16 May 2011, 03:32
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
Mike Gonta wrote:
How about a 4K demo?

i have some 2732 btw Wink

_________________
UNICODE forever!
Post 16 May 2011, 04:37
View user's profile Send private message Visit poster's website Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
Tyler wrote:
ctl3d32 wrote:

G = {3*[(your prog speed)/(fastest contest entry speed)] + 2*[(your prog size)/(smallest contest entry size)]}/5

If you expect that to make it easier to decide the winner, you may be surprised. All it takes is some knowledge about multivariable optimization problems to find the maximum 1/G, and give someone a definite target to work towards.

A vote (of unspecified kind) is the easiest and fairest way to do it. I know at least I and MHajduk can find that maximum, and I'm sure there are others; I consider that an unfair advantage.

You should probably consult MHajduk on the type of vote, he undoubtedly had to have encountered some fairness theory in getting a Master's in discrete math.


There's no such a thing of multivariable optimization. You missed the point. I'm sure it's a misunderstanding.

In the formula:
- 3 is the weight for speed, 2 is the weight for size. This means that i'm giving more importance to speed than size.

- I'm dividing (your prog speed)/(fastest contest entry speed) and (your prog size)/(smallest contest entry size) because they need to have the same unit. This allows me to compare speed and size.

This is a problem of "weighted average".

Got it?
Post 16 May 2011, 14:03
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
It's the same as the average of my grades were calculated at university. Let's suppose that a subject is evaluated by two exams, and the grades were: g1 = 7.5 and g2 = 6.0. The average (A) is

A = (2*7.5 + 3*6.0)/5 = 6.6
Post 16 May 2011, 14:11
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
ctl3d32 wrote:

There's no such a thing of multivariable optimization. You missed the point. I'm sure it's a misunderstanding.

In the formula:
- 3 is the weight for speed, 2 is the weight for size. This means that i'm giving more importance to speed than size.

- I'm dividing (your prog speed)/(fastest contest entry speed) and (your prog size)/(smallest contest entry size) because they need to have the same unit. This allows me to compare speed and size.

This is a problem of "weighted average".

Got it?


But wheres the 'it does something useful' part of the equation ?.
Post 16 May 2011, 15:09
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
Dex4u wrote:

But wheres the 'it does something useful' part of the equation ?.


By "Something useful" i mean a code that could benefit lot's of users, like a library we can use and re-use. I can't think of anything right now. Smile
The winner code will be shared with all users.
Post 16 May 2011, 15:40
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
Let's think of a contest that that the goal is to search for a specific string inside a text file. No other rule. Those who get the best score using the formula i presented above is the winner. Simple as that.

To make it easier, all the search string code should be in a .dll file. The size of the .dll file and code execution speed will be evaluated. This way, you are free to make any GUI in an .exe that calls this .dll.
Post 16 May 2011, 15:44
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
findstr is not enough interresting as a contest subject.

i'd prefer a contest with no subject, just rules, and maybe a theme (halloween, xmas, end of world...)

it is up to the coder to imagine something to submit as an entry.

if the code limit is too high, the results of the contest will be very various.
i can't imagine somebody code a fully optimized 4096 bytes demo for a contest, even if he have time to do it, he will prefer to code something really small.

but i agree with the size limit.

let say, the win32 entries can be in 4096 bytes limit (because very minimal exe size i saw is 1024 bytes, to do nothing)
DOS code in 512 bytes (because use of int21h)
BOOT code in 1024....(because should implement some os services)

something like variable geometry rules? Laughing
Post 16 May 2011, 15:56
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I like the idea that we code something useful, what about we define a Standard Driver Interface and a simple kernel as part of the compo.
Then you are free to code a driver and the winner is the best, most useful driver.

Example this compo did a basic usb stack, see compo 28
http://www.fysnet.net/hugi/compoold.htm
Post 16 May 2011, 16:35
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
edfed wrote:
findstr is not enough interresting as a contest subject.


It was just an example. Any idea would be welcome.
Post 16 May 2011, 17:40
View user's profile Send private message Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
I voted "yes". Just a little piece of advice: keep the rules as simple as possible!

Wink
Post 17 May 2011, 13:57
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
new proposition of rules:

1) code source should compile in less than or equal N bytes

2) the program should exit with a condition C

3) the program should work under windows98 for win32 compos

3) the program should work under DOS for DOS compos

3) the program should exit in real mode for boot compos

3) the program should work on ubuntu for linux compos

3) the program should work on X for Y compos.

4) the program should do something cool, if you enjoyed the writing and testing of a program, it certainly meet this rule, the fun then. F, comprised between 0 and 0FFh

the difficulty is an estimation, and is D, between easy and hard

N, F, X and Y are variables and are defined for each category of compos.

for example, first compo, i'd like to see something in less than 16 bytes (one paragraph or SSE register), display the more beautyfull things as you can and exit on a free condition (keyboard, timer, etc)
let says N = 16, F = 20h, D=mid level, X=Real Mode, Y=Boot/org 100h
Post 17 May 2011, 23:40
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
here the link to the comcall.com test program for the compo.

http://board.flatassembler.net/topic.php?p=130654#130654

now that the comcall.com program works, we can start to define valid rules here.

1 every entry should be submitted within a comcall.zip archive by Private message to ME, as a new file included somewhere in some list, and linked to the first position of the main list.

2 the program can use all the memory until comcall.com mesure exactlly 65000 bytes

3 if your demo cannot feet within the spare bytes below 65000 bytes, it will be discalified.

4 if your demo, by a vote of only ME, is too long to be accepted, it will be rejected.

5 i invite you to don't use more than 4 kilobytes for your demo.
>>>>means the recursive comcall should be deleted before the starting of the contest.

6 your code should run, and exit without problems, inside the comcall.com program.

7 the closing date is for haloween, and will bring us a compo manager application with only the compos from the contest, fasm users will then test the manager, and vote for their favorite demos.

8 the winner will receive at home for christmass(all over the world) a book about assembly programming in french (annoted in english by hand), and a serial RCD programmer with a pic 12f675 on a test board.






are your ok with the rules?


Last edited by edfed on 15 Jun 2011, 13:09; edited 1 time in total
Post 15 Jun 2011, 12:46
View user's profile Send private message Visit poster's website Reply with quote
Coty



Joined: 17 May 2010
Posts: 546
Location: ␀
Coty
I'm okay with them, now I just have to come up with something to do in 4kb... That is actually quite abit of code... I'll just watch some sci-fi and hope that I think of something. Laughing
Post 15 Jun 2011, 13:03
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
your code can be just 20 bytes if you want.

the final demo manager fits in less than 1000 bytes, then, it lets up to 64000 bytes to contain all the compos from participants.

the first to submit his compo will have more memory than others.

the last to submit will have less memory to compose.

the source of the compo manager is there http://board.flatassembler.net/download.php?id=5468
Post 15 Jun 2011, 13:07
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
i have a better idea for the contest.

let say a function F that makes something from initial conditions I.

then, F(I) is the goal of programming.

F() is the code, and this code can be just a single instruction, or a real engine.
I can be a single bit, or void, or a very huge quantity of datas.

then, for every function F(I), we can say what it should (and shouldn't ) do exactlly, from there, the programmer will try to translate the idea in code. and the result will be verified with a test application or code.

then, i'd like to see some contest based on function programming.

a single function contest will cover only one function, and it's derivates.

for example, put pixel, getpixel, xorpixel, andpixel, etc... are all the variations of the same function putpixel.

a test program is the bloat needed to initialise the function context, display the result, and eventually iterate the I condition before to reloop.

as a first function to make, i propose the get_asciiz_size function as in the topic about the most useless instruction here



we still made some contest like this before, but it wasn't really contests, just some spontaneous optimisation discusion about some algorithms. theses discutions were really fun, all very interresting.

these spontaneous discussions were really cool, and we need more of them, a lot more. and of course, it can be very interresting if a modo or admin can signal all these threads with something like [compo] tag. nd list them in another thread, letting fasm user find functions easy, and have a way to compare different algo for the same thing.


binary to hexadecimal conversion is one of them, hexa to bin is another.
but there are a lot of function needed when you program.

just look a little to the funciton list of any hll, and you will see that there will never be any end to this contest.

if we decide to open a contest about every single function in a langage like C, we will have some 'fun' for ages.

then, don't imagine to dev something like C.

just you have to submit a function to do.
expose the action it should do.
the initial conditions.

propose something like a snippet test program.
it can be as simple as a mode switch in org 100h, in order to test a cls function... or nothing.

then, i propose as a first contest to do a function that counts the number of bytes in a string.

before execution:

gp registers have all random value.
the string is at ds:esi and is zero terminated
the only byte value used as a terminator is 0


the count is returned in ecx


.

the entries will be departed by:

size of binary
speed (number of execution in a one second (1s) loop, or time of execution of a 3M loop.)
number of instructions (or lines of code)

are you ok?
Post 23 Jul 2011, 13:48
View user's profile Send private message Visit poster's website Reply with quote
rain_storm



Joined: 05 Apr 2007
Posts: 67
Location: Ireland
rain_storm
1KB opens the possibility for compression. So there should be some rules regarding the use of compression. Otherwise it just becomes a compo to see who can write the best decompressor.
Post 01 Aug 2011, 21:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.