flat assembler
Message board for the users of flat assembler.

Index > Heap > Get A-Life (evolutionary programming)

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Very interesting article demonstrating evolution of complex systems from simple ones, particulary within computers (and Game of Life).

http://www.infidels.org/library/modern/meta/getalife/
Post 06 Mar 2008, 23:56
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack
very interesting vid, thx for sharing.. Wink
Post 07 Mar 2008, 01:34
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
Code:
        org 100h
        mov ax,0a000h
        mov es,ax
        mov ah,90h
        mov fs,ax
        mov ax,13h
        int 10h
        mov ecx,320*50
        xor edi,edi
        mov eax,edi
@@:
        mov [fs:edi*4],eax
        mov [es:edi*4],eax
        inc edi
        dec ecx
        jne @b
        jmp debut
celltest:
        mov di,320*2
        mov cx,320*198
.next:
        mov eax,[es:di-321]
        add eax,[es:di+319]
        mov ebx,[es:di-1]
        add eax,ebx
        add ah,al
        ror eax,8
        add al,ah
        sub al,bh
;;;;;;;;GOPLAT;;;;;;;;;;;;;
        mov ah,[es:di]
        cmp al,2 
        je @f 
        cmp al,3 
        setz ah 
@@:
        mov [fs:di],ah
;;;;;;;/GOPLAT;;;;;;;;;;;;;
        inc di
        dec cx
        jne .next
        ret
refresh:
        mov dx,3dah
@@:
        in al,dx
        test al,8
        jne @b
@@:
        in al,dx
        test al,8
        je @b
        mov ecx,320*50
        xor edi,edi
        mov edx,edi
@@:
        mov eax,[fs:edi*4]
        mov [fs:edi*4],edx
        mov [es:edi*4],eax
        inc edi
        dec ecx
        jne @b
        ret
debut:
        in al,60h
        dec al
        je exit
        mov ax,3
        int 33h
        movzx edi,dx
        imul edi,320
        shr cx,1
        add di,cx
        mov al,1
        mov [es:di],al
        test bl,1
        je @f
        call celltest
        call refresh
@@:
        jmp debut
        ret
exit:
        mov ax,3
        int 10h
        ret               
    



where is the problem???

note, it is less than 256 bytes (and can be smaller).
it works, thank goplat!
but it is still slow....(for this, i'm sure the optimizator-mens will enjoy!) Sad Sad Sad good night.


the size of compiled code can be less than 200 bytes! dream or reality?
this is a 3 byte tests to 1 pixel set.
and speed can be at least doubled. by a 4 byte tests to 2 pixels sets.
or 8 byte tests to 6 pixels sets.
and there is another optimisation, with bigger pixels (4*4) (2*2)
and another method can consist in bit representation , then, 32 pixel tests to 30 pixel sets, or 64 pixel tests to 62 pixel sets.


Last edited by edfed on 07 Mar 2008, 23:34; edited 4 times in total
Post 07 Mar 2008, 01:44
View user's profile Send private message Visit poster's website Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat
edfed: it never creates new dots. Try this
Code:
    mov ah,[es:di]
        cmp al,2
      je @f
       cmp al,3
    setz ah
@@:      mov [fs:di],ah    
Post 07 Mar 2008, 03:12
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
edfed, goplat: are you sure this is the right topic?
Post 07 Mar 2008, 09:27
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
yes, because it speaks about life algo programing, and this is life algo programing. what represent this link? nothing more than a pure text without any FASM exemple of programming this.
then, i am sure it is the right topic.

like bitrake programed some algo that can be incorporated to this topic.

fractals, strange IIR algorithms, FIR algo, IA, etc... al these covers the subject of the arcticle link you gave us. Very Happy

then, micro contest, increase the speed of life. using the new instruction sets and techniques... note that technics, the ability to make things, is better as time goes. a 6809 coded with new techniques will be faster than with old, basic techniques...

let's play with the game of life.

to set pixels, just move the mouse. and to compute a cycle, left clic....
Post 07 Mar 2008, 19:27
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
wonderful book about evolutionary programming of cellullar automata: http://www.cs.bgu.ac.il/~sipper/papabs/epcm.pdf
Post 13 Mar 2008, 15:41
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2940
Location: vpcmipstrm
bitRAKE
My genetic algorithm generates x86 code as it's phenotype.

_________________
¯\(°_o)/¯ unlicense.org
Post 13 Mar 2008, 16:01
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
link?
Post 13 Mar 2008, 16:30
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2940
Location: vpcmipstrm
bitRAKE
Nothing ready for public consumption, but I'm happy to explain how it works. Here is the compiler:
Code:
.0:     movzx eax,[ebp+edx]   ; gene byte
        inc edx
        lea esi,[.u+eax*8]    ; code
        movzx ecx,[.t+eax]    ; length of code
        test eax,eax
        rep movsb
        jne .0    
Random bytes (genotype) are assembled into a program from fragments of code (up to eight bytes in length). Zero code is terminator (RETN instruction in most cases).

Each program is executed - the RDTSC readings are accumulated along with the results. Most of the code becomes problem specific - the GA part is a very light-weight framework.

_________________
¯\(°_o)/¯ unlicense.org
Post 13 Mar 2008, 16:44
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
i'm looking forward to see it "in action"
Post 13 Mar 2008, 18:07
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.