Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mov dx,0x0F00
- mov bx,0x0000
- mov cx,0x0001
- mov [dx+15],cx
- mov [dx+16],cx
- mov [dx+17],cx
- sub dx,64
- update:
- jmp alivecells
- donecell:
- cmp bx,2
- jne killcell
- mov ax,[dx]
- cmp ax,0x0001
- je copycell
- add dx,1
- cmp dx, 4030
- je reset
- jmp update
- alivecells:
- mov bx,0
- mov ax,[dx-65]
- add bx,ax
- mov ax,[dx-64]
- add bx,ax
- mov ax,[dx-63]
- add bx,ax
- mov ax,[dx+1]
- add bx,ax
- mov ax,[dx-1]
- add bx,ax
- mov ax,[dx+63]
- add bx,ax
- mov ax,[dx+64]
- add bx,ax
- mov ax,[dx+65]
- add bx,ax
- jmp donecell
- relivecell:
- mov cx,0x0002
- mov [dx-384],cx
- add dx,1
- cmp dx, 4030
- je reset
- jmp update
- reset:
- mov dx,0x0F00
- sub dx, 64
- jmp renewgeneration
- renewgendone:
- mov dx,0x0F00
- sub dx, 64
- jmp update
- killcell:
- mov [dx-384],ex
- cmp bx,3
- je relivecell
- add dx,1
- cmp dx, 4030
- je reset
- jmp update
- copycell:
- mov cx,0x0002
- mov [dx-384],cx
- add dx,1
- cmp dx, 4030
- je reset
- jmp update
- renewgeneration:
- mov ex,0x0000
- renewloop:
- mov ax, [dx-384]
- mov [dx],ex
- cmp ax, 0x0002
- je setalive
- renewreturn:
- mov [dx-384],ex
- add dx,1
- cmp dx, 4030
- jne renewloop
- jmp renewgendone
- setalive:
- mov [dx],0x0001
- jmp renewreturn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement