flat assembler
Message board for the users of flat assembler.

Index > Main > A new 512-byte contest

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
As you may know, this year I had the 20th anniversary of the beginning of fasm's development and next year there is going to be the 20th anniversary of the first official release. Therefore we are in the middle of a prolonged celebration, and my plan is to organize a several small events for this occasion.

The first one that I would like to announce is another 512-byte contest. The one we had years ago (not organized by me) was quite successful and I would hope to invite the same kind of creativity.

The prize is TBD, but I'm definitely planning to provide some.

As for the rules, what I have in mind is a "freestyle" competition, as long as a piece is bootable and fits into 512 bytes. I would love to see diversity of creative ideas. I even consider allowing additional non-x86 category, so you could submit a demo running on 8051 microcontroller, for example.

However, another restriction would be that submission would have to assemble with fasm, of course. Though I would allow fasmg for non-x86 entries.

This is not yet an official announcement of the competition, but an invitation to discuss the idea - we can still alter the rules, so please voice your opinion. However, if you would like to participate in the competition and you have an interesting idea for an entry, you may already start working on it. Smile
Post 26 Sep 2019, 08:36
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
good idea... i'll try to submit an entry then Wink

Code:
format binary as 'img'
;version 04/06/2019 13.54
;bootcode:
bootsys:
ORG equ 1000h
use16
        org 7C00h

        mov ax,cs
        mov ss,ax
        mov ds,ax
        mov [.bootdrive],dl

;copy bootloader from 0000h:7c00h to 1000h:7c00h
;linear 07c00h to 17c00h
        mov ax,1000h
        mov es,ax
        mov bx,512
        mov di,7c00h
@@:
        dec bx
        jl @f
        mov al,[di+bx]
        mov [es:di+bx],al
        jmp @b
@@:

;and jump to the recopy.
        jmp 1000h:@f
@@:

;load the system from sector 2 to 0000h:1000h
;linear 01000h
        mov ax,230h
        mov cx,2
        xor dh,dh
        mov bx,ORG/16
        mov es,bx
        xor bx,bx
        int 13h
        xor ax,ax
        cmp [.bootdrive],0
        jl @f
        mov dx,3f2h
        out dx,al
@@:
        mov ss,ax
        mov ds,ax

;and jump to the system at linear 1000h (ORG)
        jmp 0:ORG

.padding rb 509-($-$$)
.bootdrive db 0
.bootmark dw 0aa55h
macro fdpad {
      align 4
      times (((512*80*18*2)-($-$$)-512)/4) dd 0
}

kernel:
        org ORG
        mov ax,0b800h
        mov es,ax
        xor di,di
@@:
        mov [es:di],di
        inc di
        jmp @b
        fdpad  
    


for example, this gives a bootbale floppy disk image with just an infinite loop in the "kernel" writing in the text video memory.
The secret is in fdpad, many virtual machines needs an integral floppy image to boot on.
can be a base for anyone to develop his boot sector, i suppose the compo will net exclude the loading of the sectors as long as sectors are not part of the compo Wink


THIS IS NOT MY ENTRY, JUST AN EXAMPLE
Post 26 Sep 2019, 13:43
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
I would assume that a submission is not permitted to access any external resources, like HDD or Internet, since that would make it trivial to make something of effectively unlimited size?

Also, I would assume that being able to run it in a popular VM would be an advantage, since it would be easier to test and give more consistent results.
Post 27 Sep 2019, 04:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
revolution wrote:
I would assume that a submission is not permitted to access any external resources, like HDD or Internet, since that would make it trivial to make something of effectively unlimited size?

Also, I would assume that being able to run it in a popular VM would be an advantage, since it would be easier to test and give more consistent results.
What I have in mind is: a submission should be a source that can be assembled with fasm (or fasmg if there's a good reason to use it instead) to no more than 512 bytes of code+data, which should boot from a single sector. If there are additional requirements, they should be stated clearly in the comments - for example if the code requires at least 80386 CPU, or if specific additional hardware is assumed (like VGA). Otherwise the assumption would be that the entry should run correctly on any system able to boot it (starting with IBM PC/XT).

If I allow a separate category for other architectures, it would need a different set of rules, though the basic one that all assembled code/data should fit in 512 bytes would remain. But a submission would then be allowed to also contain a detailed description of a required set-up (like circuit design) and a demonstration of the running code could be a recorded video, etc. I'm not sure about this, but I know a few people on this board would certainly be capable of making interesting things of this kind.

And another important rule that comes to my mind is that the authorship should be undisputed, and it would be preferable if submissions were a code never published elsewhere before.
Post 27 Sep 2019, 06:48
View user's profile Send private message Visit poster's website Reply with quote
SeproMan



Joined: 11 Oct 2009
Posts: 60
Location: Belgium
SeproMan
I would like to be able to assemble my submission with that first official release of FASM. Can we still download it somewhere or could you make it available specially for this 512-byte contest?

Quote:
The prize is TBD, but I'm definitely planning to provide some.


Don't worry too much about this. I think most of us are in it for the fun Wink
Post 01 Oct 2019, 15:26
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
SeproMan wrote:
I would like to be able to assemble my submission with that first official release of FASM. Can we still download it somewhere or could you make it available specially for this 512-byte contest?
That's an enticing idea. I would only hope that the old bugs would not turn out to be roadblocks.

The original package may still be found in this archive: http://fasm.sourceforge.net/archive/
Post 01 Oct 2019, 15:33
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Nice idea.

I will start coding my submission right now.
Post 20 Oct 2019, 16:01
View user's profile Send private message Yahoo Messenger Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
When's the deadline? The contest rules should also define which VM software would be used to play the entry back, which hardware is available (per allowed architectures), etc.
Post 21 Oct 2019, 05:18
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
that's true, what VM to try the soft?

what limitations? for eaxmple, is it ok to read the content of hard drives, if the compo is a drive explorer, and as long as the code source and usefull data fits in the 512 byte sector?

is it ok to write back to drives, as long as the first execution is just a 512 byte boot sector, with an editor able to read / write to drive....

that's all... for the moment.
Post 21 Oct 2019, 09:24
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
I already wrote a bit about this in my second post above. In general, if only possible you should try to make it easy for people to be able to test your code, but it would sadden me if we wrote code to be run just in emulators (especially considering that some tricks I like, like my 32-bit unreal mode, may not be emulated properly by many of them). Just be sure to write down hardware requirements if your code has them.

The main limitation would be that the submission needs to be a fasm-compatible source that assembles to at most 512 bytes of something. The source can define what it expects from the environment (for example: "this is a drive explorer, so the system needs to have a HDD with a FAT partition"), just keep the requirements not too ridiculous. If you defined your requirements as "byte at 1000h:0 should be 56h, byte at 1000h:1 should be 23h, ..." then this would obviously be gaming the system. But other than such blatant exploits, I would prefer to allow a wide variety of possible environments/assumptions. Just show us something amazing! Smile
Post 21 Oct 2019, 10:56
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
I'm thinking BIOS serial wifi bridge with esp8266, where to go from there?
Post 22 Oct 2019, 07:26
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
hum...you should be able to send and receive from usb serial port.
after that, everything is possible but the code in esp would be far more bigger than 512 bytes.

i'll try to make a sort of 2D mine craft where everything is editable as long as you find where it is in the map.


Description: screenshot of something... :)
Filesize: 6.56 KB
Viewed: 5236 Time(s)

game320.png


Post 22 Oct 2019, 09:29
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
I think the esp code would be considered firmware and not counted, just like the firmware in HDD or anything else... With this we can interface 16bit BIOS based OS with Wi-Fi through any device with browser.

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 22 Oct 2019, 16:28
View user's profile Send private message Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 727
guignol
we need for fasm(g)
PPMd-compressed single-archive 'project' support
Full support of UTF-8 UTF-16 UTF-32 encodings
also a unicode monospace small font having all common characters

do not wait for sponsors, progress the scene yourself
instead of making blunt-contests announcements
Post 01 Apr 2020, 08:35
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.