next up previous contents
Next: Running Cosmos Up: Predefined Ancestor Programs Previous: Ancestor A1

   
Ancestor A2

This self-reproducing program works in a similar fashion to ancestor A1. The difference is that it explicitly searches for its beginning and end positions by looking for appropriate binding sites, rather than assuming that copying should start from memory address zero and continue until execution of the instruction mov_ic sets the flag. The program listing is as follows:

1-2 101100111000   Start marked with a specific binding pattern
3 et_collect    
4 et_collect    
5 nwm_clear    
6 adrb    
7 nop_10    
8 nop_11   Search for binding pattern
9 nop_00   at start of program
10 nop_11    
11 nop_10    
12 nop_00    
13 push_a    
14 pop_c    
15 et_collect    
16 dec_c    
17 dec_c    
18 dec_c    
19 dec_c   We now have to subtract the
20 dec_c   length of the binding pattern
21 dec_c   (12 bits) to get the address
22 dec_c   of the actual start of the
23 dec_c   program
24 dec_c    
25 dec_c    
26 dec_c    
27 dec_c    
28 push_c    
29 pop_a    
30 swap_ab    
31 et_collect    
32 adrf    
33 nop_01    
34 nop_00   Search for binding pattern
35 nop_11   at end of program
36 nop_00    
37 nop_01    
38 nop_11    
39 swap_ab    
40 set_jmp    
41 et_collect    
42 et_collect    
43 clr_f    
44 mov_ic    
45 push_c    
46 swap_cd    
47 push_c    
48 swap_ab    
49 sub_ab    
50 swap_ab    
51 pop_c    
52 swap_cd    
53 pop_c    
54 if_not_fl    
55 nwm_write    
56 if_fl    
57 clr_jmp    
58 jmp    
59 et_collect    
60 reg_create    
61 nop_00    
62 nop_10    
63 nop_11    
64 nop_00    
65 nop_11    
66 nop_10    
67 nop_00    
68 nwm_divide    
69 stop    
70-71 010011000111   End marked with a specific binding pattern
promoter 101100111000    


next up previous contents
Next: Running Cosmos Up: Predefined Ancestor Programs Previous: Ancestor A1
Tim Taylor
1999-05-29