This page is an extract from:
http://pages.cpsc.ucalgary.ca/~jacob/Courses/Winter2002/CPSC601-73/Slides/AssemblerAutomata/aa.html
nop0
nop1
Memory Movement: 11
pushax (push AX onto stack)
pushbx (push BX onto stack)
pushcx (push CX onto stack)
pushdx (push DX onto stack)
popax (pop from stack into AX)
popbx (pop from stack into BX)
popcx (pop from stack into CX)
popdx (pop from stack into DX)
movcd (DX = CX)
movab (BX = AX)
movii (move from ram [BX] to ram [AX])
Calculation: 9
sub_ab (CX = AX - BX)
sub_ac (AX = AX - CX)
inc_a (increment AX)
inc_b (increment BX)
inc_c (increment CX)
dec_c (decrement CX)
zero (zero CX)
not0 (flip low order bit of CX)
shl (shift left all bits of CX)
Instruction Pointer Manipulation: 5
ifz (if CX == 0 execute next instr., else, skip it)
jmp (jump to template)
jmpb (jump backwards to template)
call (push IP onto the stack, jump to template)
ret (pop the stack into the IP)
Biological and Sensory: 5
adr (search outward for template,
put address in AX, template size in CX)
adrb (search backward for template,
put address in AX, template size in CX)
adrf (search forward for template,
put address in AX, template size in CX)
mal (allocate amount of space specified in CX)
divide (cell division)
Total: 32
nop1 ; 010 110 01 0 beginning marker
nop1 ; 010 110 01 1 beginning marker
nop1 ; 010 110 01 2 beginning marker
nop1 ; 010 110 01 3 beginning marker
zero ; 010 110 04 4 put zero in cx
not0 ; 010 110 02 5 put 1 in first bit of cx
shl ; 010 110 03 6 shift left cx (cx = 2)
shl ; 010 110 03 7 shift left cx (cx = 4)
movcd ; 010 110 18 8 move cx to dx (dx = 4)
adrb ; 010 110 1c 9 get (backward) address of beginning marker -> ax
nop0 ; 010 100 00 10 complement to beginning marker
nop0 ; 010 100 00 11 complement to beginning marker
nop0 ; 010 100 00 12 complement to beginning marker
nop0 ; 010 100 00 13 complement to beginning marker
sub_ac ; 010 110 07 14 subtract cx from ax, result in ax
movab ; 010 110 19 15 move ax to bx, bx = start address of mother
adrf ; 010 110 1d 16 get (forward) address of end marker -> ax
nop0 ; 010 100 00 17 complement to end marker
nop0 ; 010 100 00 18 complement to end marker
nop0 ; 010 100 00 19 complement to end marker
nop1 ; 010 100 01 20 complement to end marker
inc_a ; 010 110 08 21 increment ax, to include dummy instruction at end
sub_ab ; 010 110 06 22 subtract bx from ax to get size, result in cx
nop1 ; 010 110 01 23 reproduction loop marker
nop1 ; 010 110 01 24 reproduction loop marker
nop0 ; 010 110 00 25 reproduction loop marker
nop1 ; 010 110 01 26 reproduction loop marker
mal ; 010 110 1e 27 allocate space (cx) for daughter, address to ax
call ; 010 110 16 28 call template below (copy procedure)
nop0 ; 010 100 00 29 copy procedure complement
nop0 ; 010 100 00 30 copy procedure complement
nop1 ; 010 100 01 31 copy procedure complement
nop1 ; 010 100 01 32 copy procedure complement
divide ; 010 110 1f 33 create independent daughter cell
jmp ; 010 110 14 34 jump to template below (reproduction loop)
nop0 ; 010 100 00 35 reproduction loop complement
nop0 ; 010 100 00 36 reproduction loop complement
nop1 ; 010 100 01 37 reproduction loop complement
nop0 ; 010 100 00 38 reproduction loop complement
ifz ; 010 000 05 39 dummy instruction to separate templates
nop1 ; 010 110 01 40 copy procedure template
nop1 ; 010 110 01 41 copy procedure template
nop0 ; 010 110 00 42 copy procedure template
nop0 ; 010 110 00 43 copy procedure template
pushax ; 010 110 0c 44 push ax onto stack
pushbx ; 010 110 0d 45 push bx onto stack
pushcx ; 010 110 0e 46 push cx onto stack
nop1 ; 010 110 01 47 copy loop template
nop0 ; 010 110 00 48 copy loop template
nop1 ; 010 110 01 49 copy loop template
nop0 ; 010 110 00 50 copy loop template
movii ; 010 110 1a 51 move contents of [bx] to [ax] (copy one instr.)
dec_c ; 010 110 0a 52 decrement cx (size)
ifz ; 010 110 05 53 if cx == 0 perform next instruction, else skip it
jmp ; 010 110 14 54 jump to template below (copy procedure exit)
nop0 ; 010 110 00 55 copy procedure exit complement
nop1 ; 010 110 01 56 copy procedure exit complement
nop0 ; 010 110 00 57 copy procedure exit complement
nop0 ; 010 110 00 58 copy procedure exit complement
inc_a ; 010 110 08 59 increment ax (address in daughter to copy to)
inc_b ; 010 110 09 60 increment bx (address in mother to copy from)
jmp ; 010 110 14 61 bidirectional jump to template below (copy loop)
nop0 ; 010 100 00 62 copy loop complement
nop1 ; 010 100 01 63 copy loop complement
nop0 ; 010 100 00 64 copy loop complement
nop1 ; 010 100 01 65 copy loop complement
ifz ; 010 000 05 66 this is a dummy instruction to separate templates
nop1 ; 010 110 01 67 copy procedure exit template
nop0 ; 010 110 00 68 copy procedure exit template
nop1 ; 010 110 01 69 copy procedure exit template
nop1 ; 010 110 01 70 copy procedure exit template
popcx ; 010 110 12 71 pop cx off stack (size)
popbx ; 010 110 11 72 pop bx off stack (start address of mother)
popax ; 010 110 10 73 pop ax off stack (start address of daughter)
ret ; 010 110 17 74 return from copy procedure
nop1 ; 010 100 01 75 end template
nop1 ; 010 100 01 76 end template
nop1 ; 010 100 01 77 end template
nop0 ; 010 100 00 78 end template
ifz ; 010 000 05 79 dummy instruction to separate creature