anchor.diff:         }.
   
   test_init(CPU,[])            -> CPU;
  -test_init(CPU,[{p,X}    |T]) -> test_init(CPU#cpu{p=X},T);
  -test_init(CPU,[{r,X}    |T]) -> test_init(CPU#cpu{r=X},T);
  -test_init(CPU,[{a,X}    |T]) -> test_init(CPU#cpu{a=X},T);
  -test_init(CPU,[{b,X}    |T]) -> test_init(CPU#cpu{b=X},T);
  -test_init(CPU,[{t,X}    |T]) -> test_init(CPU#cpu{t=X},T);
  -test_init(CPU,[{s,X}    |T]) -> test_init(CPU#cpu{s=X},T);
  -test_init(CPU,[{i,X}    |T]) -> test_init(CPU#cpu{i=X},T);
  -test_init(CPU,[{ds,X,Y} |T]) -> test_init(CPU#cpu{ds={X,array:from_list(Y)}},T);
  -test_init(CPU,[{rs,X,Y} |T]) -> test_init(CPU#cpu{rs={X,array:from_list(Y)}},T);
  -test_init(CPU,[{ram,A,W}|T]) -> test_init(CPU#cpu{ram=array:set(A,W,CPU#cpu.ram)},T).
  +test_init(CPU,[{p,X}     |T]) -> test_init(CPU#cpu{p=X},T);
  +test_init(CPU,[{carry,X} |T]) -> test_init(CPU#cpu{carry=X},T);
  +test_init(CPU,[{r,X}     |T]) -> test_init(CPU#cpu{r=X},T);
  +test_init(CPU,[{a,X}     |T]) -> test_init(CPU#cpu{a=X},T);
  +test_init(CPU,[{b,X}     |T]) -> test_init(CPU#cpu{b=X},T);
  +test_init(CPU,[{t,X}     |T]) -> test_init(CPU#cpu{t=X},T);
  +test_init(CPU,[{s,X}     |T]) -> test_init(CPU#cpu{s=X},T);
  +test_init(CPU,[{i,X}     |T]) -> test_init(CPU#cpu{i=X},T);
  +test_init(CPU,[{ds,X,Y}  |T]) -> test_init(CPU#cpu{ds={X,array:from_list(Y)}},T);
  +test_init(CPU,[{rs,X,Y}  |T]) -> test_init(CPU#cpu{rs={X,array:from_list(Y)}},T);
  +test_init(CPU,[{ram,A,W} |T]) -> test_init(CPU#cpu{ram=array:set(A,W,CPU#cpu.ram)},T).
   
   test_verify(Expected,Actual) ->
   %  ?debugFmt("EXPECTED: ~p",[Expected]),
  
positive.code: -define(RND(N),random:uniform(N+1) - 1).
  
  ret_test()    -> test_opcode(?TEST_RET).
  fetchp_test() -> test_opcode(?TEST_FETCHP).
  fetchb_test() -> test_opcode(?TEST_FETCHB).
  store_test()  -> test_opcode(?TEST_STORE).
  shl_test()    -> test_opcode(?TEST_SHL).
  dup_test()    -> test_opcode(?TEST_DUP).
  nop_test()    -> test_opcode(?TEST_NOP).
  bstore_test() -> test_opcode(?TEST_BSTORE).
  
negative.code:                      [{ram,15,678},{b,15},{t,1},  {s,2},{ds,0,[3,4,5,6,7,8,9,10]}],
                       [{ram,15,678},{b,15},{t,678},{s,1},{ds,7,[3,4,5,6,7,8,9,2]}]}
                     ]).
  
  -define(TEST_STOREB,[{?STOREB,
                        [{ram,4,0},  {b,4},{t,678},{s,9},{ds,0,[1,2,3,4,5,6,7,8]}],
                        [{ram,4,678},{b,4},{t,9},{s,1},{ds,1,[1,2,3,4,5,6,7,8]}]}
                      ]).
  
  -define(TEST_STORE,[{?STORE,
                       [{ram,0,0},{a,0},{t,1},{s,2},{ds,0,[3,4,5,6,7,8,9,10]}],
  