From 2e8cf285d34db9353da36061dcb37dc356cc4058 Mon Sep 17 00:00:00 2001 From: Ian Knowles Date: Mon, 15 Feb 2016 00:44:59 +0800 Subject: [PATCH] Initial documentation added. --- docs/_at.cpp.html | 2649 +++++++++++++++++++++++++++ docs/at.html | 302 +++ docs/at_api.html | 168 ++ docs/at_atomic.html | 200 ++ docs/at_auction.html | 264 +++ docs/at_auction_tests.html | 226 +++ docs/at_crowdfund.html | 187 ++ docs/at_crowdfund_tests.html | 272 +++ docs/at_dormant.html | 175 ++ docs/at_dormant_tests.html | 186 ++ docs/at_lottery.html | 230 +++ docs/at_lottery_tests.html | 201 ++ docs/at_meta.html | 119 ++ docs/at_script.html | 148 ++ docs/at_test_add_dat.html | 475 +++++ docs/at_test_and_dat.html | 472 +++++ docs/at_test_beq_dat.html | 231 +++ docs/at_test_bge_dat.html | 228 +++ docs/at_test_bgt_dat.html | 227 +++ docs/at_test_ble_dat.html | 259 +++ docs/at_test_blt_dat.html | 228 +++ docs/at_test_bne_dat.html | 231 +++ docs/at_test_bnz_dat.html | 226 +++ docs/at_test_bor_dat.html | 472 +++++ docs/at_test_bzr_dat.html | 221 +++ docs/at_test_clr_dat.html | 338 ++++ docs/at_test_dec_dat.html | 493 +++++ docs/at_test_div_dat.html | 491 +++++ docs/at_test_ext_fun.html | 97 + docs/at_test_ext_fun_dat.html | 99 + docs/at_test_ext_fun_dat_2.html | 102 ++ docs/at_test_ext_fun_ret.html | 148 ++ docs/at_test_ext_fun_ret_dat.html | 153 ++ docs/at_test_ext_fun_ret_dat_2.html | 157 ++ docs/at_test_fin_imd.html | 145 ++ docs/at_test_fiz_dat.html | 115 ++ docs/at_test_inc_dat.html | 492 +++++ docs/at_test_jmp_adr.html | 133 ++ docs/at_test_jmp_sub.html | 187 ++ docs/at_test_mul_dat.html | 474 +++++ docs/at_test_not_dat.html | 473 +++++ docs/at_test_pop_dat.html | 224 +++ docs/at_test_psh_dat.html | 277 +++ docs/at_test_ret_sub.html | 233 +++ docs/at_test_set_dat.html | 287 +++ docs/at_test_set_idx.html | 270 +++ docs/at_test_set_ind.html | 287 +++ docs/at_test_set_pcs.html | 130 ++ docs/at_test_set_val.html | 432 +++++ docs/at_test_stp_imd.html | 104 ++ docs/at_test_stz_dat.html | 124 ++ docs/at_test_sub_dat.html | 474 +++++ docs/at_test_sub_leq.html | 195 ++ docs/at_test_xor_dat.html | 472 +++++ docs/index.html | 91 + 55 files changed, 16294 insertions(+) create mode 100644 docs/_at.cpp.html create mode 100644 docs/at.html create mode 100644 docs/at_api.html create mode 100644 docs/at_atomic.html create mode 100644 docs/at_auction.html create mode 100644 docs/at_auction_tests.html create mode 100644 docs/at_crowdfund.html create mode 100644 docs/at_crowdfund_tests.html create mode 100644 docs/at_dormant.html create mode 100644 docs/at_dormant_tests.html create mode 100644 docs/at_lottery.html create mode 100644 docs/at_lottery_tests.html create mode 100644 docs/at_meta.html create mode 100644 docs/at_script.html create mode 100644 docs/at_test_add_dat.html create mode 100644 docs/at_test_and_dat.html create mode 100644 docs/at_test_beq_dat.html create mode 100644 docs/at_test_bge_dat.html create mode 100644 docs/at_test_bgt_dat.html create mode 100644 docs/at_test_ble_dat.html create mode 100644 docs/at_test_blt_dat.html create mode 100644 docs/at_test_bne_dat.html create mode 100644 docs/at_test_bnz_dat.html create mode 100644 docs/at_test_bor_dat.html create mode 100644 docs/at_test_bzr_dat.html create mode 100644 docs/at_test_clr_dat.html create mode 100644 docs/at_test_dec_dat.html create mode 100644 docs/at_test_div_dat.html create mode 100644 docs/at_test_ext_fun.html create mode 100644 docs/at_test_ext_fun_dat.html create mode 100644 docs/at_test_ext_fun_dat_2.html create mode 100644 docs/at_test_ext_fun_ret.html create mode 100644 docs/at_test_ext_fun_ret_dat.html create mode 100644 docs/at_test_ext_fun_ret_dat_2.html create mode 100644 docs/at_test_fin_imd.html create mode 100644 docs/at_test_fiz_dat.html create mode 100644 docs/at_test_inc_dat.html create mode 100644 docs/at_test_jmp_adr.html create mode 100644 docs/at_test_jmp_sub.html create mode 100644 docs/at_test_mul_dat.html create mode 100644 docs/at_test_not_dat.html create mode 100644 docs/at_test_pop_dat.html create mode 100644 docs/at_test_psh_dat.html create mode 100644 docs/at_test_ret_sub.html create mode 100644 docs/at_test_set_dat.html create mode 100644 docs/at_test_set_idx.html create mode 100644 docs/at_test_set_ind.html create mode 100644 docs/at_test_set_pcs.html create mode 100644 docs/at_test_set_val.html create mode 100644 docs/at_test_stp_imd.html create mode 100644 docs/at_test_stz_dat.html create mode 100644 docs/at_test_sub_dat.html create mode 100644 docs/at_test_sub_leq.html create mode 100644 docs/at_test_xor_dat.html create mode 100644 docs/index.html diff --git a/docs/_at.cpp.html b/docs/_at.cpp.html new file mode 100644 index 0000000..4a932d5 --- /dev/null +++ b/docs/_at.cpp.html @@ -0,0 +1,2649 @@ + + + + +CIYAM AT - at.cpp + + + + + + + +
+ + +
+
+
+at.cpp 
+// Copyright (c) 2014 CIYAM Developers
+//
+// Distributed under the MIT/X11 software license, please refer to the file license.txt
+// in the root project directory or http://www.opensource.org/licenses/mit-license.php.
+#include <cstdlib>
+#include <memory.h>
+
+#ifndef _WIN32
+#  include <stdint.h>
+#else
+#  ifdef _MSC_VER
+typedef __int8 int8_t;
+typedef __int16 int16_t;
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+#  endif
+#endif
+
+#include <map>
+#include <set>
+#include <deque>
+#include <memory>
+#include <string>
+#include <vector>
+#include <fstream>
+#include <iomanip>
+#include <sstream>
+#include <iostream>
+#include <stdexcept>
+
+/* Basic Test Cases
+(output value)
+> code 0100000000b8220000000000003301000000000028
+> run
+8888
+
+(testing loop)
+> code 35020000000000330100000000001e00000000f228
+> run
+1
+2
+3
+4
+5
+6
+7
+8
+9
+0
+
+(explicit loop)
+> code 010000000003000000000000000500000000330100000000001e00000000f428
+> run
+2
+1
+0
+*/
+
+using namespace std;
+
+const int32_t c_code_page_bytes = 512;
+const int32_t c_data_page_bytes = 512;
+
+const int32_t c_call_stack_page_bytes = 256;
+const int32_t c_user_stack_page_bytes = 256;
+
+int32_t g_code_pages = 1;
+int32_t g_data_pages = 1;
+
+int32_t g_call_stack_pages = 1;
+int32_t g_user_stack_pages = 1;
+
+const int64_t c_default_balance = 100;
+
+const int32_t c_max_to_multiply = 0x1fffffff;
+
+int64_t g_val = 0;
+int64_t g_val1 = 0;
+
+int64_t g_balance = c_default_balance;
+
+bool g_first_call = true;
+
+int32_t g_increment_func = 0;
+
+enum op_code
+{
+   e_op_code_NOP = 0x7f,
+   e_op_code_SET_VAL = 0x01,
+   e_op_code_SET_DAT = 0x02,
+   e_op_code_CLR_DAT = 0x03,
+   e_op_code_INC_DAT = 0x04,
+   e_op_code_DEC_DAT = 0x05,
+   e_op_code_ADD_DAT = 0x06,
+   e_op_code_SUB_DAT = 0x07,
+   e_op_code_MUL_DAT = 0x08,
+   e_op_code_DIV_DAT = 0x09,
+   e_op_code_BOR_DAT = 0x0a,
+   e_op_code_AND_DAT = 0x0b,
+   e_op_code_XOR_DAT = 0x0c,
+   e_op_code_NOT_DAT = 0x0d,
+   e_op_code_SET_IND = 0x0e,
+   e_op_code_SET_IDX = 0x0f,
+   e_op_code_PSH_DAT = 0x10,
+   e_op_code_POP_DAT = 0x11,
+   e_op_code_JMP_SUB = 0x12,
+   e_op_code_RET_SUB = 0x13,
+   e_op_code_IND_DAT = 0x14,
+   e_op_code_IDX_DAT = 0x15,
+   e_op_code_MOD_DAT = 0x16,
+   e_op_code_SHL_DAT = 0x17,
+   e_op_code_SHR_DAT = 0x18,
+   e_op_code_JMP_ADR = 0x1a,
+   e_op_code_BZR_DAT = 0x1b,
+   e_op_code_BNZ_DAT = 0x1e,
+   e_op_code_BGT_DAT = 0x1f,
+   e_op_code_BLT_DAT = 0x20,
+   e_op_code_BGE_DAT = 0x21,
+   e_op_code_BLE_DAT = 0x22,
+   e_op_code_BEQ_DAT = 0x23,
+   e_op_code_BNE_DAT = 0x24,
+   e_op_code_SLP_DAT = 0x25,
+   e_op_code_FIZ_DAT = 0x26,
+   e_op_code_STZ_DAT = 0x27,
+   e_op_code_FIN_IMD = 0x28,
+   e_op_code_STP_IMD = 0x29,
+   e_op_code_SLP_IMD = 0x2a,
+   e_op_code_ERR_ADR = 0x2b,
+   e_op_code_SET_PCS = 0x30,
+   e_op_code_EXT_FUN = 0x32,
+   e_op_code_EXT_FUN_DAT = 0x33,
+   e_op_code_EXT_FUN_DAT_2 = 0x34,
+   e_op_code_EXT_FUN_RET = 0x35,
+   e_op_code_EXT_FUN_RET_DAT = 0x36,
+   e_op_code_EXT_FUN_RET_DAT_2 = 0x37,
+};
+
+struct machine_state
+{
+   machine_state( )
+   {
+      pce = pcs = 0;
+      reset( );
+   }
+
+   void reset( )
+   {
+      pc = pcs;
+      opc = 0;
+
+      cs = 0;
+      us = 0;
+
+      steps = 0;
+
+      a1 = 0;
+      a2 = 0;
+      a3 = 0;
+      a4 = 0;
+
+      b1 = 0;
+      b2 = 0;
+      b3 = 0;
+      b4 = 0;
+
+      jumps.clear( );
+
+      stopped = false;
+      finished = false;
+   }
+
+   bool stopped; // transient
+   bool finished; // transient
+
+   int32_t pc;
+   int32_t pce;
+   int32_t pcs;
+
+   int32_t opc; // transient
+
+   int32_t cs;
+   int32_t us;
+
+   int64_t a1;
+   int64_t a2;
+   int64_t a3;
+   int64_t a4;
+
+   int64_t b1;
+   int64_t b2;
+   int64_t b3;
+   int64_t b4;
+
+   int32_t steps;
+
+   int32_t sleep_until;
+
+   set< int32_t > jumps; // transient
+};
+
+struct function_data
+{
+   function_data( )
+   {
+      loop = false;
+      offset = 0;
+   }
+
+   bool loop;
+   size_t offset;
+
+   vector< int64_t > data;
+};
+
+string decode_function_name( int16_t fun, int8_t op )
+{
+   ostringstream osstr;
+
+   int8_t op_expected = 0;
+
+   switch( fun )
+   {
+      case 0x0100:
+      osstr << "Get_A1";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0101:
+      osstr << "Get_A2";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0102:
+      osstr << "Get_A3";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0103:
+      osstr << "Get_A4";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0104:
+      osstr << "Get_B1";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0105:
+      osstr << "Get_B2";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0106:
+      osstr << "Get_B3";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0107:
+      osstr << "Get_B4";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0110:
+      osstr << "Set_A1";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0111:
+      osstr << "Set_A2";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0112:
+      osstr << "Set_A3";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0113:
+      osstr << "Set_A4";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0114:
+      osstr << "Set_A1_A2";
+      op_expected = e_op_code_EXT_FUN_DAT_2;
+      break;
+
+      case 0x0115:
+      osstr << "Set_A3_A4";
+      op_expected = e_op_code_EXT_FUN_DAT_2;
+      break;
+
+      case 0x0116:
+      osstr << "Set_B1";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0117:
+      osstr << "Set_B2";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0118:
+      osstr << "Set_B3";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0119:
+      osstr << "Set_B4";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x011a:
+      osstr << "Set_B1_B2";
+      op_expected = e_op_code_EXT_FUN_DAT_2;
+      break;
+
+      case 0x011b:
+      osstr << "Set_B3_B4";
+      op_expected = e_op_code_EXT_FUN_DAT_2;
+      break;
+
+      case 0x0120:
+      osstr << "Clear_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0121:
+      osstr << "Clear_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0122:
+      osstr << "Clear_A_And_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0123:
+      osstr << "Copy_A_From_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0124:
+      osstr << "Copy_B_From_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0125:
+      osstr << "Check_A_Is_Zero";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0126:
+      osstr << "Check_B_Is_Zero";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0127:
+      osstr << "Check_A_Equals_B";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0128:
+      osstr << "Swap_A_and_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0129:
+      osstr << "OR_A_with_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x012a:
+      osstr << "OR_B_with_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x012b:
+      osstr << "AND_A_with_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x012c:
+      osstr << "AND_B_with_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x012d:
+      osstr << "XOR_A_with_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x012e:
+      osstr << "XOR_B_with_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0200:
+      osstr << "MD5_A_To_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0201:
+      osstr << "Check_MD5_A_With_B";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0202:
+      osstr << "HASH160_A_To_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0203:
+      osstr << "Check_HASH160_A_With_B";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0204:
+      osstr << "SHA256_A_To_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0205:
+      osstr << "Check_SHA256_A_With_B";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0300:
+      osstr << "Get_Block_Timestamp";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0301:
+      osstr << "Get_Creation_Timestamp";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0302:
+      osstr << "Get_Last_Block_Timestamp";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0303:
+      osstr << "Put_Last_Block_Hash_In_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0304:
+      osstr << "A_To_Tx_After_Timestamp";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0305:
+      osstr << "Get_Type_For_Tx_In_A";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0306:
+      osstr << "Get_Amount_For_Tx_In_A";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0307:
+      osstr << "Get_Timestamp_For_Tx_In_A";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0308:
+      osstr << "Get_Random_Id_For_Tx_In_A";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0309:
+      osstr << "Message_From_Tx_In_A_To_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x030a:
+      osstr << "B_To_Address_Of_Tx_In_A";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x030b:
+      osstr << "B_To_Address_Of_Creator";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0400:
+      osstr << "Get_Current_Balance";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0401:
+      osstr << "Get_Previous_Balance";
+      op_expected = e_op_code_EXT_FUN_RET;
+      break;
+
+      case 0x0402:
+      osstr << "Send_To_Address_In_B";
+      op_expected = e_op_code_EXT_FUN_DAT;
+      break;
+
+      case 0x0403:
+      osstr << "Send_All_To_Address_In_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0404:
+      osstr << "Send_Old_To_Address_In_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0405:
+      osstr << "Send_A_To_Address_In_B";
+      op_expected = e_op_code_EXT_FUN;
+      break;
+
+      case 0x0406:
+      osstr << "Add_Minutes_To_Timestamp";
+      op_expected = e_op_code_EXT_FUN_RET_DAT_2;
+      break;
+
+      default:
+      osstr << "0x" << hex << setw( 4 ) << setfill( '0' ) << fun;
+   }
+
+   if( op && op_expected && op != op_expected )
+      osstr << " *** invalid op ***";
+
+   return osstr.str( );
+}
+
+map< int32_t, function_data > g_function_data;
+
+int64_t get_function_data( int32_t func_num )
+{
+   if( func_num == g_increment_func )
+   {
+      if( g_first_call )
+         g_first_call = false;
+      else
+      {
+         for( map< int32_t, function_data >::iterator i = g_function_data.begin( ); i != g_function_data.end( ); ++i )
+         {
+            if( ++( i->second.offset ) >= i->second.data.size( ) )
+            {
+               if( i->second.loop )
+                  i->second.offset = 0;
+               else
+                  --( i->second.offset );
+            }
+         }
+      }
+   }
+
+   int64_t rc = g_function_data[ func_num ].data[ g_function_data[ func_num ].offset ];
+
+   return rc;
+}
+
+int64_t func( int32_t func_num, machine_state& state )
+{
+   int64_t rc = 0;
+
+   if( func_num == 1 )
+      rc = g_val;
+   else if( func_num == 2 ) // get a value
+   {
+      if( g_val == 9 )
+         rc = g_val = 0;
+      else
+         rc = ++g_val;
+   }
+   else if( func_num == 3 ) // get size
+      rc = 10;
+   else if( func_num == 4 ) // get func num
+      rc = func_num;
+   else if( func_num == 25 || func_num == 32 ) // get balance (prior)
+   {
+      rc = g_balance;
+      if( g_function_data.count( func_num ) )
+      {
+         cout << "(resetting function data)\n";
+         g_first_call = true;
+         for( map< int32_t, function_data >::iterator i = g_function_data.begin( ); i != g_function_data.end( ); ++i )
+            i->second.offset = 0;
+      }
+   }
+   else if( func_num == 0x0100 ) // Get_A1
+      rc = state.a1;
+   else if( func_num == 0x0101 ) // Get_A2
+      rc = state.a2;
+   else if( func_num == 0x0102 ) // Get_A3
+      rc = state.a3;
+   else if( func_num == 0x0103 ) // Get_A4
+      rc = state.a4;
+   else if( func_num == 0x0104 ) // Get_B1
+      rc = state.b1;
+   else if( func_num == 0x0105 ) // Get_B2
+      rc = state.b2;
+   else if( func_num == 0x0106 ) // Get_B3
+      rc = state.b3;
+   else if( func_num == 0x0107 ) // Get_B4
+      rc = state.b4;
+   else if( func_num == 0x0120 ) // Clear_A
+   {
+      state.a1 = 0;
+      state.a2 = 0;
+      state.a3 = 0;
+      state.a4 = 0;
+   }
+   else if( func_num == 0x0121 ) // Clear_B
+   {
+      state.b1 = 0;
+      state.b2 = 0;
+      state.b3 = 0;
+      state.b4 = 0;
+   }
+   else if( func_num == 0x0122 ) // Clear_A_And_B
+   {
+      state.a1 = state.b1 = 0;
+      state.a2 = state.b2 = 0;
+      state.a3 = state.b3 = 0;
+      state.a4 = state.b4 = 0;
+   }
+   else if( func_num == 0x0123 ) // Copy_A_From_B
+   {
+      state.a1 = state.b1;
+      state.a2 = state.b2;
+      state.a3 = state.b3;
+      state.a4 = state.b4;
+   }
+   else if( func_num == 0x0124 ) // Copy_B_From_A
+   {
+      state.b1 = state.a1;
+      state.b2 = state.a2;
+      state.b3 = state.a3;
+      state.b4 = state.a4;
+   }
+   else if( func_num == 0x0125 ) // Check_A_Is_Zero
+   {
+      if( state.a1 == 0 && state.a2 == 0 && state.a3 == 0 && state.a4 == 0 )
+         rc = true;
+   }
+   else if( func_num == 0x0126 ) // Check_B_Is_Zero
+   {
+      if( state.b1 == 0 && state.b2 == 0 && state.b3 == 0 && state.b4 == 0 )
+         rc = true;
+   }
+   else if( func_num == 0x0127 ) // Check_A_Equals_B
+   {
+      if( state.a1 == state.b1 && state.a2 == state.b2 && state.a3 == state.b3 && state.a4 == state.b4 )
+         rc = true;
+   }
+   else if( func_num == 0x0128 ) // Swap_A_and_B
+   {
+      int64_t tmp_a1 = state.a1;
+      int64_t tmp_a2 = state.a2;
+      int64_t tmp_a3 = state.a3;
+      int64_t tmp_a4 = state.a4;
+
+      state.a1 = state.b1;
+      state.a2 = state.b2;
+      state.a3 = state.b3;
+      state.a4 = state.b4;
+
+      state.b1 = tmp_a1;
+      state.b2 = tmp_a2;
+      state.b3 = tmp_a3;
+      state.b4 = tmp_a4;
+   }
+   else if( func_num == 0x0129 ) // OR_A_with_B
+   {
+      state.a1 = state.a1 | state.b1;
+      state.a2 = state.a2 | state.b2;
+      state.a3 = state.a3 | state.b3;
+      state.a4 = state.a4 | state.b4;
+   }
+   else if( func_num == 0x012a ) // OR_B_with_A
+   {
+      state.b1 = state.a1 | state.b1;
+      state.b2 = state.a2 | state.b2;
+      state.b3 = state.a3 | state.b3;
+      state.b4 = state.a4 | state.b4;
+   }
+   else if( func_num == 0x012b ) // AND_A_with_B
+   {
+      state.a1 = state.a1 & state.b1;
+      state.a2 = state.a2 & state.b2;
+      state.a3 = state.a3 & state.b3;
+      state.a4 = state.a4 & state.b4;
+   }
+   else if( func_num == 0x012c ) // AND_B_with_A
+   {
+      state.b1 = state.a1 & state.b1;
+      state.b2 = state.a2 & state.b2;
+      state.b3 = state.a3 & state.b3;
+      state.b4 = state.a4 & state.b4;
+   }
+   else if( func_num == 0x012d ) // XOR_A_with_B
+   {
+      state.a1 = state.a1 ^ state.b1;
+      state.a2 = state.a2 ^ state.b2;
+      state.a3 = state.a3 ^ state.b3;
+      state.a4 = state.a4 ^ state.b4;
+   }
+   else if( func_num == 0x012e ) // XOR_B_with_A
+   {
+      state.b1 = state.a1 ^ state.b1;
+      state.b2 = state.a2 ^ state.b2;
+      state.b3 = state.a3 ^ state.b3;
+      state.b4 = state.a4 ^ state.b4;
+   }
+   else if( g_function_data.count( func_num ) )
+      rc = get_function_data( func_num );
+
+   if( func_num != 2 )
+   {
+      if( func_num < 0x100 )
+         cout << "func: " << dec << func_num << " rc: " << hex << setw( 16 ) << setfill( '0' ) << rc << '\n';
+      else
+         cout << "func: " << decode_function_name( func_num, 0 )
+          << " rc: 0x" << hex << setw( 16 ) << setfill( '0' ) << rc << '\n';
+   }
+
+   return rc;
+}
+
+int64_t func1( int32_t func_num, machine_state& state, int64_t value, int8_t* p_data = 0, int32_t dsize = 0 )
+{
+   int64_t rc = 0;
+
+   if( func_num == 1 ) // echo
+      cout << dec << value << '\n';
+   else if( func_num == 2 )
+      rc = value * 2; // double it
+   else if( func_num == 3 )
+      rc = value / 2; // halve it
+   else if( func_num == 26 || func_num == 33 ) // pay balance (prior)
+   {
+      cout << "payout " << dec << g_balance << " to account: " << value << '\n';
+      g_balance = 0;
+   }
+   else if( func_num == 0x0110 ) // Set_A1
+      state.a1 = value;
+   else if( func_num == 0x0111 ) // Set_A2
+      state.a2 = value;
+   else if( func_num == 0x0112 ) // Set_A3
+      state.a3 = value;
+   else if( func_num == 0x0113 ) // Set_A4
+      state.a4 = value;
+   else if( func_num == 0x0116 ) // Set_B1
+      state.b1 = value;
+   else if( func_num == 0x0117 ) // Set_B2
+      state.b2 = value;
+   else if( func_num == 0x0118 ) // Set_B3
+      state.b3 = value;
+   else if( func_num == 0x0119 ) // Set_B4
+      state.b4 = value;
+   else if( g_function_data.count( func_num ) )
+      rc = get_function_data( func_num );
+
+   if( func_num != 1 && func_num != 26 )
+   {
+      if( func_num < 0x100 )
+         cout << "func1: " << dec << func_num << " with " << value
+          << " rc: " << hex << setw( 16 ) << setfill( '0' ) << rc << '\n';
+      else
+         cout << "func1: " << decode_function_name( func_num, 0 )
+          << " with " << value << " rc: 0x" << hex << setw( 16 ) << setfill( '0' ) << rc << '\n';
+   }
+
+   return rc;
+}
+
+int64_t func2( int32_t func_num, machine_state& state, int64_t value1, int64_t value2, int8_t* p_data = 0, int32_t dsize = 0 )
+{
+   int64_t rc = 0;
+
+   if( func_num == 2 )
+      rc = value1 * value2; // multiply values
+   else if( func_num == 3 )
+      rc = value1 / value2; // divide values
+   else if( func_num == 4 )
+      rc = value1 + value2; // sum values
+   else if( func_num == 31 ) // send amount to address
+   {
+      if( value1 > g_balance )
+         value1 = g_balance;
+
+      cout << "payout " << dec << value1 << " to account: " << hex << setw( 8 ) << setfill( '0' ) << value2 << '\n';
+      g_balance -= value1;
+   }
+   else if( func_num == 0x0114 ) // Set_A1_A2
+   {
+      state.a1 = value1;
+      state.a2 = value2;
+   }
+   else if( func_num == 0x0115 ) // Set_A3_A4
+   {
+      state.a3 = value1;
+      state.a4 = value2;
+   }
+   else if( func_num == 0x011a ) // Set_B1_B2
+   {
+      state.b1 = value1;
+      state.b2 = value2;
+   }
+   else if( func_num == 0x011b ) // Set_B3_B4
+   {
+      state.b3 = value1;
+      state.b4 = value2;
+   }
+   else if( g_function_data.count( func_num ) )
+      rc = get_function_data( func_num );
+
+   if( func_num != 31 )
+   {
+      if( func_num < 0x100 )
+         cout << "func2: " << dec << func_num << " with " << value1
+          << " and " << value2 << " rc: " << hex << setw( 16 ) << setfill( '0' ) << rc << '\n';
+      else
+         cout << "func2: " << decode_function_name( func_num, 0 ) << " with " << value1
+          << " and " << value2 << " rc: 0x" << hex << setw( 16 ) << setfill( '0' ) << rc << '\n';
+   }
+
+   return rc;
+}
+
+int get_fun( int8_t* p_code, int32_t csize, const machine_state& state, int16_t& fun )
+{
+   if( state.pc + ( int32_t )sizeof( int16_t ) >= csize )
+      return -1;
+   else
+   {
+      fun = *( int16_t* )( p_code + state.pc + 1 );
+
+      return 0;
+   }
+}
+
+int get_addr( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int32_t& addr, bool is_code = false )
+{
+   if( state.pc + ( int32_t )sizeof( int32_t ) >= csize )
+      return -1;
+   else
+   {
+      addr = *( int32_t* )( p_code + state.pc + 1 );
+
+      if( addr < 0 || addr > c_max_to_multiply || ( is_code && addr >= csize ) )
+         return -1;
+      else if( !is_code && ( ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize ) )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int get_addrs( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int32_t& addr1, int32_t& addr2 )
+{
+   if( state.pc + ( int32_t )sizeof( int32_t ) + ( int32_t )sizeof( int32_t ) >= csize )
+      return -1;
+   else
+   {
+      addr1 = *( int32_t* )( p_code + state.pc + 1 );
+      addr2 = *( int32_t* )( p_code + state.pc + 1 + sizeof( int32_t ) );
+
+      if( addr1 < 0 || addr1 > c_max_to_multiply
+       || addr2 < 0 || addr2 > c_max_to_multiply
+       || ( addr1 * 8 ) < 0 || ( addr2 * 8 ) < 0
+       || ( addr1 * 8 ) + ( int32_t )sizeof( int64_t ) > dsize
+       || ( addr2 * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int get_addr_off( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int32_t& addr, int8_t& off )
+{
+   if( state.pc + ( int32_t )sizeof( int32_t ) + ( int32_t )sizeof( int8_t ) >= csize )
+      return -1;
+   else
+   {
+      addr = *( int32_t* )( p_code + state.pc + 1 );
+      off = *( int8_t* )( p_code + state.pc + 1 + sizeof( int32_t ) );
+
+      if( addr < 0 || addr > c_max_to_multiply || ( addr * 8 ) < 0
+       || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize || state.pc + off >= csize )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int get_addrs_off( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int32_t& addr1, int32_t& addr2, int8_t& off )
+{
+   if( state.pc + ( int32_t )sizeof( int32_t ) + ( int32_t )sizeof( int32_t ) + ( int32_t )sizeof( int8_t ) >= csize )
+      return -1;
+   else
+   {
+      addr1 = *( int32_t* )( p_code + state.pc + 1 );
+      addr2 = *( int32_t* )( p_code + state.pc + 1 + sizeof( int32_t ) );
+      off = *( int8_t* )( p_code + state.pc + 1 + sizeof( int32_t ) + sizeof( int32_t ) );
+
+      if( addr1 < 0 || addr1 < c_max_to_multiply
+       || addr2 < 0 || addr2 < c_max_to_multiply
+       || ( addr1 * 8 ) < 0 || ( addr2 * 8 ) < 0
+       || ( addr1 * 8 ) + ( int32_t )sizeof( int64_t ) > dsize
+       || ( addr2 * 8 ) + ( int32_t )sizeof( int64_t ) > dsize || state.pc + off >= csize )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int get_fun_addr( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int16_t& fun, int32_t& addr )
+{
+   if( state.pc + ( int32_t )sizeof( int16_t ) + ( int32_t )sizeof( int32_t ) >= csize )
+      return -1;
+   else
+   {
+      fun = *( int16_t* )( p_code + state.pc + 1 );
+      addr = *( int32_t* )( p_code + state.pc + 1 + sizeof( int16_t ) );
+
+      if( addr < 0 || addr > c_max_to_multiply
+       || ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int get_fun_addrs( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int16_t& fun, int32_t& addr1, int32_t& addr2 )
+{
+   if( state.pc + ( int32_t )sizeof( int16_t )
+    + ( int32_t )sizeof( int32_t ) + ( int32_t )sizeof( int32_t ) >= csize )
+      return -1;
+   else
+   {
+      fun = *( int16_t* )( p_code + state.pc + 1 );
+      addr1 = *( int32_t* )( p_code + state.pc + 1 + sizeof( int16_t ) );
+      addr2 = *( int32_t* )( p_code + state.pc + 1 + sizeof( int16_t ) + sizeof( int32_t ) );
+
+      if( addr1 < 0 || addr1 > c_max_to_multiply
+       || addr2 < 0 || addr2 > c_max_to_multiply
+       || ( addr1 * 8 ) < 0 || ( addr2 * 8 ) < 0
+       || ( addr1 * 8 ) + ( int32_t )sizeof( int64_t ) > dsize
+       || ( addr2 * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int get_addr_val( int8_t* p_code,
+ int32_t csize, int32_t dsize, const machine_state& state, int32_t& addr, int64_t& val )
+{
+   if( state.pc + ( int32_t )sizeof( int32_t ) + ( int32_t )sizeof( int64_t ) >= csize )
+      return -1;
+   else
+   {
+      addr = *( int32_t* )( p_code + state.pc + 1 );
+      val = *( int64_t* )( p_code + state.pc + 1 + ( int32_t )sizeof( int32_t ) );
+
+      if( addr < 0 || addr > c_max_to_multiply
+       || ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+         return -1;
+      else
+         return 0;
+   }
+}
+
+int process_op( int8_t* p_code, int32_t csize, int8_t* p_data, int32_t dsize,
+ int32_t cssize, int32_t ussize, bool disassemble, bool determine_jumps, machine_state& state )
+{
+   int rc = 0;
+
+   bool invalid = false;
+   bool had_overflow = false;
+
+   if( csize < 1 || state.pc >= csize )
+      return 0;
+
+   if( determine_jumps )
+      state.jumps.insert( state.pc );
+
+   int8_t op = p_code[ state.pc ];
+
+   if( op && disassemble && !determine_jumps )
+   {
+      cout << hex << setw( 8 ) << setfill( '0' ) << state.pc;
+      if( state.pc == state.opc )
+         cout << "* ";
+      else
+         cout << "  ";
+   }
+
+   if( op == e_op_code_NOP )
+   {
+      if( disassemble )
+      {
+         if( !determine_jumps )
+            cout << "NOP\n";
+         while( true )
+         {
+            ++rc;
+            if( state.pc + rc >= csize || p_code[ state.pc + rc ] != e_op_code_NOP )
+               break;
+         }
+      }
+      else while( true )
+      {
+         ++rc;
+         ++state.pc;
+         if( state.pc >= csize || p_code[ state.pc ] != e_op_code_NOP )
+            break;
+      }
+   }
+   else if( op == e_op_code_SET_VAL )
+   {
+      int32_t addr;
+      int64_t val;
+      rc = get_addr_val( p_code, csize, dsize, state, addr, val );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int64_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "SET @" << hex << setw( 8 ) << setfill( '0' )
+                << addr << " #" << setw( 16 ) << setfill( '0' ) << val << '\n';
+         }
+         else
+         {
+            state.pc += rc;
+            *( int64_t* )( p_data + ( addr * 8 ) ) = val;
+         }
+      }
+   }
+   else if( op == e_op_code_SET_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "SET @" << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 8 ) << setfill( '0' ) << addr2 << '\n';
+         }
+         else
+         {
+            state.pc += rc;
+            *( int64_t* )( p_data + ( addr1 * 8 ) ) = *( int64_t* )( p_data + ( addr2 * 8 ) );
+         }
+      }
+   }
+   else if( op == e_op_code_CLR_DAT )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "CLR @" << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+         }
+         else
+         {
+            state.pc += rc;
+            *( int64_t* )( p_data + ( addr * 8 ) ) = 0;
+         }
+      }
+   }
+   else if( op == e_op_code_INC_DAT || op == e_op_code_DEC_DAT || op == e_op_code_NOT_DAT )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_INC_DAT )
+                  cout << "INC @";
+               else if( op == e_op_code_DEC_DAT )
+                  cout << "DEC @";
+               else
+                  cout << "NOT @";
+
+               cout << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+            }
+         }
+         else
+         {
+            state.pc += rc;
+
+            if( op == e_op_code_INC_DAT )
+               ++*( int64_t* )( p_data + ( addr * 8 ) );
+            else if( op == e_op_code_DEC_DAT )
+               --*( int64_t* )( p_data + ( addr * 8 ) );
+            else
+               *( int64_t* )( p_data + ( addr * 8 ) ) = ~*( int64_t* )( p_data + ( addr * 8 ) );
+         }
+      }
+   }
+   else if( op == e_op_code_ADD_DAT || op == e_op_code_SUB_DAT
+    || op == e_op_code_MUL_DAT || op == e_op_code_DIV_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_ADD_DAT )
+                  cout << "ADD @";
+               else if( op == e_op_code_SUB_DAT )
+                  cout << "SUB @";
+               else if( op == e_op_code_MUL_DAT )
+                  cout << "MUL @";
+               else
+                  cout << "DIV @";
+
+               cout << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 8 ) << setfill( '0' ) << addr2 << '\n';
+            }
+         }
+         else
+         {
+            int64_t val = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            if( op == e_op_code_DIV_DAT && val == 0 )
+               rc = -2;
+            else
+            {
+               state.pc += rc;
+
+               if( op == e_op_code_ADD_DAT )
+                  *( int64_t* )( p_data + ( addr1 * 8 ) ) += *( int64_t* )( p_data + ( addr2 * 8 ) );
+               else if( op == e_op_code_SUB_DAT )
+                  *( int64_t* )( p_data + ( addr1 * 8 ) ) -= *( int64_t* )( p_data + ( addr2 * 8 ) );
+               else if( op == e_op_code_MUL_DAT )
+                  *( int64_t* )( p_data + ( addr1 * 8 ) ) *= *( int64_t* )( p_data + ( addr2 * 8 ) );
+               else
+                  *( int64_t* )( p_data + ( addr1 * 8 ) ) /= *( int64_t* )( p_data + ( addr2 * 8 ) );
+            }
+         }
+      }
+   }
+   else if( op == e_op_code_BOR_DAT
+    || op == e_op_code_AND_DAT || op == e_op_code_XOR_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_BOR_DAT )
+                  cout << "BOR @";
+               else if( op == e_op_code_AND_DAT )
+                  cout << "AND @";
+               else
+                  cout << "XOR @";
+
+               cout << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 8 ) << setfill( '0' ) << addr2 << '\n';
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            if( op == e_op_code_BOR_DAT )
+               *( int64_t* )( p_data + ( addr1 * 8 ) ) |= val;
+            else if( op == e_op_code_AND_DAT )
+               *( int64_t* )( p_data + ( addr1 * 8 ) ) &= val;
+            else
+               *( int64_t* )( p_data + ( addr1 * 8 ) ) ^= val;
+         }
+      }
+   }
+   else if( op == e_op_code_SET_IND )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "SET @" << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $($" << setw( 8 ) << setfill( '0' ) << addr2 << ")\n";
+         }
+         else
+         {
+            int64_t addr = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            if( addr < 0 || addr > c_max_to_multiply
+             || ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+               rc = -1;
+            else
+            {
+               state.pc += rc;
+              *( int64_t* )( p_data + ( addr1 * 8 ) ) = *( int64_t* )( p_data + ( addr * 8 ) );
+            }
+         }
+      }
+   }
+   else if( op == e_op_code_SET_IDX )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      int32_t size = sizeof( int32_t ) + sizeof( int32_t );
+
+      if( rc == 0 || disassemble )
+      {
+         int32_t addr3;
+         rc = get_addr( p_code + size, csize, dsize, state, addr3 );
+
+         if( rc == 0 || disassemble )
+         {
+            rc = 1 + size + sizeof( int32_t );
+
+            if( disassemble )
+            {
+               if( !determine_jumps )
+                  cout << "SET @" << hex << setw( 8 ) << setfill( '0' )
+                   << addr1 << " $($" << setw( 8 ) << setfill( '0' ) << addr2
+                   << "+$" << setw( 8 ) << setfill( '0' ) << addr3 << ")\n";
+            }
+            else
+            {
+               int64_t base = *( int64_t* )( p_data + ( addr2 * 8 ) );
+               int64_t offs = *( int64_t* )( p_data + ( addr3 * 8 ) );
+
+               int64_t addr = base + offs;
+
+               if( addr < 0 || addr > c_max_to_multiply
+                || ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+                  rc = -1;
+               else
+               {
+                  state.pc += rc;
+                 *( int64_t* )( p_data + ( addr1 * 8 ) ) = *( int64_t* )( p_data + ( addr * 8 ) );
+               }
+            }
+         }
+      }
+   }
+   else if( op == e_op_code_PSH_DAT || op == e_op_code_POP_DAT )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_PSH_DAT )
+                  cout << "PSH $";
+               else
+                  cout << "POP @";
+
+               cout << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+            }
+         }
+         else if( ( op == e_op_code_PSH_DAT && state.us == ( ussize / 8 ) )
+          || ( op == e_op_code_POP_DAT && state.us == 0 ) )
+            rc = -1;
+         else
+         {
+            state.pc += rc;
+            if( op == e_op_code_PSH_DAT )
+               *( int64_t* )( p_data + dsize + cssize + ussize
+                - ( ++state.us * 8 ) ) = *( int64_t* )( p_data + ( addr * 8 ) );
+            else
+               *( int64_t* )( p_data + ( addr * 8 ) )
+                = *( int64_t* )( p_data + dsize + cssize + ussize - ( state.us-- * 8 ) );
+         }
+      }
+   }
+   else if( op == e_op_code_JMP_SUB )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr, true );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "JSR :" << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+         }
+         else
+         {
+            if( state.cs == ( cssize / 8 ) )
+               rc = -1;
+            else if( state.jumps.count( addr ) )
+            {
+               *( int64_t* )( p_data + dsize + cssize - ( ++state.cs * 8 ) ) = state.pc + rc;
+               state.pc = addr;
+            }
+            else
+               rc = -2;
+         }
+      }
+   }
+   else if( op == e_op_code_RET_SUB )
+   {
+      rc = 1;
+
+      if( disassemble )
+      {
+         if( !determine_jumps )
+            cout << "RET\n";
+      }
+      else
+      {
+         if( state.cs == 0 )
+            rc = -1;
+         else
+         {
+            int64_t val = *( int64_t* )( p_data + dsize + cssize - ( state.cs-- * 8 ) );
+            int32_t addr = ( int32_t )val;
+            if( state.jumps.count( addr ) )
+               state.pc = addr;
+            else
+               rc = -2;
+         }
+      }
+   }
+   else if( op == e_op_code_IND_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "SET @($" << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << ") $" << setw( 8 ) << setfill( '0' ) << addr2 << "\n";
+         }
+         else
+         {
+            int64_t addr = *( int64_t* )( p_data + ( addr1 * 8 ) );
+
+            if( addr < 0 || addr > c_max_to_multiply
+             || ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+               rc = -1;
+            else
+            {
+               state.pc += rc;
+              *( int64_t* )( p_data + ( addr * 8 ) ) = *( int64_t* )( p_data + ( addr2 * 8 ) );
+            }
+         }
+      }
+   }
+   else if( op == e_op_code_IDX_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      int32_t size = sizeof( int32_t ) + sizeof( int32_t );
+
+      if( rc == 0 || disassemble )
+      {
+         int32_t addr3;
+         rc = get_addr( p_code + size, csize, dsize, state, addr3 );
+
+         if( rc == 0 || disassemble )
+         {
+            rc = 1 + size + sizeof( int32_t );
+
+            if( disassemble )
+            {
+               if( !determine_jumps )
+                  cout << "SET @($" << hex << setw( 8 ) << setfill( '0' )
+                   << addr1 << "+$" << setw( 8 ) << setfill( '0' ) << addr2
+                   << ") $" << setw( 8 ) << setfill( '0' ) << addr3 << "\n";
+            }
+            else
+            {
+               int64_t base = *( int64_t* )( p_data + ( addr1 * 8 ) );
+               int64_t offs = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+               int64_t addr = base + offs;
+
+               if( addr < 0 || addr > c_max_to_multiply
+                || ( addr * 8 ) < 0 || ( addr * 8 ) + ( int32_t )sizeof( int64_t ) > dsize )
+                  rc = -1;
+               else
+               {
+                  state.pc += rc;
+                 *( int64_t* )( p_data + ( addr * 8 ) ) = *( int64_t* )( p_data + ( addr3 * 8 ) );
+               }
+            }
+         }
+      }
+   }
+   else if( op == e_op_code_MOD_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               cout << "MOD @" << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 16 ) << setfill( '0' ) << addr2 << '\n';
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            *( int64_t* )( p_data + ( addr1 * 8 ) ) %= val;
+         }
+      }
+   }
+   else if( op == e_op_code_SHL_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               cout << "SHL @" << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 16 ) << setfill( '0' ) << addr2 << '\n';
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            *( int64_t* )( p_data + ( addr1 * 8 ) ) <<= val;
+         }
+      }
+   }
+   else if( op == e_op_code_SHR_DAT )
+   {
+      int32_t addr1, addr2;
+      rc = get_addrs( p_code, csize, dsize, state, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               cout << "SHR @" << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 16 ) << setfill( '0' ) << addr2 << '\n';
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            *( int64_t* )( p_data + ( addr1 * 8 ) ) >>= val;
+         }
+      }
+   }
+   else if( op == e_op_code_JMP_ADR )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr, true );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "JMP :" << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+         }
+         else if( state.jumps.count( addr ) )
+            state.pc = addr;
+         else
+            rc = -2;
+      }
+   }
+   else if( op == e_op_code_BZR_DAT || op == e_op_code_BNZ_DAT )
+   {
+      int8_t off;
+      int32_t addr;
+      rc = get_addr_off( p_code, csize, dsize, state, addr, off );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int8_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_BZR_DAT )
+                  cout << "BZR $";
+               else
+                  cout << "BNZ $";
+
+               cout << hex << setw( 8 ) << setfill( '0' )
+                << addr << " :" << setw( 8 ) << setfill( '0' ) << ( state.pc + off ) << '\n';
+            }
+         }
+         else
+         {
+            int64_t val = *( int64_t* )( p_data + ( addr * 8 ) );
+
+            if( ( op == e_op_code_BZR_DAT && val == 0 )
+             || ( op == e_op_code_BNZ_DAT && val != 0 ) )
+            {
+               if( state.jumps.count( state.pc + off ) )
+                  state.pc += off;
+               else
+                  rc = -2;
+            }
+            else
+               state.pc += rc;
+         }
+      }
+   }
+   else if( op == e_op_code_BGT_DAT || op == e_op_code_BLT_DAT
+    || op == e_op_code_BGE_DAT || op == e_op_code_BLE_DAT
+    || op == e_op_code_BEQ_DAT || op == e_op_code_BNE_DAT )
+   {
+      int8_t off;
+      int32_t addr1, addr2;
+      rc = get_addrs_off( p_code, csize, dsize, state, addr1, addr2, off );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t ) + sizeof( int32_t ) + sizeof( int8_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_BGT_DAT )
+                  cout << "BGT $";
+               else if( op == e_op_code_BLT_DAT )
+                  cout << "BLT $";
+               else if( op == e_op_code_BGE_DAT )
+                  cout << "BGE $";
+               else if( op == e_op_code_BLE_DAT )
+                  cout << "BLE $";
+               else if( op == e_op_code_BEQ_DAT )
+                  cout << "BEQ $";
+               else
+                  cout << "BNE $";
+
+               cout << hex << setw( 8 ) << setfill( '0' )
+                << addr1 << " $" << setw( 8 ) << setfill( '0' )
+                << addr2 << " :" << setw( 8 ) << setfill( '0' ) << ( state.pc + off ) << '\n';
+            }
+         }
+         else
+         {
+            int64_t val1 = *( int64_t* )( p_data + ( addr1 * 8 ) );
+            int64_t val2 = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            if( ( op == e_op_code_BGT_DAT && val1 > val2 )
+             || ( op == e_op_code_BLT_DAT && val1 < val2 )
+             || ( op == e_op_code_BGE_DAT && val1 >= val2 )
+             || ( op == e_op_code_BLE_DAT && val1 <= val2 )
+             || ( op == e_op_code_BEQ_DAT && val1 == val2 )
+             || ( op == e_op_code_BNE_DAT && val1 != val2 ) )
+            {
+               if( state.jumps.count( state.pc + off ) )
+                  state.pc += off;
+               else
+                  rc = -2;
+            }
+            else
+               state.pc += rc;
+         }
+      }
+   }
+   else if( op == e_op_code_SLP_DAT )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr, true );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "SLP @" << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+         }
+         else
+         {
+            // NOTE: The "sleep_until" state value would be set to the current block + $addr.
+
+            state.pc += rc;
+         }
+      }
+   }
+   else if( op == e_op_code_FIZ_DAT || op == e_op_code_STZ_DAT )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr );
+
+      if( rc == 0 || disassemble )
+      {
+         if( disassemble )
+         {
+            rc = 1 + sizeof( int32_t );
+
+            if( !determine_jumps )
+            {
+               if( op == e_op_code_FIZ_DAT )
+                  cout << "FIZ $";
+               else
+                  cout << "STZ $";
+
+               cout << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+            }
+         }
+         else
+         {
+            if( *( int64_t* )( p_data + ( addr * 8 ) ) == 0 )
+            {
+               if( op == e_op_code_STZ_DAT )
+               {
+                  state.pc += rc;
+                  state.stopped = true;
+               }   
+               else
+               {
+                  state.pc = state.pcs;
+                  state.finished = true;
+               }
+            }
+            else
+            {
+               rc = 1 + sizeof( int32_t );
+               state.pc += rc;
+            }
+         }
+      }
+   }
+   else if( op == e_op_code_FIN_IMD || op == e_op_code_STP_IMD )
+   {
+      if( disassemble )
+      {
+         rc = 1;
+
+         if( !determine_jumps )
+         {
+            if( op == e_op_code_FIN_IMD )
+               cout << "FIN\n";
+            else
+               cout << "STP\n";
+         }
+      }
+      else if( op == e_op_code_STP_IMD )
+      {
+         state.pc += rc;
+         state.stopped = true;
+      }
+      else
+      {
+         state.pc = state.pcs;
+         state.finished = true;
+      }
+   }
+   else if( op == e_op_code_SLP_IMD )
+   {
+      if( rc == 0 || disassemble )
+      {
+         rc = 1;
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "SLP\n";
+         }
+         else
+         {
+            // NOTE: The "sleep_until" state value would be set to the current block + 1.
+
+            state.pc += rc;
+         }
+      }
+   }
+   else if( op == e_op_code_ERR_ADR )
+   {
+      int32_t addr;
+      rc = get_addr( p_code, csize, dsize, state, addr, true );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+               cout << "ERR :" << hex << setw( 8 ) << setfill( '0' ) << addr << '\n';
+         }
+         else if( state.jumps.count( addr ) )
+            state.pce = addr;
+         else
+            rc = -3;
+      }
+   }
+   else if( op == e_op_code_SET_PCS )
+   {
+      rc = 1;
+
+      if( disassemble )
+      {
+         if( !determine_jumps )
+            cout << "PCS\n";
+      }
+      else
+      {
+         state.pc += rc;
+         state.pcs = state.pc;
+      }
+   }
+   else if( op == e_op_code_EXT_FUN )
+   {
+      int16_t fun;
+      rc = get_fun( p_code, csize, state, fun );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int16_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( fun < 0x100 )
+                  cout << "FUN " << dec << fun << "\n";
+               else
+                  cout << "FUN " << decode_function_name( fun, op ) << "\n";
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            func( fun, state );
+         }
+      }
+   }
+   else if( op == e_op_code_EXT_FUN_DAT )
+   {
+      int16_t fun;
+      int32_t addr;
+      rc = get_fun_addr( p_code, csize, dsize, state, fun, addr );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int16_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( fun < 0x100 )
+                  cout << "FUN " << dec << fun << " $" << hex << setw( 8 ) << setfill( '0' ) << addr << "\n";
+               else
+                  cout << "FUN " << decode_function_name( fun, op )
+                   << " $" << hex << setw( 8 ) << setfill( '0' ) << addr << "\n";
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val = *( int64_t* )( p_data + ( addr * 8 ) );
+
+            func1( fun, state, val, p_data, dsize );
+         }
+      }
+   }
+   else if( op == e_op_code_EXT_FUN_DAT_2 )
+   {
+      int16_t fun;
+      int32_t addr1, addr2;
+      rc = get_fun_addrs( p_code, csize, dsize, state, fun, addr1, addr2 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int16_t ) + sizeof( int32_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( fun < 0x100 )
+                  cout << "FUN " << dec << fun << " $" << hex << setw( 8 )
+                   << setfill( '0' ) << addr1 << " $" << setw( 8 ) << setfill( '0' ) << addr2 << "\n";
+               else
+                  cout << "FUN " << decode_function_name( fun, op ) << " $" << hex << setw( 8 )
+                   << setfill( '0' ) << addr1 << " $" << setw( 8 ) << setfill( '0' ) << addr2 << "\n";
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val1 = *( int64_t* )( p_data + ( addr1 * 8 ) );
+            int64_t val2 = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            func2( fun, state, val1, val2, p_data, dsize );
+         }
+      }
+   }
+   else if( op == e_op_code_EXT_FUN_RET )
+   {
+      int16_t fun;
+      int32_t addr;
+      rc = get_fun_addr( p_code, csize, dsize, state, fun, addr );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + sizeof( int16_t ) + sizeof( int32_t );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( fun < 0x100 )
+                  cout << "FUN @" << hex << setw( 8 ) << setfill( '0' ) << addr << ' ' << dec << fun << '\n';
+               else
+                  cout << "FUN @" << hex << setw( 8 ) << setfill( '0' ) << addr
+                   << " " << decode_function_name( fun, op ) << '\n';
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            *( int64_t* )( p_data + ( addr * 8 ) ) = func( fun, state );
+         }
+      }
+   }
+   else if( op == e_op_code_EXT_FUN_RET_DAT || op == e_op_code_EXT_FUN_RET_DAT_2 )
+   {
+      int16_t fun;
+      int32_t addr1, addr2;
+      rc = get_fun_addrs( p_code, csize, dsize, state, fun, addr1, addr2 );
+
+      int32_t size = sizeof( int16_t ) + sizeof( int32_t ) + sizeof( int32_t );
+
+      int32_t addr3;
+      if( ( rc == 0 || disassemble ) && op == e_op_code_EXT_FUN_RET_DAT_2 )
+         rc = get_addr( p_code + size, csize, dsize, state, addr3 );
+
+      if( rc == 0 || disassemble )
+      {
+         rc = 1 + size + ( op == e_op_code_EXT_FUN_RET_DAT_2 ? sizeof( int32_t ) : 0 );
+
+         if( disassemble )
+         {
+            if( !determine_jumps )
+            {
+               if( fun < 0x100 )
+                  cout << "FUN @" << hex << setw( 8 ) << setfill( '0' ) << addr1
+                   << ' ' << dec << fun << " $" << setw( 8 ) << setfill( '0' ) << addr2;
+               else
+                  cout << "FUN @" << hex << setw( 8 ) << setfill( '0' ) << addr1 << " "
+                   << decode_function_name( fun, op ) << " $" << setw( 8 ) << setfill( '0' ) << addr2;
+
+               if( op == e_op_code_EXT_FUN_RET_DAT_2 )
+                  cout << " $" << setw( 8 ) << setfill( '0' ) << addr3;
+
+               cout << "\n";
+            }
+         }
+         else
+         {
+            state.pc += rc;
+            int64_t val = *( int64_t* )( p_data + ( addr2 * 8 ) );
+
+            if( op != e_op_code_EXT_FUN_RET_DAT_2 )
+               *( int64_t* )( p_data + ( addr1 * 8 ) ) = func1( fun, state, val, p_data, dsize );
+            else
+            {
+               int64_t val2 = *( int64_t* )( p_data + ( addr3 * 8 ) );
+               *( int64_t* )( p_data + ( addr1 * 8 ) ) = func2( fun, state, val, val2, p_data, dsize );
+            }
+         }
+      }
+   }
+   else
+   {
+      if( !disassemble )
+         rc = -2;
+   }
+
+   if( rc == -1 && state.pce )
+   {
+      rc = 0;
+      state.pc = state.pce;
+   }
+
+   if( rc == -1 && disassemble && !determine_jumps )
+      cout << "\n(overflow)\n";
+
+   if( rc == -2 && disassemble && !determine_jumps )
+      cout << "\n(invalid op)\n";
+
+   if( rc >= 0 )
+      ++state.steps;
+
+   return rc;
+}
+
+void dump_state( const machine_state& state )
+{
+   cout << "pc: " << hex << setw( 8 ) << setfill( '0' ) << state.pc << '\n';
+
+   cout << "cs: " << dec << state.cs << '\n';
+   cout << "us: " << dec << state.us << '\n';
+
+   cout << "pce: " << hex << setw( 8 ) << setfill( '0' ) << state.pcs << '\n';
+   cout << "pcs: " << hex << setw( 8 ) << setfill( '0' ) << state.pcs << '\n';
+
+   cout << "steps: " << dec << state.steps << '\n';
+
+   cout << "a1: " << hex << setw( 16 ) << setfill( '0' ) << state.a1 << '\n';
+   cout << "a2: " << hex << setw( 16 ) << setfill( '0' ) << state.a2 << '\n';
+   cout << "a3: " << hex << setw( 16 ) << setfill( '0' ) << state.a3 << '\n';
+   cout << "a4: " << hex << setw( 16 ) << setfill( '0' ) << state.a4 << '\n';
+
+   cout << "b1: " << hex << setw( 16 ) << setfill( '0' ) << state.b1 << '\n';
+   cout << "b2: " << hex << setw( 16 ) << setfill( '0' ) << state.b2 << '\n';
+   cout << "b3: " << hex << setw( 16 ) << setfill( '0' ) << state.b3 << '\n';
+   cout << "b4: " << hex << setw( 16 ) << setfill( '0' ) << state.b4 << '\n';
+}
+
+void dump_bytes( int8_t* p_bytes, int num )
+{
+   for( int i = 0; i < num; i += 16 )
+   {
+      cout << hex << setw( 8 ) << setfill( '0' ) << i << ' ';
+
+      for( int j = 0; j < 16; j++ )
+      {
+         int val = ( unsigned char )p_bytes[ i + j ];
+
+         cout << ' ' << hex << setw( 2 ) << setfill( '0' ) << val;
+      }
+
+      cout << '\n';
+   }
+}
+
+void list_code( machine_state& state, int8_t* p_code, int32_t csize,
+ int8_t* p_data, int32_t dsize, int32_t cssize, int32_t ussize, bool determine_jumps = false )
+{
+   int32_t opc = state.pc;
+   int32_t osteps = state.steps;
+
+   state.pc = 0;
+   state.opc = opc;
+
+   while( true )
+   {
+      int rc = process_op( p_code, csize, p_data, dsize, cssize, ussize, true, determine_jumps, state );
+
+      if( rc <= 0 )
+         break;
+
+      state.pc += rc;
+   }
+
+   state.steps = osteps;
+   state.pc = opc;
+}
+
+bool check_has_balance( )
+{
+   if( g_balance == 0 )
+   {
+      cout << "(stopped - zero balance)\n";
+      return false;
+   }
+   else
+      return true;
+}
+
+void reset_machine( machine_state& state,
+ int8_t* p_code, int32_t csize, int8_t* p_data, int32_t dsize, int32_t cssize, int32_t ussize )
+{
+   state.reset( );
+   list_code( state, p_code, csize, p_data, dsize, cssize, ussize, true );
+
+   memset( p_data, 0, dsize + cssize + ussize );
+
+   g_first_call = true;
+
+   for( map< int32_t, function_data >::iterator i = g_function_data.begin( ); i != g_function_data.end( ); ++i )
+      i->second.offset = 0;
+}
+
+int main( )
+{
+   auto_ptr< int8_t > ap_code( new int8_t[ g_code_pages * c_code_page_bytes ] );
+   auto_ptr< int8_t > ap_data( new int8_t[ g_data_pages * c_data_page_bytes
+    + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes ] );
+
+   memset( ap_code.get( ), 0, g_code_pages * c_code_page_bytes );
+   memset( ap_data.get( ), 0, g_data_pages * c_data_page_bytes
+    + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes );
+
+   machine_state state;
+   set< int32_t > break_points;
+
+   string cmd, next;
+   while( cout << "\n> ", getline( cin, next ) )
+   {
+      if( next.empty( ) )
+         continue;
+
+      string::size_type pos = next.find( ' ' );
+      if( pos == string::npos )
+      {
+         cmd = next;
+         next.erase( );
+      }
+      else
+      {
+         cmd = next.substr( 0, pos );
+         next.erase( 0, pos + 1 );
+      }
+
+      string arg_1, arg_2, arg_3;
+
+      pos = next.find( ' ' );
+      arg_1 = next.substr( 0, pos );
+      if( pos != string::npos )
+      {
+         arg_2 = next.substr( pos + 1 );
+
+         pos = arg_2.find( ' ' );
+         if( pos != string::npos )
+         {
+            arg_3 = arg_2.substr( pos + 1 );
+            arg_2.erase( pos );
+         }
+      }
+
+      if( cmd == "?" || cmd == "help" )
+      {
+         cout << "commands:\n";
+         cout << "---------\n";
+         cout << "code <hex byte values> [<[0x]offset>]\n";
+         cout << "data <hex byte values> [<[0x]offset>]\n";
+         cout << "run\n";
+         cout << "cont\n";
+         cout << "dump {code|data|stacks}\n";
+         cout << "list\n";
+         cout << "load <file>\n";
+         cout << "save <file>\n";
+         cout << "size [{code|data|call|user} [<pages>]]\n";
+         cout << "step [<num_steps>]\n";
+         cout << "break <[0x]value>\n";
+         cout << "reset\n";
+         cout << "state\n";
+         cout << "balance [<amount>]\n";
+         cout << "function <[+]#> [<[0x]value1[,[0x]value2[,...]]>] [loop]\n";
+         cout << "functions\n";
+         cout << "help\n";
+         cout << "exit" << endl;
+      }
+      else if( ( cmd == "code" || cmd == "data" ) && arg_1.size( ) && ( arg_1.size( ) % 2 == 0 ) )
+      {
+         int32_t offset = 0;
+         if( !arg_2.empty( ) )
+         {
+            if( arg_2.size( ) > 2 && arg_2.find( "0x" ) == 0 )
+            {
+               istringstream isstr( arg_2.substr( 2 ) );
+               isstr >> hex >> offset;
+            }
+            else
+               offset = atoi( arg_2.c_str( ) );
+         }
+
+         int8_t* p_c = cmd == "code" ? ap_code.get( ) : ap_data.get( ) + offset;
+
+         if( arg_2.empty( ) )
+         {
+            if( cmd == "code" )
+               memset( p_c, 0, g_code_pages * c_code_page_bytes );
+            else
+               memset( p_c, 0, g_data_pages * c_data_page_bytes );
+         }
+
+         for( size_t i = 0; i < arg_1.size( ); i += 2 )
+         {
+            unsigned int value;
+            istringstream isstr( arg_1.substr( i, 2 ) );
+            isstr >> hex >> value;
+
+            *( p_c + ( i / 2 ) ) = ( int8_t )value;
+         }
+
+         if( cmd == "code" )
+            reset_machine( state,
+             ap_code.get( ), g_code_pages * c_code_page_bytes,
+             ap_data.get( ), g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes, g_user_stack_pages * c_user_stack_page_bytes );
+      }
+      else if( cmd == "run" || cmd == "cont" )
+      {
+         if( cmd == "run" )
+            reset_machine( state, ap_code.get( ),
+             g_code_pages * c_code_page_bytes, ap_data.get( ), g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes, g_user_stack_pages * c_user_stack_page_bytes );
+
+         while( true )
+         {
+            if( !check_has_balance( ) )
+               break;
+
+            int rc = process_op(
+             ap_code.get( ), g_code_pages * c_code_page_bytes,
+             ap_data.get( ), g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes,
+             g_user_stack_pages * c_user_stack_page_bytes, false, false, state );
+
+            if( !check_has_balance( ) )
+               break;
+
+            --g_balance;
+
+            if( rc >= 0 )
+            {
+               if( state.stopped )
+               {
+                  cout << "(stopped)\n";
+                  cout << "total steps: " << dec << state.steps << '\n';
+
+                  state.stopped = false;
+                  break;
+               }
+               else if( state.finished )
+               {
+                  cout << "(finished)\n";
+                  cout << "total steps: " << dec << state.steps << '\n';
+
+                  break;
+               }
+
+               if( break_points.count( state.pc ) )
+               {
+                  cout << "(break point)\n";
+                  break;
+               }
+            }
+            else
+            {
+               if( rc == -1 )
+                  cout << "error: overflow\n";
+               else if( rc == -2 )
+                  cout << "error: invalid code\n";
+               else
+                  cout << "unexpected error\n";
+
+               break;
+            }
+         }
+      }
+      else if( cmd == "dump" && ( next == "code" || next == "data" || next == "stacks" ) )
+      {
+         if( next == "code" )
+            dump_bytes( ap_code.get( ), g_code_pages * c_code_page_bytes );
+         else if( next == "data" )
+            dump_bytes( ap_data.get( ), g_data_pages * c_data_page_bytes );
+         else
+            dump_bytes( ap_data.get( ) + g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes );
+      }
+      else if( cmd == "list" )
+         list_code( state,
+          ap_code.get( ), g_code_pages * c_code_page_bytes,
+          ap_data.get( ), g_data_pages * c_data_page_bytes,
+          g_call_stack_pages * c_call_stack_page_bytes, g_user_stack_pages * c_user_stack_page_bytes );
+      else if( cmd == "load" && !arg_1.empty( ) )
+      {
+         ifstream inpf( arg_1.c_str( ), ios::in | ios::binary );
+
+         if( !inpf )
+            cout << "error: unable to open '" << arg_1 << "' for input" << endl;
+         else
+         {
+            inpf.read( ( char* )&g_val, sizeof( g_val ) );
+            inpf.read( ( char* )&g_val1, sizeof( g_val1 ) );
+            inpf.read( ( char* )&g_balance, sizeof( g_balance ) );
+            inpf.read( ( char* )&g_first_call, sizeof( g_first_call ) );
+            inpf.read( ( char* )&g_increment_func, sizeof( g_increment_func ) );
+
+            inpf.read( ( char* )&state.pc, sizeof( state.pc ) );
+            inpf.read( ( char* )&state.cs, sizeof( state.cs ) );
+            inpf.read( ( char* )&state.us, sizeof( state.us ) );
+            inpf.read( ( char* )&state.pce, sizeof( state.pce ) );
+            inpf.read( ( char* )&state.pcs, sizeof( state.pcs ) );
+            inpf.read( ( char* )&state.steps, sizeof( state.steps ) );
+
+            inpf.read( ( char* )&state.a1, sizeof( state.a1 ) );
+            inpf.read( ( char* )&state.a2, sizeof( state.a2 ) );
+            inpf.read( ( char* )&state.a3, sizeof( state.a3 ) );
+            inpf.read( ( char* )&state.a4, sizeof( state.a4 ) );
+
+            inpf.read( ( char* )&state.b1, sizeof( state.b1 ) );
+            inpf.read( ( char* )&state.b2, sizeof( state.b2 ) );
+            inpf.read( ( char* )&state.b3, sizeof( state.b3 ) );
+            inpf.read( ( char* )&state.b4, sizeof( state.b4 ) );
+
+            inpf.read( ( char* )&g_code_pages, sizeof( g_code_pages ) );
+            ap_code.reset( new int8_t[ g_code_pages * c_code_page_bytes ] );
+
+            inpf.read( ( char* )ap_code.get( ), g_code_pages * c_code_page_bytes );
+
+            inpf.read( ( char* )&g_data_pages, sizeof( g_data_pages ) );
+            inpf.read( ( char* )&g_call_stack_pages, sizeof( g_call_stack_pages ) );
+            inpf.read( ( char* )&g_user_stack_pages, sizeof( g_user_stack_pages ) );
+
+            ap_data.reset( new int8_t[ g_data_pages * c_data_page_bytes
+            + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes ] );
+
+            inpf.read( ( char* )ap_data.get( ), g_data_pages * c_data_page_bytes
+             + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes );
+
+            g_function_data.clear( );
+
+            size_t size;
+            inpf.read( ( char* )&size, sizeof( size_t ) );
+
+            for( size_t i = 0; i < size; i++ )
+            {
+               int32_t func;
+               inpf.read( ( char* )&func, sizeof( int32_t ) );
+
+               bool loop;
+               inpf.read( ( char* )&loop, sizeof( bool ) );
+
+               size_t offset;
+               inpf.read( ( char* )&offset, sizeof( size_t ) );
+
+               g_function_data[ func ].loop = loop;
+               g_function_data[ func ].offset = offset;
+
+               size_t dsize;
+               inpf.read( ( char* )&dsize, sizeof( size_t ) );
+
+               for( size_t j = 0; j < dsize; j++ )
+               {
+                  int64_t next;
+                  inpf.read( ( char* )&next, sizeof( int64_t ) );
+
+                  g_function_data[ func ].data.push_back( next );
+               }
+            }
+
+            inpf.close( );
+
+            list_code( state,
+             ap_code.get( ), g_code_pages * c_code_page_bytes,
+             ap_data.get( ), g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes, g_user_stack_pages * c_user_stack_page_bytes, true );
+         }
+      }
+      else if( cmd == "save" && !arg_1.empty( ) )
+      {
+         ofstream outf( arg_1.c_str( ), ios::out | ios::binary );
+
+         if( !outf )
+            cout << "error: unable to open '" << arg_1 << "' for output" << endl;
+         else
+         {
+            outf.write( ( const char* )&g_val, sizeof( g_val ) );
+            outf.write( ( const char* )&g_val1, sizeof( g_val1 ) );
+            outf.write( ( const char* )&g_balance, sizeof( g_balance ) );
+            outf.write( ( const char* )&g_first_call, sizeof( g_first_call ) );
+            outf.write( ( const char* )&g_increment_func, sizeof( g_increment_func ) );
+
+            outf.write( ( const char* )&state.pc, sizeof( state.pc ) );
+            outf.write( ( const char* )&state.cs, sizeof( state.cs ) );
+            outf.write( ( const char* )&state.us, sizeof( state.us ) );
+            outf.write( ( const char* )&state.pce, sizeof( state.pce ) );
+            outf.write( ( const char* )&state.pcs, sizeof( state.pcs ) );
+            outf.write( ( const char* )&state.steps, sizeof( state.steps ) );
+
+            outf.write( ( const char* )&state.a1, sizeof( state.a1 ) );
+            outf.write( ( const char* )&state.a2, sizeof( state.a2 ) );
+            outf.write( ( const char* )&state.a3, sizeof( state.a3 ) );
+            outf.write( ( const char* )&state.a4, sizeof( state.a4 ) );
+
+            outf.write( ( const char* )&state.b1, sizeof( state.b1 ) );
+            outf.write( ( const char* )&state.b2, sizeof( state.b2 ) );
+            outf.write( ( const char* )&state.b3, sizeof( state.b3 ) );
+            outf.write( ( const char* )&state.b4, sizeof( state.b4 ) );
+
+            outf.write( ( const char* )&g_code_pages, sizeof( g_code_pages ) );
+            outf.write( ( const char* )ap_code.get( ), g_code_pages * c_code_page_bytes );
+
+            outf.write( ( const char* )&g_data_pages, sizeof( g_data_pages ) );
+            outf.write( ( const char* )&g_call_stack_pages, sizeof( g_call_stack_pages ) );
+            outf.write( ( const char* )&g_user_stack_pages, sizeof( g_user_stack_pages ) );
+
+            outf.write( ( const char* )ap_data.get( ), g_data_pages * c_data_page_bytes
+             + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes );
+
+            size_t size = g_function_data.size( );
+            outf.write( ( const char* )&size, sizeof( size_t ) );
+
+            for( map< int32_t, function_data >::iterator i = g_function_data.begin( ); i != g_function_data.end( ); ++i )
+            {
+               outf.write( ( const char* )&i->first, sizeof( int32_t ) );
+               outf.write( ( const char* )&i->second.loop, sizeof( bool ) );
+               outf.write( ( const char* )&i->second.offset, sizeof( size_t ) );
+
+               size_t dsize = i->second.data.size( );
+               outf.write( ( const char* )&dsize, sizeof( size_t ) );
+
+               for( size_t j = 0; j < dsize; j++ )
+                  outf.write( ( const char* )&i->second.data[ j ], sizeof( int64_t ) );
+            }
+
+            outf.close( );
+         }
+      }
+      else if( cmd == "size" )
+      {
+         if( arg_1.empty( ) || arg_2.empty( ) )
+         {
+            if( arg_1.empty( ) || arg_1 == "code" )
+               cout << "code (" << g_code_pages << " * "
+                << c_code_page_bytes << ") = " << ( g_code_pages * c_code_page_bytes ) << " bytes\n";
+
+            if( arg_1.empty( ) || arg_1 == "data" )
+               cout << "data (" << g_data_pages << " * "
+                << c_data_page_bytes << ") = " << ( g_data_pages * c_data_page_bytes ) << " bytes\n";
+
+            if( arg_1.empty( ) || arg_1 == "call" )
+               cout << "call (" << g_call_stack_pages << " * "
+                << c_call_stack_page_bytes << ") = " << ( g_call_stack_pages * c_call_stack_page_bytes ) << " bytes\n";
+
+            if( arg_1.empty( ) || arg_1 == "user" )
+               cout << "user (" << g_user_stack_pages << " * "
+                << c_user_stack_page_bytes << ") = " << ( g_user_stack_pages * c_user_stack_page_bytes ) << " bytes\n";
+         }
+         else
+         {
+            int pages = atoi( arg_2.c_str( ) );
+            if( pages <= 0 )
+               throw runtime_error( "invalid # pages value: " + arg_2 );
+
+            if( arg_1 == "code" )
+            {
+               g_code_pages = pages;
+
+               ap_code.reset( new int8_t[ g_code_pages * c_code_page_bytes ] );
+
+               memset( ap_code.get( ), 0, g_code_pages * c_code_page_bytes );
+            }
+            else
+            {
+               if( arg_1 == "data" )
+                  g_data_pages = pages;
+               else if( arg_1 == "call" )
+                  g_call_stack_pages = pages;
+               else if( arg_1 == "user" )
+                  g_user_stack_pages = pages;
+               else
+                  throw runtime_error( "unexpected arg_1 '" + arg_1 + "' for 'size' command" );
+
+               ap_data.reset( new int8_t[ g_data_pages * c_data_page_bytes
+               + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes ] );
+
+               memset( ap_data.get( ), 0, g_data_pages * c_data_page_bytes
+                + g_call_stack_pages * c_call_stack_page_bytes + g_user_stack_pages * c_user_stack_page_bytes );
+            }
+         }
+      }
+      else if( cmd == "step" )
+      {
+         int32_t steps = 0;
+         int32_t num_steps = 0;
+
+         if( !arg_1.empty( ) )
+            num_steps = atoi( arg_1.c_str( ) );
+
+         if( state.finished )
+            reset_machine( state,
+             ap_code.get( ), g_code_pages * c_code_page_bytes,
+             ap_data.get( ), g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes, g_user_stack_pages * c_user_stack_page_bytes );
+
+         while( true )
+         {
+            if( !check_has_balance( ) )
+               break;
+
+            int rc = process_op(
+             ap_code.get( ), g_code_pages * c_code_page_bytes,
+             ap_data.get( ), g_data_pages * c_data_page_bytes,
+             g_call_stack_pages * c_call_stack_page_bytes,
+             g_user_stack_pages * c_user_stack_page_bytes, false, false, state );
+
+            if( !check_has_balance( ) )
+               break;
+
+            --g_balance;
+
+            if( rc >= 0 )
+            {
+               ++steps;
+               if( state.stopped || state.finished || num_steps && steps >= num_steps )
+               {
+                  if( state.stopped )
+                     cout << "(stopped)\n";
+                  else if( state.finished )
+                     cout << "(finished)\n";
+
+                  break;
+               }
+               else if( !num_steps )
+                  break;
+            }
+            else
+            {
+               if( rc == -1 )
+                  cout << "error: overflow\n";
+               else if( rc == -2 )
+                  cout << "error: invalid code\n";
+               else
+                  cout << "unexpected error\n";
+
+               break;
+            }
+         }
+      }
+      else if( cmd == "break" )
+      {
+         if( arg_1.empty( ) )
+         {
+            for( set< int32_t >::iterator i = break_points.begin( ); i != break_points.end( ); ++i )
+               cout << *i << '\n';
+         }
+         else
+         {
+            int32_t bp;
+            if( arg_1.size( ) > 2 && arg_1.find( "0x" ) == 0 )
+            {
+               istringstream isstr( arg_1.substr( 2 ) );
+               isstr >> hex >> bp;
+            }
+            else
+               bp = atoi( arg_1.c_str( ) );
+
+            if( break_points.count( bp ) )
+               break_points.erase( bp );
+            else
+               break_points.insert( bp );
+         }
+      }
+      else if( cmd == "reset" )
+         reset_machine( state,
+          ap_code.get( ), g_code_pages * c_code_page_bytes,
+          ap_data.get( ), g_data_pages * c_data_page_bytes,
+          g_call_stack_pages * c_call_stack_page_bytes, g_user_stack_pages * c_user_stack_page_bytes );
+      else if( cmd == "state" )
+         dump_state( state );
+      else if( cmd == "balance" )
+      {
+         if( arg_1.empty( ) )
+            cout << dec << g_balance << '\n';
+         else
+            g_balance = atoi( arg_1.c_str( ) );
+      }
+      else if( cmd == "function" && !arg_1.empty( ) )
+      {
+         bool is_increment_func = false;
+         if( arg_1[ 0 ] == '+' )
+         {
+            is_increment_func = true;
+            arg_1.erase( 0, 1 );
+         }
+
+         int32_t func = atoi( arg_1.c_str( ) );
+
+         if( is_increment_func )
+            g_increment_func = func;
+
+         if( ( !is_increment_func || !arg_2.empty( ) ) && g_function_data.count( func ) )
+            g_function_data.erase( func );
+
+         if( !arg_2.empty( ) )
+         {
+            while( true )
+            {
+               string::size_type pos = arg_2.find( ',' );
+
+               string next( arg_2.substr( 0, pos ) );
+
+               int64_t val;
+               if( next.size( ) > 2 && next.find( "0x" ) == 0 )
+               {
+                  istringstream isstr( next );
+                  isstr >> hex >> val;
+               }
+               else
+                  val = atoi( next.c_str( ) );
+
+               g_function_data[ func ].data.push_back( val );
+
+               if( pos == string::npos )
+                  break;
+
+               arg_2.erase( 0, pos + 1 );
+            }
+
+            if( arg_3 == "true" )
+               g_function_data[ func ].loop = true;
+         }
+      }
+      else if( cmd == "functions" )
+      {
+         for( map< int32_t, function_data >::iterator i = g_function_data.begin( ); i != g_function_data.end( ); ++i )
+         {
+            if( i->first == g_increment_func )
+               cout << '+';
+            else
+               cout << ' ';
+
+            cout << dec << setw( 3 ) << setfill( '0' ) << i->first;
+
+            for( size_t j = 0; j < i->second.data.size( ); j++ )
+               cout << ( j == 0 ? ' ' : ',' ) << "0x" << hex << setw( 16 ) << i->second.data[ j ];
+
+            if( i->second.loop )
+               cout << " true\n";
+            else
+               cout << " false\n";
+         }
+      }
+      else if( cmd == "quit" || cmd == "exit" )
+         break;
+      else
+         cout << "invalid command: " << cmd << endl;
+   }
+}
+
+
+
+
+ + + + + + diff --git a/docs/at.html b/docs/at.html new file mode 100644 index 0000000..702adda --- /dev/null +++ b/docs/at.html @@ -0,0 +1,302 @@ + + + + +CIYAM AT - Automated Transactions Specification + + + + + + + +
+ + +
+
+
+Automated Transactions Specification
+------------------------------------
+
+In brief an Automated Transaction is a "Turing complete" set of byte code instructions which will be executed
+by a byte code interpreter built into its host. An AT supporting host platform automatically supports various
+applications ranging from games of chance to automated crowdfunding and ensuring that "long term savings" are
+not lost forever.
+
+User Requirements
+-----------------
+
+The host will require changes to support the execution of Automated Transactions. These changes required need
+to include a way for a user to publish an AT as well as a way of being able to execute up to a max. number of
+steps for a given AT. After step execution is complete all relevant state for the AT is required to be stored
+in a newly created block (a *hash* of the state could be used provided that AT execution is mandatory).
+
+An AT needs to have an "account" (perhaps determined via a hash of its code) so that normal host users have a
+simple way to "send it funds". It also needs to be able to send funds to others (where the transactions could
+need to be recorded explictly for nodes that do not support running AT to be permitted).
+
+An AT engine needs to be built into the host that supports basic validation of AT the instructions and allows
+the execution of the AT to be controlled one step at a time.
+
+Use Case #1: Lottery
+
+Create a "lottery" program which will pay out its balance to a "winner" automatically once per week.
+
+To purchase a "ticket" a host user would send X to the "lottery AT account" (where some of this amount may be
+needed to pay for running the AT). The "ticket" itself would be need to be determinstic yet "random" (such as
+a future block hash) and may have to be determined "well after the block that its purchase occurs in".
+
+Use Case #2: Dormant Funds Transfer
+
+Create a program that if not notified before a certain period of time will transfer its funds to one specific
+account. The notification mechanism will be via an AM transaction and the content of the AM (if not empty) is
+a new address to payout to (note that AMs may not be supported in all hosts).
+
+Use Case #3: Project Crowdfunding Agent
+
+Create a program that will at a certain time check if it has a balance greater than or equal to a target that
+was hard-coded into it. If the required balance level has been reached then all funds will be then sent to an
+account hard-coded into it. If the required balance has not been met then each tx sender will be refunded the
+amount they sent (tx fees may also need to be considered).
+
+Functional Requirements
+-----------------------
+
+Code in an AT will be run by an AT byte code interpreter which will use a fixed amount of memory per program.
+ATs that require more than a "minimal" amount of memory will have a value deduced from their balance *before*
+they are executed (if the balance is too small to result in any execution then execution would not occur with
+no memory allocation actually being performed). It needs to be clearly understood that an AT can be halted at
+any step so there can be no "working memory" or the like in the AT interpreter itself.
+
+Both AT code and data need to be persistent (although data doesn't need to be stored until the AT has had one
+or more steps executed). Blockchain pruning could not include ATs that have a non-zero account balance. There
+should probably also be the ability to set a block number for execution so any unnecessary code execution can
+be avoided (perhaps this could be stored as part of the account information for the AT). It should also be an
+option to include initial values for (a portion of) the data area after the code.
+
+An AT will need to be created via its own special type of transaction which will need to include a fee amount
+large enough to cover the "costs" that the size of its code and data will dictate. Execution of AT code would
+be expected to be dependent upon the account balance of the AT and this balance would be reduced by each step
+executed (with some or all function call steps perhaps incurring more costs than non-function call steps).
+
+It can be expected that over time an increasing number of ATs will be created so the cost for running AT code
+must be kept to an absolute minimum. This will require AT code to be deterministic, and that its instructions
+must not be able to take arbitrary amounts of time. This will limit the set of API functions accessible to an
+AT to only those that do not require arbitrary scans over the blockchain (i.e. they should be only applicable
+to indexed information).
+
+An AT will be able to execute transactions (via the AT API) which can include different types of transactions
+such as those for using AM (where this is applicable according to the host platform).
+
+In order to satisfy the Lottery use case the following API functions need to be available to the AT engine:
+
+Get_Last_Time_Stamp (will return the "time stamp" of the previous block)
+Get_Tx_After (given a "time stamp" return the first tx id sent to the AT after it)
+Get_Tx_Type (for a given tx id return the type and subtype of the tx)
+Get_Tx_Amount (for a given tx id return the amount of host funds)
+Get_Tx_Time_Stamp (for a given tx id return its "time stamp")
+Get_Tx_Ticket_Num (for a given tx id return a "ticket value" *)
+Get_Tx_Source_Account (given a tx id this returns the account id of the funds sender)
+Get_Old_Balance (get the account balance of the AT after it had been last executed)
+Send_Old_To_Account (for a given account will send the AT's old balance)
+Send_Funds_to_Account (for a given account will send the given amount if the balance is enough to do so)
+
+* note that this function won't return until enough confirmations have allowed it to become available (so
+the AT will effectively sleep until it is ready to continue execution)
+
+Time stamp values need to also include the transaction # (zero when requesting a block time stamp) so that it
+is as simple as possible to do looping with API commands such as Get_Tx_After (and instead are really a block
+number and transaction number concatenated).
+
+Further API functions that will be required for the Dormant Funds Transfer are as follows:
+
+Get_Creator (will return the account/address of the AT's creator)
+Get_Balance (get the current account balance of the AT)
+Get_AM_Val (for a given tx id return the requested 64 bit "chunk" of AM data)
+Send_All_To_Account (for a given account will send the AT's remaining balance)
+
+Some other suggested API functions not covered by the above use cases are as follows:
+
+Send_AM (will cause the script to send an AM tx to a given account/address)
+
+Note that the "Automated Transactions API Specification" document will provide a formal description for every
+function that an AT can be guaranteed to use.
+
+Technical Specifications
+------------------------
+
+An AT creation tx would include header information along with the byte code and would optioinally include the
+amount of host funds to transfer to become the AT's initial account balance (allowing execution to start from
+the same block as the creation tx occurs).
+
+[Header]
+0x0001 ; AT version (16 bits)
+0x0000 ; (reserved) (16 bits)
+0x0001 ; code pages (16 bits) (number of 256 byte pages required)
+0x0001 ; data pages (16 bits) (number of 256 byte pages required)
+0x0000 ; call stack (16 bits) (number of 256 byte pages required)
+0x0000 ; user stack (16 bits) (number of 256 byte pages required)
+
+[Code - to be length prefixed]
+0100000000b8220000000000003301000000000028
+
+[Initial Data - also to be length prefixed]
+010000000000000002000000000000000300000000000000
+
+Although theoretically an AT could be 32MB in size an AT will have to be restricted to a much smaller maximum
+amount and all data bytes will need to be zeroed prior to initial execution. Note the version number would be
+incremented with each release that either extends the AT interpreter or adds newer AT APIs.
+
+State storage would need to include all data but also all other state that is necessary to "continue" running
+an AT after any step it had previously stopped at.
+
+[State]
+0x00000000 ; flags (32 bits)
+0x00000000 ; pc (32 bits) program counter
+0x00000000 ; cs (32 bits) call stack counter
+0x00000000 ; us (32 bits) user stack counter
+0x00000000 ; pce (32 bits) program counter error handler point
+0x00000000 ; pcs (32 bits) program counter next starting point
+0x00000000 ; sleep_until (32 bits) execution to wait until >= this block
+0x0000000000000000 ; stopped at balance (64 bits)*
+0x0000000000000000000000000000000000000000000000000000000000000000 ; pseudo register A (256 bits)
+0x0000000000000000000000000000000000000000000000000000000000000000 ; pseudo register B (256 bits)
+
+* if AT stops set to current balance and execution will not continue until balance is greater (then clear it)
+
+In order to conserve space it would be recommended to use two flags to indicate a zero value for the A and B
+register (saving either 32 or 64 bytes).
+
+[Data]
+0100000000000000020000000000000003000000000000001111111111111111
+
+The "flags" would include indicate whether the program has paused (so excution will be continued after the op
+that had been last executed), stopped (so execution would continue from the beginning with all the data being
+kept intact) or terminated (some ideas about how to handle "termination" will need to be examined and perhaps
+the "reserved" part of the code header might need to be used to set some flags for this purpose).
+
+Data addresses are a signed 32 bit value (negative values being invalid) that are used for accessing strictly
+aligned 64 bit data value. If you consider a typical raw byte dump as follows:
+
+00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+          -----------------------
+          0x00000000 (address)    ------------------------
+                                  0x00000001 (address)
+
+then each line of 16 bytes would be data for two address (i.e. 0x00000000 and 0x00000001). Addresses for code
+are also 32 bit. An op code is a single byte and AT API function numbers are 16 bits. For "branch" commands a
+single signed byte offset is used (so can jump to another op code up to +-127 bytes from the current pc). The
+"value" type for being able to set a constant value is a signed 64 bit integer.
+
+The following table summarises the types:
+
+opcode   (int8_t)   0x00
+offset   (int8_t)   0x00
+func #   (int16_t)  0x0000
+address  (int32_t)  0x00000000
+value    (int64_t)  0x0000000000000000
+
+For AT creation and state updates all values broadcast or hashed must be "little endian". The actual physical
+storage is of course up to each platform.
+
+The following are suggested op codes (the hex values are what has been used in the "at.cpp" prototype).
+
+Op Code           Hex    Additional             Operation (and comments)
+-------           ----   -----------            -------------------------------------------------------------
+NOP               0x7f                          (can be used for padding if required)
+SET_VAL           0x01   addr,value             @addr = value
+SET_DAT           0x02   addr1,addr2            @addr1 = $addr2
+CLR_DAT           0x03   addr                   @addr = 0 (to save space rather than using SET_VAL with 0)
+INC_DAT           0x04   addr                   @addr += 1
+DEC_DAT           0x05   addr                   @addr -= 1
+ADD_DAT           0x06   addr1,addr2            @addr1 += $addr2
+SUB_DAT           0x07   addr1,addr2            @addr1 -= $addr2
+MUL_DAT           0x08   addr1,addr2            @addr1 *= $addr2
+DIV_DAT           0x09   addr1,addr2            @addr1 /= $addr2
+BOR_DAT           0x0a   addr1,addr2            @addr1 |= $addr2
+AND_DAT           0x0b   addr1,addr2            @addr1 &= $addr2
+XOR_DAT           0x0c   addr1,addr2            @addr1 ^= $addr2
+NOT_DAT           0x0d   addr                   @addr = ~$addr (bitwise not)
+SET_IND           0x0e   addr1,addr2            @addr1 = $($addr2) (fetch indirect)
+SET_IDX           0x0f   addr1,addr2,addr3      @addr1 = $($addr2 + $addr3) (fetch indirect indexed)
+PSH_DAT           0x10   addr                   @--ustack_top = $addr
+POP_DAT           0x11   addr                   $addr = @ustack_top++
+JMP_SUB           0x12   addr                   @--cstack_top = pc + 5, pc = addr
+RET_SUB           0x13                          pc = @cstack_top++
+IND_DAT           0x14   addr1,addr2            @($addr1) = $addr2 (store indirect)
+IDX_DAT           0x15   addr1,addr2,addr3      @($addr1 + $addr2) = $addr3 (store indirect indexed)
+MOD_DAT           0x16   addr1,addr2            @addr1 %= $addr2
+SHL_DAT           0x17   addr1,addr2            @addr1 <<= $addr2
+SHR_DAT           0x18   addr1,addr2            @addr1 >>= $addr2
+JMP_ADR           0x1a   addr                   pc = addr
+BZR_DAT           0x1b   addr,offset            if $addr == 0 then pc += offset
+BNZ_DAT           0x1e   addr,offset            if $addr != 0 then pc += offset
+BGT_DAT           0x1f   addr1,addr2,offset     if $addr1 > $addr2 then pc += offset
+BLT_DAT           0x20   addr1,addr2,offset     if $addr1 < $addr2 then pc += offset
+BGE_DAT           0x21   addr1,addr2,offset     if $addr1 >= $addr2 then pc += offset
+BLE_DAT           0x22   addr1,addr2,offset     if $addr1 <= $addr2 then pc += offset
+BEQ_DAT           0x23   addr1,addr2,offset     if $addr1 == $addr2 then pc += offset
+BNE_DAT           0x24   addr1,addr2,offset     if $addr1 != $addr2 then pc += offset
+SLP_DAT           0x25   addr                   sleep until $addr timestamp*
+FIZ_DAT           0x26   addr                   if $addr == 0 then pc = pcs and stop
+STZ_DAT           0x27   addr                   if $addr == 0 then stop
+FIN_IMD           0x28                          pc = pcs and stop
+STP_IMD           0x29                          stop
+SLP_IMD           0x2a                          sleep until the next block
+ERR_ADR           0x2b   addr                   pce = addr
+SET_PCS           0x30                          pcs = pc + 1
+EXT_FUN           0x32   func                   func( )
+EXT_FUN_DAT       0x33   func,addr              func( $addr )
+EXT_FUN_DAT_2     0x34   func,addr1,addr2       func( $addr1, $addr2 )
+EXT_FUN_RET       0x35   func,addr              @addr = func( )
+EXT_FUN_RET_DAT   0x36   func,addr1,addr2       @addr1 = func( $addr2 )
+EXT_FUN_RET_DAT_2 0x37   func,addr1,addr2,addr3 @addr1 = func( $addr2, $addr3 )
+
+* where timestamp is actually a 32 bit block height stored in the high order 32 bits of the address value and
+if the block height is not greater than the current block height then it will instead just operate as SLP_IMD
+
+All instructions that modify the pc will need to ensure the value it is being set to is a valid code address.
+
+Note that there is only a "code" and "data" segment. The "stacks" (if used) are actually included at the last
+part of the data segment. If using any stack operations (i.e. PSH_DAT/POP_DAT/JMP_SUB/RET_SUB) then sufficent
+data storage for both variables and the stacks would need to be allocated.
+
+The call stack preceeds the user stack (with both growing backwards). The following picture illustrates this:
+
+ --------------
+| data         |
+|              |
+|              |
+|              |
+|              |
+ --------------
+|              |
+|              |
+| call stack   |
+ --------------
+|              |
+|              |
+| user stack   |
+ --------------
+
+For the purpose of being able to create an AT and to store its state after executing steps there will need to
+specially created host transactions.
+
+
+
+
+ + + + + + diff --git a/docs/at_api.html b/docs/at_api.html new file mode 100644 index 0000000..de94b70 --- /dev/null +++ b/docs/at_api.html @@ -0,0 +1,168 @@ + + + + +CIYAM AT - Automated Transactions API Specification + + + + + + + +
+ + +
+
+
+Automated Transactions API Specification
+----------------------------------------
+
+This specification details the AT API which is what allows an AT to communicate with its host's blockchain to
+find out details about blocks and transactions relevant to the AT and to issue its own transactions. In order
+to write "portable" ATs (i.e. those that can run analtered across different kinds of blockchain platforms) it
+is required that only the functions in the range 0x0100 to 0x04ff be used. Experimental functions can be used
+when prototyping (and have no formal definition here) and platform specific functions can be defined in order
+for ATs to be able to work more efficiently on a specific platform (and also have no formal definition here).
+
+As the AT machine uses a 64 bit design some very useful API commands such as cryptographic hash functions are
+not able to be perfomed directly with machine addresses. To work around this problem without resorting to the
+API having to perform memory range testing to use the AT's data, a set of "pseudo registers" must be provided
+by the AT API (every AT instance needs its own set) that are initially set to zero.
+
+There are four 64 bit registers called A1..4 and another four called B1..4 for this purpose (also referred to
+as two 256 bit registers called A and B). It is important to note that the A and B pseudo registers will need
+to be stored along with the other "state" variables such as the program counter and stack counters.
+
+Note that "timestamp" does not mean a real timestamp but instead is an artificial timestamp that includes two
+parts. The first part is a block height (32 bits) with the second part being the number of the transaction if
+applicable (also 32 bits and zero if not applicable).
+
+Note also that functions can be identified as being "blocking" functions. They will cause the AT to sleep for
+X blocks when it is known that the function will then be ready to return (with the function being executed by
+the AT twice with the first call needing to rewind the AT's program counter before putting it to sleep).
+
+In order to keep the functions organised in groups function number ranges are as follows:
+
+Number Range      Range Usage
+--------------    ----------------------------------------------
+0x0000..0x000f    Reserved for internal AT testing purposes
+0x0010..0x00ff    Experimental API function calls (for prototyping)
+0x0100..0x01ff    Get/Set functions for "pseudo registers"
+0x0200..0x02ff    Functions that perform hash operations
+0x0300..0x03ff    Generic functions that get block and tx info
+0x0400..0x04ff    Generic functions that check balances and perform ops
+0x0500..0x05ff    Platform specific functions that get block and tx info
+0x0600..0x06ff    Platform specific functions that check balances and perform ops
+
+As cryptographic hash operations are *expensive* operations it is suggested that the "fee" for each of those
+function calls be higher than that of others (fees themselves are a platform specific implementation issue).
+
+Function Name             Number AT op code        Operation (and comments)
+------------------------- ------ ----------------- ----------------------------------------------------------
+Get_A1                    0x0100 EXT_FUN_RET       sets @addr to A1
+Get_A2                    0x0101 EXT_FUN_RET       sets @addr to A2
+Get_A3                    0x0102 EXT_FUN_RET       sets @addr to A3
+Get_A4                    0x0103 EXT_FUN_RET       sets @addr to A4
+Get_B1                    0x0104 EXT_FUN_RET       sets @addr to B1
+Get_B2                    0x0105 EXT_FUN_RET       sets @addr to B2
+Get_B3                    0x0106 EXT_FUN_RET       sets @addr to B3
+Get_B4                    0x0107 EXT_FUN_RET       sets @addr to B4
+
+Set_A1                    0x0110 EXT_FUN_DAT       sets A1 from $addr
+Set_A2                    0x0111 EXT_FUN_DAT       sets A2 from $addr
+Set_A3                    0x0112 EXT_FUN_DAT       sets A3 from $addr
+Set_A4                    0x0113 EXT_FUN_DAT       sets A4 from $addr
+Set_A1_A2                 0x0114 EXT_FUN_DAT_2     sets A1 from $addr1 and A2 from $addr2
+Set_A3_A4                 0x0115 EXT_FUN_DAT_2     sets A3 from $addr1 and A4 from $addr2
+Set_B1                    0x0116 EXT_FUN_DAT       sets B1 from $addr
+Set_B2                    0x0117 EXT_FUN_DAT       sets B2 from $addr
+Set_B3                    0x0118 EXT_FUN_DAT       sets B3 from $addr
+Set_B4                    0x0119 EXT_FUN_DAT       sets B4 from $addr
+Set_B1_B2                 0x011a EXT_FUN_DAT_2     sets B1 from $addr1 and B2 from $addr2
+Set_B3_B4                 0x011b EXT_FUN_DAT_2     sets B3 from $addr1 and B4 from $addr2
+
+Clear_A                   0x0120 EXT_FUN           sets A to zero (A being A1..4)
+Clear_B                   0x0121 EXT_FUN           sets B to zero (B being B1..4)
+Clear_A_And_B             0x0122 EXT_FUN           sets both A and B to zero
+Copy_A_From_B             0x0123 EXT_FUN           copies B into A
+Copy_B_From_A             0x0124 EXT_FUN           copies A into B
+Check_A_Is_Zero           0x0125 EXT_FUN_RET       @addr to 1 if A is zero or 0 if it is not (i.e. bool)
+Check_B_Is_Zero           0x0126 EXT_FUN_RET       @addr to 1 if B is zero of 0 if it is not (i.e. bool)
+Check_A_Equals_B          0x0127 EXT_FUN_RET       @addr to bool if A is equal to B
+Swap_A_and_B              0x0128 EXT_FUN           swap the values of A and B
+OR_A_with_B               0x0129 EXT_FUN           sets A to A | B (bitwise OR)
+OR_B_with_A               0x012a EXT_FUN           sets B to B | A (bitwise OR)
+AND_A_with_B              0x012b EXT_FUN           sets A to A & B (bitwise AND)
+AND_B_with_A              0x012c EXT_FUN           sets B to B & A (bitwise AND)
+XOR_A_with_B              0x012d EXT_FUN           sets A to A ^ B (bitwise XOR)
+XOR_B_with_A              0x012e EXT_FUN           sets B to B ^ A (bitwise XOR)
+--- NOTE: These 8 math ops are intended for a future implementation so no need to support them currently.
+Add_A_To_B                0x0140 EXT_FUN           adds A to B (result in B)
+Add_B_To_A                0x0141 EXT_FUN           adds B to A (result in A)
+Sub_A_From_B              0x0142 EXT_FUN           subs A from B (result in B)
+Sub_B_From_A              0x0143 EXT_FUN           subs B from A (result in A)
+Mul_A_By_B                0x0144 EXT_FUN           multiplies A by B (result in B)
+Mul_B_By_A                0x0145 EXT_FUN           multiplies B by A (result in A)
+Div_A_By_B                0x0146 EXT_FUN           divides A by B (result in B)*
+Div_B_By_A                0x0147 EXT_FUN           divides B by A (result in A)*
+
+ * note that these functions could cause a divide by zero error which would put the machine in error
+
+MD5_A_To_B                0x0200 EXT_FUN           take an MD5 hash of A1..2 and put this is B1..2
+Check_MD5_A_With_B        0x0201 EXT_FUN_RET       @addr to bool if MD5 hash of A1..2 matches B1..2
+HASH160_A_To_B            0x0202 EXT_FUN           take a RIPEMD160 hash of A1..3 and put this in B1..3
+Check_HASH160_A_With_B    0x0203 EXT_FUN_RET       @addr to bool if RIPEMD160 hash of A1..3 matches B1..3
+SHA256_A_To_B             0x0204 EXT_FUN           take a SHA256 hash of A and put this in B
+Check_SHA256_A_With_B     0x0205 EXT_FUN_RET       @addr to bool if SHA256 hash of A matches B
+
+Get_Block_Timestamp       0x0300 EXT_FUN_RET       sets @addr to the timestamp of the current block
+Get_Creation_Timestamp    0x0301 EXT_FUN_RET       sets @addr to the timestamp of the AT creation block
+Get_Last_Block_Timestamp  0x0302 EXT_FUN_RET       sets @addr to the timestamp of the previous block
+Put_Last_Block_Hash_In_A  0x0303 EXT_FUN           puts the block hash of the previous block in A
+A_To_Tx_After_Timestamp   0x0304 EXT_FUN_DAT       sets A to tx hash of the first tx after $addr timestamp
+Get_Type_For_Tx_In_A      0x0305 EXT_FUN_RET       if A is a valid tx then @addr to tx type*
+Get_Amount_For_Tx_In_A    0x0306 EXT_FUN_RET       if A is a valid tx then @addr to tx amount**
+Get_Timestamp_For_Tx_In_A 0x0307 EXT_FUN_RET       if A is a valid tx then @addr to the tx timestamp
+Get_Random_Id_For_Tx_In_A 0x0308 EXT_FUN_RET       if A is a valid tx then @addr to the tx random id***
+Message_From_Tx_In_A_To_B 0x0309 EXT_FUN           if A is a valid tx then B to the tx message****
+B_To_Address_Of_Tx_In_A   0x030a EXT_FUN           if A is a valid tx then B set to the tx address
+B_To_Address_Of_Creator   0x030b EXT_FUN           sets B to the address of the AT's creator
+
+ * tx type is 0 for a normal tx and 1 for a message tx
+ ** amount will always have the minimum fee subtracted from it
+ *** a random id is a 64 bit signed value (that is always returned positive) and this is a blocking function
+ **** if the tx does not include a message tx then this will zero out the B value
+
+ NOTE: For all cases where A is not a valid tx @addr will be set to 0xffffffffffffffff
+
+Get_Current_Balance       0x0400 EXT_FUN_RET       sets @addr to current balance of the AT
+Get_Previous_Balance      0x0401 EXT_FUN_RET       sets @addr to the balance it had last had when running*
+Send_To_Address_In_B      0x0402 EXT_FUN_DAT       if B is a valid address then send it $addr amount**
+Send_All_To_Address_In_B  0x0403 EXT_FUN           if B is a valid address then send it the entire balance
+Send_Old_To_Address_In_B  0x0404 EXT_FUN           if B is a valid address then send it the old balance**
+Send_A_To_Address_In_B    0x0405 EXT_FUN           if B is a valid address then send it A as a message
+Add_Minutes_To_Timestamp  0x0406 EXT_FUN_RET_DAT_2 set @addr1 to timestamp $addr2 plus $addr3 minutes***
+
+ * this amount does not include any additional amounts sent to the AT between "execution events"
+ ** if this amount is greater than the AT's balance then it will only send the current balance amount
+ *** the API is expected to base this timestamp according to the "average block time" for the blockchain
+
+
+
+
+ + + + + + diff --git a/docs/at_atomic.html b/docs/at_atomic.html new file mode 100644 index 0000000..fa0858e --- /dev/null +++ b/docs/at_atomic.html @@ -0,0 +1,200 @@ + + + + +CIYAM AT - Use Case: Atomic Cross-Chain Transfer + + + + + + + +
+ + +
+
+
+Use Case: Atomic Cross-Chain Transfer
+-------------------------------------
+
+An AT that enables an atomic cross-chain transfer to be executed by creating two separate instances of itself
+on two seperate blockchains. When constructing the first instance a 32 byte secret needs to be "hashed" using
+SHA256 and stored in the first 32 bytes of "initial data" followed by another 32 bytes for the address of the
+other party, and then the number of minutes to wait until refunding the AT's balance back to its creator.
+
+The initial creator would then wait for the other party to create a matching AT (with a significantly smaller
+number of minutes for refund). The hash values would need to be identical. Once the initiator has seen enough
+confirmations of the other AT then they will send the secret to the other AT as a message. This AT will first
+copy this message into its data storage and then check if when hashed it matches the initial data values that
+were provided when it was created. If they match then the funds are sent to the address stored in the initial
+data.
+
+Finally the creator of the second AT can now work out from checking their AT's state what the secret is. They
+would then send a message to the originally created AT instance with the same secret and it would pay them so
+the atomic cross-chain transfer will be completed.
+
+Note that if the second party never actually creates their AT then the first party just needs to wait for the
+refund to occur. Likewise once the second party has created their AT then if the first party fails to send it
+the secret on time then a refund will occur (and the first party will also be refunded). The first party will
+need to be careful not to send the secret too close to the deadline otherwise there is the possibility that a
+refund will occur in the second AT but the secret will have already been seen in the message tx.
+
+Another concern is possible attacks by "clogging the AT" up with tiny false message txs to try and prevent it
+from paying out. This is perhaps best prevented by making sure that the minimum fee for the ATs is well above
+anything that would permit such an attack to be economically beneficial.
+
+The algorithm described at https://en.bitcoin.it/wiki/Atomic_cross-chain_trading (which the Bitcointalk forum
+member TierNolan first designed) is what this AT performs (although it doesn't need multisig addresses as the
+ATs take over the role of being escrows).
+
+Variables
+---------
+
+@00 ==> @hash_part1
+@01 ==> @hash_part2
+@02 ==> @hash_part3
+@03 ==> @hash_part4
+@04 ==> @address_part1
+@05 ==> @address_part2
+@06 ==> @address_part3
+@07 ==> @address_part4
+@08 ==> @refund_minutes
+@09 ==> @refund_timestamp
+@0a ==> @last_timestamp
+@0b ==> @secret_part1
+@0c ==> @secret_part2
+@0d ==> @secret_part3
+@0e ==> @secret_part4
+@0f ==> @tx_type
+@10 ==> @comparator
+@11 ==> @secret_temp1
+@12 ==> @secret_temp2
+@13 ==> @secret_temp3
+@14 ==> @secret_temp4
+
+Script Assembly
+---------------
+
+if @refund_timestamp not zero goto loop                  1e0a00000025
+set @refund_timestamp to AT creation time                35010309000000
+set @last_timestamp to @refund_timestamp                 020a00000009000000
+add @refund_minutes to @refund_timestamp                 370604090000000900000008000000
+
+:loop (0x25)
+if @last_timestamp < @refund_timestamp goto :txloop      210a000000090000000f
+goto refund                                              1af7000000
+
+:txloop (0x34)
+store tx after @last_timestamp in A                      3304030a000000
+check if A is zero and store result to @comparator       35250110000000
+if @comparator is zero finish                            2610000000
+get type for tx in A and store in @tx_type               3505030f000000
+get timestamp for tx in A and store in @last_timestamp   3507030a000000
+if @tx_type is not 0 goto :check_message                 1e0f0000000b      
+goto txloop                                              1a34000000      
+
+:check_message  (0x60)
+store message of tx in A to B                            320903
+swap A and B                                             322801
+sha256 of A and store in B                               320402
+set @secret_temp1 to A1                                  35000111000000
+set @secret_temp2 to A2                                  35010112000000
+set @secret_temp3 to A3                                  35020113000000
+set @secret_temp4 to A4                                  35030114000000
+set A1 to @hash_part1                                    33100100000000
+set A2 to @hash_part2                                    33110101000000
+set A3 to @hash_part3                                    33120102000000
+set A4 to @hash_part4                                    33130103000000
+check A equals to B and store in @comparator             35270110000000
+if comparator is not 0 goto :payout                      1e100000000b
+goto :txloop                                             1a34000000
+
+:payout (0xb3)
+set @secret_part1 to $secret_temp1                       020b00000011000000
+set @secret_part2 to $secret_temp2                       020c00000012000000
+set @secret_part3 to $secret_temp3                       020d00000013000000
+set @secret_part4 to $secret_temp4                       020e00000014000000
+set B1 to @address_part1                                 33160104000000
+set B2 to @address_part2                                 33170105000000
+set B3 to @address_part3                                 33180106000000
+set B4 to @address_part4                                 33190107000000
+send all to address in B                                 320304
+finish                                                   28
+
+:refund (0xf7)
+set B to address of the AT creator                       320b03
+send remaining balance to addres in B                    320304
+finish                                                   28
+
+Assembly Code
+-------------
+
+00000000* BNZ $0000000a :00000025
+00000006  FUN @00000009 0x0301
+0000000d  SET @0000000a $00000009
+00000016  FUN @00000009 0x0406 $00000009 $00000008
+00000025  BGE $0000000a $00000009 :00000034
+0000002f  JMP :000000f7
+00000034  FUN 0x0304 $0000000a
+0000003b  FUN @00000010 0x0125
+00000042  FIZ @00000010
+00000047  FUN @0000000f 0x0305
+0000004e  FUN @0000000a 0x0307
+00000055  BNZ $0000000f :00000060
+0000005b  JMP :00000034
+00000060  FUN 0x0309
+00000063  FUN 0x0128
+00000066  FUN 0x0204
+00000069  FUN @00000011 0x0100
+00000070  FUN @00000012 0x0101
+00000077  FUN @00000013 0x0102
+0000007e  FUN @00000014 0x0103
+00000085  FUN 0x0110 $00000000
+0000008c  FUN 0x0111 $00000001
+00000093  FUN 0x0112 $00000002
+0000009a  FUN 0x0113 $00000003
+000000a1  FUN @00000010 0x0127
+000000a8  BNZ $00000010 :000000b3
+000000ae  JMP :00000034
+000000b3  SET @0000000b $00000011
+000000bc  SET @0000000c $00000012
+000000c5  SET @0000000d $00000013
+000000ce  SET @0000000e $00000014
+000000d7  FUN 0x0116 $00000004
+000000de  FUN 0x0117 $00000005
+000000e5  FUN 0x0118 $00000006
+000000ec  FUN 0x0119 $00000007
+000000f3  FUN 0x0403
+000000f6  FIN
+000000f7  FUN 0x030b
+000000fa  FUN 0x0403
+000000fd  FIN
+
+Machine Code
+------------
+
+1e0a0000002535010309000000020a00000009000000370604090000000900000008000000210a000000090000000f1af700000033040
+30a0000003525011000000026100000003505030f0000003507030a0000001e0f0000000b1a3400000032090332280132040235000111
+0000003501011200000035020113000000350301140000003310010000000033110101000000331201020000003313010300000035270
+1100000001e100000000b1a34000000020b00000011000000020c00000012000000020d00000013000000020e00000014000000331601
+0400000033170105000000331801060000003319010700000032030428320b0332030428
+
+
+
+
+ + + + + + diff --git a/docs/at_auction.html b/docs/at_auction.html new file mode 100644 index 0000000..d1b3f8b --- /dev/null +++ b/docs/at_auction.html @@ -0,0 +1,264 @@ + + + + +CIYAM AT - Use Case: Auction Agent + + + + + + + +
+ + +
+
+
+Use Case: Auction Agent
+-----------------------
+
+An Auction Agent is an AT that will allow people to send funds which will be refunded back to them (minus a
+minimum fee) if someone else sends more. A "buy now" price would become an instant "auction finish" and the
+actual auction finish will need to use some "random" data so that the exact end of the auction isn't easily
+manipulated. If bid is more than "buy now" the difference is refunded.
+
+Variables
+---------
+
+@00 ==> @timestamp
+@01 ==> @decision_time
+@02 ==> @txid
+@03 ==> @balance
+@04 ==> @tx_info
+@05 ==> @buy_now
+@06 ==> @target_acc
+@07 ==> @best_bid
+@08 ==> @tx_source
+@09 ==> @best_account
+
+Functions
+----------
+
+20 (0x14) = get a time stamp value for the last block in the blockchain
+21 (0x15) = get txid for the first tx after the provided time stamp
+22 (0x16) = get a time stamp value for a given txid
+23 (0x17) = get ticket for a given txid
+24 (0x18) = get source account/address for a given txid
+26 (0x1a) = pay account balance to a given account/address
+27 (0x1b) = get funds amount for a given txid
+28 (0x1c) = get tx type and subtype for a given txid
+31 (0x1f) = pay given funds amount to a given account/address
+
+Sample Function Data:
+---------------------
+
+balance 1000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000167,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x000000000ff9f9af,0x000000000ff9f9bf,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x0000000000004400,0x0100000000000000,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 025 0 true
+function 027 0x0000000000000066,0x0000000000000068,0x000000000000095,0x0000000000000064,0x0000000000000069 false
+function 028 0x0000000000000000 true
+
+Sample Run Output:
+------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 28 with 100 rc: 0000000000000000
+func1: 27 with 100 rc: 0000000000000066
+payout 100 to account: 00000000
+func1: 24 with 100 rc: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 28 with 101 rc: 0000000000000000
+func1: 27 with 101 rc: 0000000000000068
+payout 102 to account: 1111000000000000
+func1: 24 with 101 rc: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 000000000ff9f9af
+func1: 23 with 102 rc: 0000000000004400
+func1: 28 with 102 rc: 0000000000000000
+func1: 27 with 102 rc: 0000000000000095
+payout 104 to account: 2222000000000000
+func1: 24 with 102 rc: 3333000000000000
+func1: 21 with 268040623 rc: 0000000000000167
+func1: 22 with 359 rc: 000000000ff9f9bf
+func1: 23 with 359 rc: 0100000000000000
+func1: 24 with 359 rc: 4444000000000000
+func1: 27 with 359 rc: 0000000000000064
+payout 100 to account: 4444000000000000
+payout 149 to account: 3333000000000000
+func1: 21 with 268040639 rc: 0000000000000000
+payout 379 to account: 286331153
+(stopped - zero balance)
+
+Script Assembly
+---------------
+
+if @timestamp not zero goto loop                         1e0000000041
+get last block timestamp and put in @timestamp           35140000000000
+set @decision_time                                       0101000000c55d0a0000000000
+set @buy_now (to 10000)                                  01050000006401000000000000
+set @target_acc                                          01060000001111111100000000
+set @best_bid to (100)                                   01070000006400000000000000
+
+:loop
+get tx at after @timestamp and store in @txid            3615000200000000000000
+if @txid is zero finish                                  2602000000
+
+get timestamp for @txid and store in @timestamp          3616000000000002000000
+if @timestamp < @decision_time goto no-decision          2000000000010000000f
+goto decision                                            1a6d010000
+
+:no-decision
+get type for @txid and store in @tx_info                 361c000400000002000000
+if @tx_info is zero goto continue                        1b040000000b
+goto loop                                                1a41000000
+
+:continue
+get amount for @txid and store in @tx_info               361b000400000002000000
+if @tx_info <= @best_bid goto :refund-bid                22040000000700000038
+
+send @best_bid to @best_account                          341f000700000009000000
+set @best_bid to @tx_info                                020700000004000000
+get account for @tx_id and store in @best_account        3618000900000002000000
+
+if @best_bid >= @buy_now goto buynow                     2107000000050000002a
+goto loop                                                1a41000000
+
+:refund-bid
+get account for @tx_id and store in @tx_source           3618000800000002000000
+send @tx_info to @tx_source                              341f000400000008000000
+goto loop                                                1a41000000
+
+:buynow
+send @buy_now to @target_acc                             341f000500000006000000
+if @best_bid == @buy_now goto payout                     23070000000500000027
+set @tx_info to @best_bid                                020400000007000000
+subtract @buy_now to @tx_info                            07040000000500000000
+
+:payout
+send @tx_info to @best_account                           341f000400000009000000
+
+:refund loop
+get tx after @timestamp and store in @txid               3615000200000000000000
+if @txid is non zero goto refund cont                    1e020000000f
+set pcs                                                  30
+send balance to target_acc                               331a0006000000
+finish                                                   28
+
+:refund cont
+get type for @txid and store in @tx_info                 361c000400000002000000
+if @tx_info is zero go to skip                           1b0400000027
+
+get account for @txid and put in @tx_source              3618000800000002000000
+get amount for @txid and put in @tx_info                 361b000400000002000000
+send @tx_info to @tx_source                              341f000400000008000000
+
+:skip
+get timestamp for @txid and store in @timestamp          3616000000000002000000
+goto refund loop                                         1a11010000
+
+:decision
+get rand for txid and store in @tx_info                  3617000400000002000000
+AND 1 to @tx_info                                        0b0400000001000000
+if @tx_info is zero goto finalize                        1b040000000b
+goto no-decision                                         1a6b000000
+
+:finalize
+get account for @txid and put in @tx_source              3618000800000002000000
+get amount for @txid and put in @tx_info                 361b000400000002000000
+send @tx_info to @tx_source                              341f000400000008000000
+send @best_bid to @best_account                          341f000700000009000000
+goto refund loop                                         1a01110000
+
+Assembly Code
+-------------
+
+00000000* BNZ $00000000 :00000041
+00000006  FUN @00000000 20
+0000000d  SET @00000001 #00000000000a5dc5
+0000001a  SET @00000005 #0000000000000164
+00000027  SET @00000006 #0000000011111111
+00000034  SET @00000007 #0000000000000064
+00000041  FUN @00000002 21 $00000000
+0000004c  FIZ @00000002
+00000051  FUN @00000000 22 $00000002
+0000005c  BLT $00000000 $00000001 :0000006b
+00000066  JMP :0000016d
+0000006b  FUN @00000004 28 $00000002
+00000076  BZR $00000004 :00000081
+0000007c  JMP :00000041
+00000081  FUN @00000004 27 $00000002
+0000008c  BLE $00000004 $00000007 :000000c4
+00000096  FUN 31 $00000007 $00000009
+000000a1  SET @00000007 $00000004
+000000aa  FUN @00000009 24 $00000002
+000000b5  BGE $00000007 $00000005 :000000df
+000000bf  JMP :00000041
+000000c4  FUN @00000008 24 $00000002
+000000cf  FUN 31 $00000004 $00000008
+000000da  JMP :00000041
+000000df  FUN 31 $00000005 $00000006
+000000ea  BEQ $00000007 $00000005 :00000111
+000000f4  SET @00000004 $00000007
+000000fd  SUB @00000004 $00000005
+00000106  FUN 31 $00000004 $00000009
+00000111  FUN @00000002 21 $00000000
+0000011c  BNZ $00000002 :0000012b
+00000122  PCS
+00000123  FUN 26 $00000006
+0000012a  FIN
+0000012b  FUN @00000004 28 $00000002
+00000136  BZR $00000004 :0000015d
+0000013c  FUN @00000008 24 $00000002
+00000147  FUN @00000004 27 $00000002
+00000152  FUN 31 $00000004 $00000008
+0000015d  FUN @00000000 22 $00000002
+00000168  JMP :00000111
+0000016d  FUN @00000004 23 $00000002
+00000178  AND @00000004 $0000000000000001
+00000181  BZR $00000004 :0000018c
+00000187  JMP :0000006b
+0000018c  FUN @00000008 24 $00000002
+00000197  FUN @00000004 27 $00000002
+000001a2  FUN 31 $00000004 $00000008
+000001ad  FUN 31 $00000007 $00000009
+000001b8  JMP :00000111
+
+Machine Code
+------------
+
+1e0000000041351400000000000101000000c55d0a00000000000105000000640100000000000001060000001111111100000000
+010700000064000000000000003615000200000000000000260200000036160000000000020000002000000000010000000f1a6d
+010000361c0004000000020000001b040000000b1a41000000361b00040000000200000022040000000700000038341f00070000
+000900000002070000000400000036180009000000020000002107000000050000002a1a41000000361800080000000200000034
+1f0004000000080000001a41000000341f0005000000060000002307000000050000002702040000000700000007040000000500
+0000341f00040000000900000036150002000000000000001e020000000f30331a000600000028361c0004000000020000001b04
+000000273618000800000002000000361b000400000002000000341f00040000000800000036160000000000020000001a110100
+0036170004000000020000000b04000000010000001b040000000b1a6b0000003618000800000002000000361b00040000000200
+0000341f000400000008000000341f0007000000090000001a11010000
+
+
+
+
+ + + + + + diff --git a/docs/at_auction_tests.html b/docs/at_auction_tests.html new file mode 100644 index 0000000..6c24798 --- /dev/null +++ b/docs/at_auction_tests.html @@ -0,0 +1,226 @@ + + + + +CIYAM AT - Use Case Tests: Auction Agent + + + + + + + +
+ + +
+
+
+Use Case Tests: Auction Agent
+-----------------------------
+
+A summary of the tests follows:
+
+Test 1: Basic auction sample.
+Test 2: Buy now for first bidder.
+Test 3: Buy now for second bidder.
+Test 4: Check all send less than the initial bid.
+
+Test 1: Basic usage.
+--------------------
+
+Sample Function Data (Test 1):
+------------------------------
+
+balance 1000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000167,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x000000000ff9f9af,0x000000000ff9f9bf,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x0000000000004400,0x0100000000000000,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 025 0 true
+function 027 0x0000000000000066,0x0000000000000068,0x000000000000095,0x0000000000000064,0x0000000000000069 false
+function 028 0x0000000000000000 true
+
+Sample Run Output (Test 1):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 28 with 100 rc: 0000000000000000
+func1: 27 with 100 rc: 0000000000000066
+payout 100 to account: 00000000
+func1: 24 with 100 rc: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 28 with 101 rc: 0000000000000000
+func1: 27 with 101 rc: 0000000000000068
+payout 102 to account: 1111000000000000
+func1: 24 with 101 rc: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 000000000ff9f9af
+func1: 23 with 102 rc: 0000000000004400
+func1: 28 with 102 rc: 0000000000000000
+func1: 27 with 102 rc: 0000000000000095
+payout 104 to account: 2222000000000000
+func1: 24 with 102 rc: 3333000000000000
+func1: 21 with 268040623 rc: 0000000000000167
+func1: 22 with 359 rc: 000000000ff9f9bf
+func1: 23 with 359 rc: 0100000000000000
+func1: 24 with 359 rc: 4444000000000000
+func1: 27 with 359 rc: 0000000000000064
+payout 100 to account: 4444000000000000
+payout 149 to account: 3333000000000000
+func1: 21 with 268040639 rc: 0000000000000000
+payout 379 to account: 286331153
+(stopped - zero balance)
+
+Test 2: Buy now for first bidder.
+---------------------------------
+
+Sample Function Data (Test 2):
+------------------------------
+
+balance 2000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000067,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x000000000ff9f9af,0x000000000ff9f9bf,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x0100000000000000,0x0000000000044000,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 025 0 true
+function 027 0x0000000000000176,0x0000000000000068,0x000000000000068,0x0000000000000064,0x0000000000000069 false
+function 028 0x0000000000000000 true
+
+Sample Run Output
+-----------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 28 with 100 rc: 0000000000000000
+func1: 27 with 100 rc: 0000000000000176
+payout 100 to account: 00000000
+func1: 24 with 100 rc: 1111000000000000
+payout 356 to account: 11111111
+payout 18 to account: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 28 with 101 rc: 0000000000000000
+func1: 22 with 101 rc: 0000000000023a80
+func1: 21 with 146048 rc: 0000000000000066
+func1: 28 with 102 rc: 0000000000000000
+func1: 22 with 102 rc: 000000000ff9f9af
+func1: 21 with 268040623 rc: 0000000000000067
+func1: 28 with 103 rc: 0000000000000000
+func1: 22 with 103 rc: 000000000ff9f9bf
+func1: 21 with 268040639 rc: 0000000000000000
+payout 1482 to account: 286331153
+(stopped - zero balance)
+
+Test 3: Buy now for second bidder.
+----------------------------------
+
+Sample Function Data (Test 3):
+------------------------------
+
+balance 2000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000067,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x000000000ff9f9af,0x000000000ff9f9bf,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x0100000000000000,0x0000000000044000,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 025 0 true
+function 027 0x000000000000036,0x0000000000000189,0x000000000000189,0x0000000000000064,0x0000000000000069 false
+function 028 0x0000000000000000 true
+
+Sample Run Output (Test 3):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 28 with 100 rc: 0000000000000000
+func1: 27 with 100 rc: 0000000000000036
+func1: 24 with 100 rc: 1111000000000000
+payout 54 to account: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 28 with 101 rc: 0000000000000000
+func1: 27 with 101 rc: 0000000000000189
+payout 100 to account: 00000000
+func1: 24 with 101 rc: 2222000000000000
+payout 356 to account: 11111111
+payout 37 to account: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 28 with 102 rc: 0000000000000000
+func1: 22 with 102 rc: 000000000ff9f9af
+func1: 21 with 268040623 rc: 0000000000000067
+func1: 28 with 103 rc: 0000000000000000
+func1: 22 with 103 rc: 000000000ff9f9bf
+func1: 21 with 268040639 rc: 0000000000000000
+payout 1404 to account: 286331153
+(stopped - zero balance)
+
+Test 4: Check all send less than the initial bid.
+-------------------------------------------------
+
+Sample Function Data (Test 4):
+------------------------------
+
+balance 2000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000067,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x000000000ff9f9af,0x000000000ff9f9bf,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x0100000000000000,0x0000000000044000,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 025 0 true
+function 027 0x000000000000038,0x0000000000000048,0x000000000000018,0x0000000000000024,0x0000000000000069 false
+function 028 0x0000000000000000 true
+
+Sample Run Output (Test 4):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 28 with 100 rc: 0000000000000000
+func1: 27 with 100 rc: 0000000000000038
+func1: 24 with 100 rc: 1111000000000000
+payout 56 to account: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 28 with 101 rc: 0000000000000000
+func1: 27 with 101 rc: 0000000000000048
+func1: 24 with 101 rc: 2222000000000000
+payout 72 to account: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 000000000ff9f9af
+func1: 23 with 102 rc: 0100000000000000
+func1: 24 with 102 rc: 3333000000000000
+func1: 27 with 102 rc: 0000000000000018
+payout 24 to account: 3333000000000000
+payout 100 to account: 00000000
+func1: 21 with 268040623 rc: 0000000000000067
+func1: 28 with 103 rc: 0000000000000000
+func1: 22 with 103 rc: 000000000ff9f9bf
+func1: 21 with 268040639 rc: 0000000000000000
+payout 1698 to account: 286331153
+(stopped - zero balance)
+
+
+
+
+ + + + + + diff --git a/docs/at_crowdfund.html b/docs/at_crowdfund.html new file mode 100644 index 0000000..3dc7ccc --- /dev/null +++ b/docs/at_crowdfund.html @@ -0,0 +1,187 @@ + + + + +CIYAM AT - Use Case: Crowdfunding Agent + + + + + + + +
+ + +
+
+
+Use Case: Crowdfunding Agent
+----------------------------
+
+If a target balance is achieved by a hard-coded time then the entire balance will be sent to an account which
+is also hard-coded into the AT. If not then the txs that were sent to it will be iterated and refunded to one
+by one.
+
+Note that there are exactly 9 steps required to be executed "per refund" so in order for this AT to correctly
+refund every tx a fee that allows for those steps would either need to be charged for sending funds to the AT
+or otherwise the amount needed to cover those steps would need to be deducted from the refund.
+
+Variables
+---------
+
+@00 ==> @timestamp
+@01 ==> @decision_time
+@02 ==> @txid
+@03 ==> (unused)
+@04 ==> @tx_info
+@05 ==> @target_amt
+@06 ==> @target_acc
+@07 ==> @balance
+@08 ==> @tx_source
+@09 ==> @refund_time
+
+Functions
+---------
+
+20 (0x14) = get a time stamp value for the last block in the blockchain
+21 (0x15) = get txid for the first tx after the provided time stamp
+22 (0x16) = get a time stamp value for a given txid
+24 (0x18) = get source account/address for a given txid
+25 (0x19) = get balance of own account
+27 (0x1b) = get funds amount for a given txid
+31 (0x1f) = pay given funds amount to a given account/address
+
+Sample Function Data
+--------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000ffff,0x0000000000000000 false
+function 025 0 true
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000100,0x0000000000000100,0x0000000000000100,0x0000000000000000 false
+
+Sample Run Output
+-----------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+(resetting function data)
+func: 25 rc: 0000000000000051
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 28 with 100 rc: 0000000000000000
+func1: 24 with 100 rc: 1111000000000000
+func1: 27 with 100 rc: 0000000000000100
+payout 70 to account: 1111000000000000
+(stopped - zero balance)
+
+Script Assembly
+---------------
+
+if @timestamp not zero goto loop                         1e0000000034
+get last block timestamp and put in @timestamp           35140000000000
+copy @timestamp to @refund_time                          020900000000000000
+set @decision_time                                       0101000000c55d0a0000000000
+set @target_amt (to 100)                                 01050000006400000000000000
+set @target_acc                                          01060000001111111100000000
+
+:loop (0000003d)
+get tx at after @timestamp and store in @txid            3615000200000000000000
+get timestamp for @txid and store in @timestamp          3616000000000002000000
+if @timestamp > @decision_time goto decision             1f000000000100000014
+if @txid is zero finish                                  2602000000
+goto loop                                                1a3d000000
+
+:decision (00000067)
+get balance and store in @balance                        35190007000000
+restore @timestamp from @refund_time                     020000000009000000
+if @target_amt > @balance goto refund                    1f050000000700000013
+
+:funded
+set pcs                                                  30
+pay balance to @target_account                           331a0006000000
+finish                                                   28
+
+:refund (0000008a)
+set pcs                                                  30
+
+:refund loop
+get tx at after @timestamp and store in @txid            3615000200000000000000
+get timestamp for @txid and store in @timestamp          3616000000000002000000
+if @txid is zero finish                                  2602000000
+
+get tx type for @txid and store in @tx_info              361c000400000002000000
+if @tx_info is non-zero goto skip                        1e0400000027
+
+get account for @txid and put in @tx_source              3618000800000002000000
+get amount for @txid and store in @tx_info               361b000400000002000000
+send @tx_info to @tx_source                              341f000400000008000000
+
+:skip
+goto refund loop                                         1a8a000000
+
+Assembly Code
+-------------
+
+00000000* BNZ $00000000 :0000003d
+00000006  FUN @00000000 20
+0000000d  SET @00000009 $00000000
+00000016  SET @00000001 #0000001100000000
+00000023  SET @00000005 #00000002dd231b00
+00000030  SET @00000006 #15aefb06dcb7450e
+0000003d  FUN @00000002 21 $00000000
+00000048  FUN @00000000 22 $00000002
+00000053  BGT $00000000 $00000001 :00000067
+0000005d  FIZ @00000002
+00000062  JMP :0000003d
+00000067  FUN @00000007 25
+0000006e  SET @00000000 $00000009
+00000077  BGT $00000005 $00000007 :0000008a
+00000081  PCS
+00000082  FUN 26 $00000006
+00000089  FIN
+0000008a  PCS
+0000008b  FUN @00000002 21 $00000000
+00000096  FUN @00000000 22 $00000002
+000000a1  FIZ @00000002
+000000a6  FUN @00000004 28 $00000002
+000000b1  BNZ $00000004 :000000d8
+000000b7  FUN @00000008 24 $00000002
+000000c2  FUN @00000004 27 $00000002
+000000cd  FUN 31 $00000004 $00000008
+000000d8  JMP :0000008a
+
+Machine Code
+------------
+
+1e000000003d351400000000000209000000000000000101000000c55d0a00000000000105000000640000000000000001060000
+001111111100000000361500020000000000000036160000000000020000001f00000000010000001426020000001a3d00000035
+1900070000000200000000090000001f05000000070000001330331a000600000028303615000200000000000000361600000000
+00020000002602000000361c0004000000020000001e04000000273618000800000002000000361b000400000002000000341f00
+04000000080000001a8a000000
+
+
+
+
+ + + + + + diff --git a/docs/at_crowdfund_tests.html b/docs/at_crowdfund_tests.html new file mode 100644 index 0000000..8ff468f --- /dev/null +++ b/docs/at_crowdfund_tests.html @@ -0,0 +1,272 @@ + + + + +CIYAM AT - Use Case Tests: Crowdfunding Agent + + + + + + + +
+ + +
+
+
+Use Case Tests: Crowdfunding Agent
+----------------------------------
+
+A summary of the tests follows:
+
+Test 1 - Check refund to one account.
+Test 2 - Check funding succeed, by set decision_amount to 0x20.
+Test 3 - Check refund to multi-account.
+Test 4 - Check @txid is zero.
+Test 5 - Check tx type is non-zero.
+Test 6 - Check no function data.
+
+Test 1 (Check refund to one account)
+------------------------------------
+
+Sample Function Data (Test 1)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000ffff,0x0000000000000000 false
+function 025 0 true
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000100,0x0000000000000100,0x0000000000000100,0x0000000000000000 false
+
+Sample Run Output (Test 1):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+(resetting function data)
+func: 25 rc: 0000000000000051
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 28 with 100 rc: 0000000000000000
+func1: 24 with 100 rc: 1111000000000000
+func1: 27 with 100 rc: 0000000000000100
+payout 70 to account: 1111000000000000
+(stopped - zero balance)
+
+Test 2 (Check funding succeed, by set decision_amount to 0x20)
+--------------------------------------------------------------
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* BNZ $00000000 :0000003d
+00000006  FUN @00000000 20
+0000000d  SET @00000009 $00000000
+00000016  SET @00000001 #00000000000a5dc5
+00000023  SET @00000005 #0000000000000020
+00000030  SET @00000006 #0000000011111111
+0000003d  FUN @00000002 21 $00000000
+00000048  FUN @00000000 22 $00000002
+00000053  BGT $00000000 $00000001 :00000067
+0000005d  FIZ @00000002
+00000062  JMP :0000003d
+00000067  FUN @00000007 25
+0000006e  SET @00000000 $00000009
+00000077  BGT $00000005 $00000007 :0000008a
+00000081  PCS
+00000082  FUN 26 $00000006
+00000089  FIN
+0000008a  PCS
+0000008b  FUN @00000002 21 $00000000
+00000096  FUN @00000000 22 $00000002
+000000a1  FIZ @00000002
+000000a6  FUN @00000004 28 $00000002
+000000b1  BNZ $00000004 :000000d8
+000000b7  FUN @00000008 24 $00000002
+000000c2  FUN @00000004 27 $00000002
+000000cd  FUN 31 $00000004 $00000008
+000000d8  JMP :0000008a
+
+Machine Code (Test 2):
+----------------------
+
+1e000000003d351400000000000209000000000000000101000000c55d0a00000000000105000000200000000000000001060000
+001111111100000000361500020000000000000036160000000000020000001f00000000010000001426020000001a3d00000035
+1900070000000200000000090000001f05000000070000001330331a000600000028303615000200000000000000361600000000
+00020000002602000000361c0004000000020000001e04000000273618000800000002000000361b000400000002000000341f00
+04000000080000001a8a000000
+
+Sample Function Data (Test 2)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000ffff,0x0000000000000000 false
+function 025 0 true
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000100,0x0000000000000100,0x0000000000000100,0x0000000000000000 false
+
+Sample Run Output (Test 2):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+(resetting function data)
+func: 25 rc: 0000000000000051
+payout 77 to account: 286331153
+(stopped - zero balance)
+
+Test 3 (Check refund to multi-account)
+-------------------------------------
+
+Sample Function Data (Test 3)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000ffff,0x0000000000000000 false
+function 025 0 true
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000010,0x0000000000000011,0x0000000000000012,0x0000000000000000 false
+
+Sample Run Output (Test 3):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+(resetting function data)
+func: 25 rc: 0000000000000051
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 28 with 100 rc: 0000000000000000
+func1: 24 with 100 rc: 1111000000000000
+func1: 27 with 100 rc: 0000000000000010
+payout 16 to account: 1111000000000000
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 28 with 101 rc: 0000000000000000
+func1: 24 with 101 rc: 2222000000000000
+func1: 27 with 101 rc: 0000000000000011
+payout 17 to account: 2222000000000000
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+func1: 28 with 102 rc: 0000000000000000
+func1: 24 with 102 rc: 3333000000000000
+func1: 27 with 102 rc: 0000000000000012
+payout 17 to account: 3333000000000000
+(stopped - zero balance)
+
+Test 4 (Check @txid is zero)
+-----------------------------
+
+Sample Function Data (Test 4)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function 021 0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000ffff,0x0000000000000000 false
+function 025 0 true
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000100,0x0000000000000100,0x0000000000000100,0x0000000000000000 false
+
+Sample Run Output (Test 4):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000000
+func1: 22 with 0 rc: 00000000000a5da8
+(finished)
+
+Test 5 (Check tx type is non-zero)
+----------------------------------
+
+Sample Function Data (Test 5)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000ffff,0x0000000000000000 false
+function 025 0 true
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000100,0x0000000000000100,0x0000000000000100,0x0000000000000000 false
+function 028 0x0000000000000001,0x0000000000000002,0x0000000000000003,0x0000000000000000 false
+
+Sample Run Output (Test 5):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+(resetting function data)
+func: 25 rc: 0000000000000051
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 28 with 100 rc: 0000000000000001
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 28 with 101 rc: 0000000000000002
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+func1: 28 with 102 rc: 0000000000000003
+func1: 21 with 679368 rc: 0000000000000000
+func1: 22 with 0 rc: 0000000000000000
+(finished)
+
+Test 6 (Check no function data)
+-------------------------------
+
+Sample Function Data (Test 6)
+-----------------------------
+
+Sample Run Output (Test 6):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000000
+func1: 22 with 0 rc: 0000000000000000
+(finished)
+
+
+
+
+ + + + + + diff --git a/docs/at_dormant.html b/docs/at_dormant.html new file mode 100644 index 0000000..8f1e7f2 --- /dev/null +++ b/docs/at_dormant.html @@ -0,0 +1,175 @@ + + + + +CIYAM AT - Use Case: Dormant Funds Transfer + + + + + + + +
+ + +
+
+
+Use Case: Dormant Funds Transfer
+--------------------------------
+
+An AT that will transfer its funds to another account if it is not sent a tx before a given time. This can be
+used as a simple "will" to endow or donate funds when an account has become dormant.
+
+First execution will set up a timestamp in future and any later transaction sent by the AT's owner will reset
+this to the future again. If a transaction is sent to it from any other account after the payout time then it
+will transfer its balance to the "payout" account (this is initially hard-coded but can be at any time before
+payout modified by the AT's owner via the first 64 bits of an AM if AMs are supported by the host).
+
+Variables
+---------
+
+@00 ==> @timestamp
+@01 ==> @payout_time
+@02 ==> @txid
+@03 ==> @tx_time
+@04 ==> @tx_info
+@05 ==> @tx_source
+@06 ==> @am_type_subtype
+@07 ==> @payout_account
+@08 ==> @zero
+
+Functions
+---------
+
+20 (0x14) = get a time stamp value for the last block in the blockchain
+21 (0x15) = get txid for the first tx after the provided time stamp
+22 (0x16) = get a time stamp value for a given txid
+24 (0x18) = get source account/address for a given txid
+26 (0x1a) = pay account balance to a given account/address
+28 (0x1c) = get tx type and subtype for a given txid
+29 (0x1d) = get the AT creator's account/address
+30 (0x1e) = get first 64 bits of AM data
+
+Sample Function Data
+--------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000012345,0x0000000000012345,0x00000000000a5dc8,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 028 0x0000000000000000,0x0000000100000002,0x0000000000000000,0x0000000000000000 false
+function 029 0x2222000000000000 true
+function 030 0x0000000000000000,0x1111111100000000,0x0000000000000000,0x0000000000000000 false
+
+Sample Run Output
+-----------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000012345
+func1: 28 with 100 rc: 0000000000000000
+func1: 21 with 74565 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000012345
+func1: 28 with 101 rc: 0000000100000002
+func: 29 rc: 2222000000000000
+func1: 24 with 101 rc: 2222000000000000
+func2: 30 with 101 and 0 rc: 1111111100000000
+func1: 21 with 74565 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+func1: 28 with 102 rc: 0000000000000000
+payout 56 to account: 1229782937960972288
+(stopped - zero balance)
+
+Script Assembly
+---------------
+
+if @timestamp not zero goto loop                         1e0000000046
+get last block timestamp and put in @timestamp           35140000000000
+set @am_type_subtype to 0x0000000100000002 (AM)          01060000000200000001000000
+set @payout account to 0x0000000011111111                01070000001111111100000000
+
+:init (00000027)
+set @payout_time to $timestamp                           020100000000000000
+set @tx_info to (604800 seconds in a week)               0104000000803a090000000000
+add @tx_info to @payout_time                             060100000004000000
+
+:loop (00000046)
+get tx at after @timestamp and store in @txid            3615000200000000000000
+if @txid is zero finish                                  2602000000
+get timestamp for @txid and store in @tx_time            3616000300000002000000
+get tx type for @txid and store in @tx_info              361c000400000002000000
+if @tx_info != @am_type_subtype goto skip                24040000000600000044
+get AT owner's account and store in @tx_info             351d0004000000
+get account for @txid and put in @tx_source              3618000500000002000000
+if @tx_info != @tx_source goto skip                      24040000000500000028
+get AM data for @txid at pos @zero and put in @tx_info   371e00040000000200000008000000
+if @tx_info zero then goto skip                          1b040000000f
+set @payout_account to @tx_info                          020700000004000000
+
+:skip (000000b0)
+if @payout_account zero goto ignore                      1b0700000010
+if @tx_time > @payout_time goto payout                   1f030000000100000018
+
+:ignore (000000c0)
+set @timestamp to @tx_time                               020000000003000000
+goto init                                                1a27000000
+
+:payout (000000ce)
+pay balance to @payout_account                           331a0007000000
+finish                                                   28
+
+Assembly Code
+-------------
+
+00000000* BNZ $00000000 :00000046
+00000006  FUN @00000000 20
+0000000d  SET @00000006 #0000000100000002
+0000001a  SET @00000007 #0000000011111111
+00000027  SET @00000001 $00000000
+00000030  SET @00000004 #0000000000093a80
+0000003d  ADD @00000001 $00000004
+00000046  FUN @00000002 21 $00000000
+00000051  FIZ @00000002
+00000056  FUN @00000003 22 $00000002
+00000061  FUN @00000004 28 $00000002
+0000006c  BNE $00000004 $00000006 :000000b0
+00000076  FUN @00000004 29
+0000007d  FUN @00000005 24 $00000002
+00000088  BNE $00000004 $00000005 :000000b0
+00000092  FUN @00000004 30 $00000002 $00000008
+000000a1  BZR $00000004 :000000b0
+000000a7  SET @00000007 $00000004
+000000b0  BZR $00000007 :000000c0
+000000b6  BGT $00000003 $00000001 :000000ce
+000000c0  SET @00000000 $00000003
+000000c9  JMP :00000027
+000000ce  FUN 26 $00000007
+000000d5  FIN
+
+Machine Code
+------------
+
+1e00000000463514000000000001060000000200000001000000010700000011111111000000000201000000000000000104
+000000803a090000000000060100000004000000361500020000000000000026020000003616000300000002000000361c00
+040000000200000024040000000600000044351d0004000000361800050000000200000024040000000500000028371e0004
+00000002000000080000001b040000000f0207000000040000001b07000000101f0300000001000000180200000000030000
+001a27000000331a000700000028
+
+
+
+ + + + + + diff --git a/docs/at_dormant_tests.html b/docs/at_dormant_tests.html new file mode 100644 index 0000000..b926397 --- /dev/null +++ b/docs/at_dormant_tests.html @@ -0,0 +1,186 @@ + + + + +CIYAM AT - Use Case Tests: Dormant Funds Transfer + + + + + + + +
+ + +
+
+
+Use Case Tests: Dormant Funds Transfer
+--------------------------------------
+
+A summary of the tests follows:
+
+Test 1 - Check transfer succeed to the account set by AM.
+Test 2 - Check transfer succeed to default account without AM.
+Test 3 - Check don't transfer when AT sent tx before a given time.
+Test 4 - Check transfer succeed to default account with other's AM.
+Test 5 - Check no function data.
+
+Test 1 (Check transfer succeed to the account set by AM)
+--------------------------------------------------------
+
+Sample Function Data (Test 1)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000012345,0x0000000000012345,0x00000000000a5dc8,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 028 0x0000000000000000,0x0000000100000002,0x0000000000000000,0x0000000000000000 false
+function 029 0x2222000000000000 true
+function 030 0x0000000000000000,0x1111012300000000,0x0000000000000000,0x0000000000000000 false
+
+Sample Run Output (Test 1):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000012345
+func1: 28 with 100 rc: 0000000000000000
+func1: 21 with 74565 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000012345
+func1: 28 with 101 rc: 0000000100000002
+func: 29 rc: 2222000000000000
+func1: 24 with 101 rc: 2222000000000000
+func2: 30 with 101 and 0 rc: 1111012300000000
+func1: 21 with 74565 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+func1: 28 with 102 rc: 0000000000000000
+payout 56 to account: 1229765423084339200
+(stopped - zero balance)
+
+Test 2 (Check transfer succeed to default account without AM)
+-------------------------------------------------------------
+
+Sample Function Data (Test 2)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000012345,0x0000000000012345,0x00000000000a5dc8,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 028 0x0000000000000000,0x0000000100000002,0x0000000000000000,0x0000000000000000 false
+function 029 0x2222000000000000 true
+
+Sample Run Output (Test 2):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000012345
+func1: 28 with 100 rc: 0000000000000000
+func1: 21 with 74565 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000012345
+func1: 28 with 101 rc: 0000000100000002
+func: 29 rc: 2222000000000000
+func1: 24 with 101 rc: 2222000000000000
+func2: 30 with 101 and 0 rc: 0000000000000000
+func1: 21 with 74565 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+func1: 28 with 102 rc: 0000000000000000
+payout 57 to account: 286331153
+(stopped - zero balance)
+
+Test 3 (Check don't transfer when AT sent tx before a given time)
+-----------------------------------------------------------------
+
+Sample Function Data (Test 3)
+-----------------------------
+
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000012345,0x0000000000012346,0x0000000000012347,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 028 0x0000000000000000,0x0000000100000002,0x0000000000000000,0x0000000000000000 false
+function 029 0x2222000000000000 true
+function 030 0x0000000000000000,0x1111012300000000,0x0000000000000000,0x0000000000000000 false
+
+Sample Run Output (Test 3):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000012345
+func1: 28 with 100 rc: 0000000000000000
+func1: 21 with 74565 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000012346
+func1: 28 with 101 rc: 0000000100000002
+func: 29 rc: 2222000000000000
+func1: 24 with 101 rc: 2222000000000000
+func2: 30 with 101 and 0 rc: 1111012300000000
+func1: 21 with 74566 rc: 0000000000000066
+func1: 22 with 102 rc: 0000000000012347
+func1: 28 with 102 rc: 0000000000000000
+func1: 21 with 74567 rc: 0000000000000000
+(finished)
+
+Test 4 (Check transfer succeed to default account with others'AM)
+-----------------------------------------------------------------
+
+Sample Function Data (Test 4)
+-----------------------------
+balance 1000
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000012345,0x0000000000012345,0x00000000000a5dc8,0x0000000000000000 false
+function 024 0x1111000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 028 0x0000000000000000,0x0000000100000002,0x0000000000000000,0x0000000000000000 false
+function 029 0x2222000000000000 true
+function 030 0x1111455000000000,0x1111112300000000,0x0000000000000000,0x0000000000000000 false
+
+Sample Run Output (Test 4):
+---------------------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000012345
+func1: 28 with 100 rc: 0000000000000000
+func1: 21 with 74565 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000012345
+func1: 28 with 101 rc: 0000000100000002
+func: 29 rc: 2222000000000000
+func1: 24 with 101 rc: 3333000000000000
+func1: 21 with 74565 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc8
+func1: 28 with 102 rc: 0000000000000000
+payout 959 to account: 286331153
+(stopped - zero balance)
+
+Test 5 (Check no function data)
+-------------------------------
+
+Sample Run Output (Test 5):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000000
+(finished)
+
+
+
+
+ + + + + + diff --git a/docs/at_lottery.html b/docs/at_lottery.html new file mode 100644 index 0000000..471f13f --- /dev/null +++ b/docs/at_lottery.html @@ -0,0 +1,230 @@ + + + + +CIYAM AT - Use Case: Lottery + + + + + + + +
+ + +
+
+
+Use Case: Lottery
+-----------------
+
+A lottery where the highest ticket "value" in a given time period will be rewarded the AT's balance. A ticket
+is expected to be the hash of adding a tx id to a future block id. Minimum ticket price is set at 1 unit (and
+this can be changed via the @min_amount variable).
+
+Variables
+---------
+
+@00 ==> @timestamp
+@01 ==> @payout_time
+@02 ==> @txid
+@03 ==> @tx_time
+@04 ==> @tx_info
+@05 ==> @best_ticket
+@06 ==> @best_account
+@07 ==> @balance
+@08 ==> @tx_amount
+@09 ==> @min_amount
+@0a ==> @target_account
+
+Functions
+---------
+
+20 (0x14) = get a time stamp value for the last block in the blockchain
+21 (0x15) = get txid for the first tx after the provided time stamp
+22 (0x16) = get a time stamp value for a given txid
+23 (0x17) = get ticket for a given txid
+24 (0x18) = get source account/address for a given txid
+27 (0x1b) = get funds amount for a given txid
+28 (0x1c) = get tx type and subtype for a given txid
+31 (0x1f) = pay given funds amount to a given account/address
+32 (0x20) = get old balance of own account
+33 (0x21) = pay old balance to a given account/address
+
+Sample Function Data
+--------------------
+
+balance 1000
+function 020 0x0000000000012345 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000067,0x0000000000000000 false
+function 022 0x00000000000a5da8,0x00000000000a5db8,0x00000000000a5dc4,0x00000000000a5dc8,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000fff0,0x000000000000ffff,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x4444000000000000,0x0000000000000000 false
+function 027 0x0000000000000064,0x0000000000000062,0x0000000000000128,0x0000000000000064,0x0000000000000000 false
+function 028 0x0000000000000000 true
+
+Sample Run Output
+-----------------
+
+func: 20 rc: 0000000000012345
+func1: 21 with 74565 rc: 0000000000000064
+func1: 22 with 100 rc: 00000000000a5da8
+func1: 27 with 100 rc: 0000000000000064
+func1: 28 with 100 rc: 0000000000000000
+func1: 23 with 100 rc: 000000000000ff00
+func1: 24 with 100 rc: 1111000000000000
+func1: 21 with 679336 rc: 0000000000000065
+func1: 22 with 101 rc: 00000000000a5db8
+func1: 27 with 101 rc: 0000000000000062
+func1: 24 with 101 rc: 2222000000000000
+payout 98 to account: 2222000000000000
+func1: 21 with 679352 rc: 0000000000000066
+func1: 22 with 102 rc: 00000000000a5dc4
+func1: 27 with 102 rc: 0000000000000128
+func1: 24 with 102 rc: 3333000000000000
+payout 196 to account: 3333000000000000
+func1: 28 with 102 rc: 0000000000000000
+func1: 23 with 102 rc: 000000000000fff0
+func1: 24 with 102 rc: 3333000000000000
+func1: 21 with 679364 rc: 0000000000000067
+func1: 22 with 103 rc: 00000000000a5dc8
+func: 32 rc: 0000000000000285
+payout 642 to account: 3689292519746568192
+func1: 33 with 3689292519746568192 rc: 0000000000000000
+(stopped - zero balance)
+
+Script Assembly
+---------------
+
+if @timestamp not zero goto loop                         1e0000000039
+set @min_amount to 100 (1 unit)                          01090000006400000000000000
+get last block timestamp and put in @timestamp           35140000000000
+
+:init (0000001a)
+set @payout_time to $timestamp                           020100000000000000
+set @tx_info to (604800 seconds in a week)               0104000000803a090000000000
+add @tx_info to @payout_time                             060100000004000000
+
+:loop (00000039)
+get tx at after @timestamp and store in @txid            3615000200000000000000
+if @txid is zero finish                                  2602000000
+
+get timestamp for @txid and store in @tx_time            3616000300000002000000
+if @tx_time > @payout_time goto payout                   1f030000000100000072
+
+get amount for @txid and store in @tx_amount             361b000800000002000000
+if @tx_amount == @min_amount goto continue               2308000000090000000f
+goto refund                                              1af3000000
+
+:continue (00000078)
+get tx type for @txid and store in @tx_info              361c000400000002000000
+if @tx_info is non-zero goto skip                        1e0400000035
+
+get ticket for @txid and store in @tx_info               3617000400000002000000
+if @tx_info zero finish                                  26040000007f
+
+if @tx_info < @best_ticket goto skip                     2004000000050000001e
+set @best_ticket to @tx_info                             020500000004000000
+get account for @txid and put in @best_account           3618000600000002000000
+
+:skip (000000b8)
+set @timestamp to @tx_time                               020000000003000000
+goto loop                                                1a39000000
+
+:payout (000000c6)
+get old balance and store in @balance                    35200007000000
+if @balance is zero goto empty                           1b0700000018
+if @best_ticket is zero goto empty                       1b0500000012
+pay balance to @best_account                             33210006000000
+goto finish_payout                                       1a31010000
+
+:empty (000000e5)
+set @timestamp to @tx_time                               020000000003000000
+goto init                                                1a1a000000
+
+:refund (000000f3)
+get account for @tx_id and put in @target_account        3618000a00000002000000
+if @tx_amount < @min_amount goto :refund_less            20080000000900000023
+subtract @min_amount from @tx_amount                     070800000009000000
+send @tx_amount to @target_account                       341f00080000000a000000
+goto continue                                            1a78000000
+
+:refund less (00000121)
+send @tx_amount to @target_account                       341f00080000000a000000
+goto skip                                                1ab8000000
+
+:finish_payout (00000131)
+set @timestamp to @payout_time                           020000000004000000
+clear @best_ticket to zero                               0305000000
+goto init                                                1a1a000000
+
+Assembly Code
+-------------
+
+00000000* BNZ $00000000 :00000039
+00000006  SET @00000009 #0000000000000064
+00000013  FUN @00000000 20
+0000001a  SET @00000001 $00000000
+00000023  SET @00000004 #0000000000093a80
+00000030  ADD @00000001 $00000004
+00000039  FUN @00000002 21 $00000000
+00000044  FIZ @00000002
+00000049  FUN @00000003 22 $00000002
+00000054  BGT $00000003 $00000001 :000000c6
+0000005e  FUN @00000008 27 $00000002
+00000069  BEQ $00000008 $00000009 :00000078
+00000073  JMP :000000f3
+00000078  FUN @00000004 28 $00000002
+00000083  BNZ $00000004 :000000b8
+00000089  FUN @00000004 23 $00000002
+00000094  FIZ @00000004
+00000099  NOP
+0000009a  BLT $00000004 $00000005 :000000b8
+000000a4  SET @00000005 $00000004
+000000ad  FUN @00000006 24 $00000002
+000000b8  SET @00000000 $00000003
+000000c1  JMP :00000039
+000000c6  FUN @00000007 32
+000000cd  BZR $00000007 :000000e5
+000000d3  BZR $00000005 :000000e5
+000000d9  FUN 33 $00000006
+000000e0  CLR @00000005
+000000e5  SET @00000000 $00000003
+000000ee  JMP :0000001a
+000000f3  FUN @0000000a 24 $00000002
+000000fe  BLT $00000008 $00000009 :0000012c
+00000108  SUB @00000008 $00000009
+00000111  FUN 31 $0000000a $00000002
+0000011c  JMP :00000078
+00000121  FUN 31 $00000008 $0000000a
+0000012c  JMP :000000b8
+
+Machine Code
+------------
+
+1e000000003901090000006400000000000000351400000000000201000000000000000104000000803a0900000000000601
+000000040000003615000200000000000000260200000036160003000000020000001f030000000100000072361b00080000
+00020000002308000000090000000f1af3000000361c0004000000020000001e040000003536170004000000020000002604
+0000007f2004000000050000001e02050000000400000036180006000000020000000200000000030000001a390000003520
+00070000001b07000000181b0500000012332100060000001a310100000200000000030000001a1a0000003618000a000000
+0200000020080000000900000023070800000009000000341f00080000000a0000001a78000000341f00080000000a000000
+1ab800000002000000000400000003050000001a1a000000
+
+
+
+
+ + + + + + diff --git a/docs/at_lottery_tests.html b/docs/at_lottery_tests.html new file mode 100644 index 0000000..b2695c0 --- /dev/null +++ b/docs/at_lottery_tests.html @@ -0,0 +1,201 @@ + + + + +CIYAM AT - Use Case Tests: Lottery + + + + + + + +
+ + +
+
+
+Use Case Tests: Lottery
+-----------------------
+
+For each test the sample function data is provided and the results/output of the AT program (balance has been
+set to 1000).
+
+A summary of the tests follows:
+
+Test 1: Check that less than minimum amount is refunded. (player 1 wins)
+Test 2: Check that exact amount purchases a ticket. (player 2 wins)
+Test 3: Check that extra payment refunds difference. (player 3 wins)
+Test 4: Check all pay less. (no player wins)
+
+Test 1 (Check that less than minimum amount is refunded)
+--------------------------------------------------------
+
+Sample Function Data (Test 1):
+------------------------------
+balance 1000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x0000000000093a81,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000fff0,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000064,0x0000000000000062,0x000000000000064,0x0000000000000064 false
+function 028 0x0000000000000000 true
+
+Sample Run Output (Test 1):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 27 with 100 rc: 0000000000000064
+func1: 28 with 100 rc: 0000000000000000
+func1: 23 with 100 rc: 000000000000ff00
+func1: 24 with 100 rc: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 27 with 101 rc: 0000000000000062
+func1: 24 with 101 rc: 2222000000000000
+payout 98 to account: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 0000000000093a81
+func: 32 rc: 000000000000035f
+payout 860 to account: 1229764173248856064
+func1: 33 with 1229764173248856064 rc: 0000000000000000
+(stopped - zero balance)
+
+Test 2 (Check that exact amount purchases a ticket)
+---------------------------------------------------
+
+Sample Function Data (Test 2):
+------------------------------
+balance 1000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x0000000000093a81,0x0000000000000000 false
+function 023 0x000000000000ee00,0x000000000000ff00,0x000000000000fff0,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x0000000000000064,0x0000000000000064,0x000000000000064,0x0000000000000064 false
+function 028 0x0000000000000000 true
+
+Sample Run Output
+-----------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 27 with 100 rc: 0000000000000064
+func1: 28 with 100 rc: 0000000000000000
+func1: 23 with 100 rc: 000000000000ee00
+func1: 24 with 100 rc: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 27 with 101 rc: 0000000000000064
+func1: 28 with 101 rc: 0000000000000000
+func1: 23 with 101 rc: 000000000000ff00
+func1: 24 with 101 rc: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 0000000000093a81
+func: 32 rc: 00000000000003be
+payout 955 to account: 2459528346497712128
+func1: 33 with 2459528346497712128 rc: 0000000000000000
+(stopped - zero balance)
+
+Test 3 (Check that extra payment refunds difference)
+----------------------------------------------------
+
+Sample Function Data (Test 3):
+------------------------------
+
+balance 1000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000067,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x0000000000093a80,0x0000000000093a81,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000fff0,0x000000000000fff0,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x3344000000000000,0x0000000000000000 false
+function 027 0x0000000000000128,0x0000000000000064,0x000000000000064,0x000000000000064,0x0000000000000064 false
+function 028 0x0000000000000000 true
+
+Sample Run Output (Test 3):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 27 with 100 rc: 0000000000000128
+func1: 24 with 100 rc: 1111000000000000
+payout 196 to account: 1111000000000000
+func1: 28 with 100 rc: 0000000000000000
+func1: 23 with 100 rc: 000000000000ff00
+func1: 24 with 100 rc: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 27 with 101 rc: 0000000000000064
+func1: 28 with 101 rc: 0000000000000000
+func1: 23 with 101 rc: 000000000000ee00
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 0000000000093a80
+func1: 27 with 102 rc: 0000000000000064
+func1: 28 with 102 rc: 0000000000000000
+func1: 23 with 102 rc: 000000000000fff0
+func1: 24 with 102 rc: 3333000000000000
+func1: 21 with 604800 rc: 0000000000000067
+func1: 22 with 103 rc: 0000000000093a81
+func: 32 rc: 00000000000002e6
+payout 739 to account: 3689292519746568192
+func1: 33 with 3689292519746568192 rc: 0000000000000000
+(stopped - zero balance)
+
+Test 4 (Check all send less amount):
+-------------------------------------
+
+Sample Function Data (Test 4):
+------------------------------
+
+balance 1000
+function 020 0x0000000000000000 true
+function +021 0x0000000000000064,0x0000000000000065,0x0000000000000066,0x0000000000000000 false
+function 022 0x0000000000013a80,0x0000000000023a80,0x0000000000093a81,0x0000000000000000 false
+function 023 0x000000000000ff00,0x000000000000ee00,0x000000000000fff0,0x0000000000000000 false
+function 024 0x1111000000000000,0x2222000000000000,0x3333000000000000,0x0000000000000000 false
+function 027 0x000000000000062,0x0000000000000062,0x000000000000062,0x0000000000000064 false
+function 028 0x0000000000000000 true
+
+Sample Run Output (Test 4):
+---------------------------
+
+func: 20 rc: 0000000000000000
+func1: 21 with 0 rc: 0000000000000064
+func1: 22 with 100 rc: 0000000000013a80
+func1: 27 with 100 rc: 0000000000000062
+func1: 24 with 100 rc: 1111000000000000
+payout 98 to account: 1111000000000000
+func1: 21 with 80512 rc: 0000000000000065
+func1: 22 with 101 rc: 0000000000023a80
+func1: 27 with 101 rc: 0000000000000062
+func1: 24 with 101 rc: 2222000000000000
+payout 98 to account: 2222000000000000
+func1: 21 with 146048 rc: 0000000000000066
+func1: 22 with 102 rc: 0000000000093a81
+func: 32 rc: 0000000000000300
+func1: 21 with 604801 rc: 0000000000000000
+(finished)
+
+
+
+
+ + + + + + diff --git a/docs/at_meta.html b/docs/at_meta.html new file mode 100644 index 0000000..77e6663 --- /dev/null +++ b/docs/at_meta.html @@ -0,0 +1,119 @@ + + + + +CIYAM AT - AT Metadata for UI + + + + + + + +
+ + +
+
+
+AT Metadata for UI
+------------------
+
+The following are suggestions for how metadata could be added to an AT in order to provide a flexible UI that
+allows for both lists and views (the latter also being able to function as a form). For enums icons which are
+named in the form <label>.png would be optionally able to be displayed. The file format used here is known as
+"structured I/O" and comes from the CIYAM project (https://github.com/ciyam/ciyam/blob/master/src/sio.cpp).
+
+<enums/>
+ <enum/>
+  <name>playing_card
+  <options>use_icons
+  <items/>
+   <item/>
+    <value>1
+    <label>clubs_ace
+   </item>
+   <item/>
+    <value>2
+    <label>clubs_two
+   </item>
+...
+   <item/>
+    <value>17
+    <label>diamonds_ace
+   </item>
+   <item/>
+    <value>18
+    <label>diamonds_two
+   </item>
+...
+  </items>
+ </enum>
+</enums>
+
+<views/>
+ <view/>
+  <name>card
+  <style>normal
+  <actions>
+  <options>runtime,no_edit
+  <view_fields/>
+   <view_field/>
+    <label>card
+    <value>0000007f
+    <options>enum=playing_card
+    <variety>byte
+   </view_field>
+   <view_field/>
+    <label>selected
+    <value>00000080
+    <options>
+    <variety>bool
+   </view_field>
+  </view_fields>
+ </view>
+</views>
+
+<lists/>
+ <list/>
+  <view>card
+  <style>normal
+  <actions>shuffle=message:1,select=message:2
+  <options>runtime
+  <list_fields/>
+   <list_field/>
+    <label>card_1
+    <extra>selected=00000080
+    <address>00000000:0000007f
+    <options>enum=playing_card
+    <variety>byte
+   </list_field>
+   <list_field/>
+    <label>card_2
+    <extra>selected=00008000
+    <address>00000000:00007f00
+    <options>enum=playing_card
+    <variety>byte
+   </list_field>
+...
+  </list_fields>
+ </list>
+</lists>
+
+
+
+
+ + + + + + diff --git a/docs/at_script.html b/docs/at_script.html new file mode 100644 index 0000000..34e528f --- /dev/null +++ b/docs/at_script.html @@ -0,0 +1,148 @@ + + + + +CIYAM AT - Integrating AT with Script + + + + + + + +
+ + +
+
+
+Integrating AT with Script
+--------------------------
+
+It is not expected that any crypto-currency using Bitcoin's "script" is going to try and extend it so that it
+could execute Turing complete scripts. This document therefore suggests a "minimal" approach that would allow
+AT to operate externally by adding a single op code (OP_CHECKSTATE).
+
+AT Address Format
+-----------------
+
+An AT cannot have a "normal" address as it does not have a private key. It is suggested that a custom address
+format would be "reserved" for AT's (so every peer can recognise when funds are being to be sent to an AT and
+so that end users can "easily recognise" such addresses and not confuse them with standard addresses).
+
+The following is a suggestion as to how this might be done:
+
+1xxATxx<MD5 of AT>[checksum]
+
+So an AT address might look like the following:
+1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg
+
+and consists of 3 parts:
+1xxATxx (prefix) YptzC5a7p9obc2SLMPS148G (MD5 in base58) 2Qxg (normal address checksum)
+
+Thus if a user goes to send funds to 1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg then the client would see the special
+"1xxATxx" prefix and could "warn" the user that they are possibly sending funds to an AT (assuming that it is
+not the AT creation transaction).
+
+Creating an AT
+--------------
+
+So assuming the creator has a UTXO that has 600 satoshis and that the "AT creation fee" is 500 satoshis, with
+the creator wanting to give the AT an initial balance of 100 satoshis, the AT creation transaction would look
+very similar to this (assuming an "implicit" tx fee of 1 satoshi):
+
+INPUT:
+OP_DUP OP_HASH160 <creator's address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 600
+
+OUTPUT:
+script: hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 599
+script: OP_RETURN <meta, state, code and initial data>
+
+Mining a new AT
+---------------
+
+Upon receiving an AT creation tx the miner would check that the fee is sufficient then it would determine the
+initial "state" of the AT by determining a hash of the entire AT image (which could be saved as a binary file
+or stored in DB). This "state" hash would then be prefixed to the OP_CHECKSTATE script. The "initial balance"
+for the AT would appear as an output that is identical to the original UXTO script.
+
+INPUT:
+<state> hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 599
+
+OUTPUT:
+script: hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 100
+...
+script: OP_DUP OP_HASH160 <miner's address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 499 (i.e. rest of fee)
+
+Note that every peer would also need to run AT in order to be able to verify that the AT state is correct. So
+it is important that there are "maximum limits" (such as how many AT steps can be executed per AT and perhaps
+how many ATs can be included per block so there is no way to "kill a node" with an AT).
+
+Sending Funds to an AT
+----------------------
+
+Assuming we had a "lottery" AT and we have three entrants each sending 100 satoshis then the transactions the
+peers send would look much like the following:
+
+(sender1)
+INPUT:
+OP_DUP OP_HASH160 <sender1 address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 101
+
+OUTPUT:
+script: hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 100
+
+(sender2)
+INPUT:
+OP_DUP OP_HASH160 <sender2 address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 101
+
+OUTPUT:
+script: hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 100
+
+(sender3)
+INPUT:
+OP_DUP OP_HASH160 <sender3 address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 101
+
+OUTPUT:
+script: hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 100
+
+The output scripts use OP_CHECKSTATE (rather than OP_CHECKSIG like regular transactions) hence why the custom
+address format is suggested (otherwise the end-user would have to "instruct the software to do an AT send").
+
+Processing an AT
+----------------
+
+INPUT:
+<state> hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE (original 100)
+<state> hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE (sender1's 100)
+<state> hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE (sender2's 100)
+<state> hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE (sender3's 100)
+
+OUTPUT:
+script: OP_DUP OP_HASH160 <sender2 address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 300
+script: OP_DUP OP_HASH160 <miner's address hash160> OP_EQUALVERIFY OP_CHECKSIG amount: 50
+script: hash160(1xxATxxYptzC5a7p9obc2SLMPS148G2Qxg) OP_CHECKSTATE amount: 50
+
+So in much the same way that the AT create was handled we see that AT's "state" hash is prefixed to the UTXOs
+that here include the original 100 and the three lots of 100 sent by the "lottery" participants.
+
+Assuming that the lottery decides that "sender2" is the winner and that the fee for mining this AT is 50 then
+we see 300 being output to "sender2" (assuming that was the amount determined to be paid out) as well as then
+50 being "returned to the AT".
+
+
+
+
+ + + + + + diff --git a/docs/at_test_add_dat.html b/docs/at_test_add_dat.html new file mode 100644 index 0000000..787960c --- /dev/null +++ b/docs/at_test_add_dat.html @@ -0,0 +1,475 @@ + + + + +CIYAM AT - Test for AT instruction code 0x06 (ADD_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x06 (ADD_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000000000001
+0000001a  SET @00000002 #0000000000000002
+00000027  SET @00000003 #0000000000000003
+00000034  SET @00000004 #0000000000000004
+00000041  SET @00000005 #0000000000000005
+0000004e  SET @00000006 #0000000000000006
+0000005b  SET @00000007 #0000000000000007
+00000068  SET @00000008 #0000000000000008
+00000075  SET @00000009 #0000000000000009
+00000082  SET @0000000a #000000000000000a
+0000008f  SET @0000000b #000000000000000b
+0000009c  SET @0000000c #000000000000000c
+000000a9  SET @0000000d #000000000000000d
+000000b6  SET @0000000e #000000000000000e
+000000c3  SET @0000000f #000000000000000f
+000000d0  ADD @00000000 $00000001
+000000d9  ADD @00000001 $00000002
+000000e2  ADD @00000002 $00000003
+000000eb  ADD @00000003 $00000004
+000000f4  ADD @00000004 $00000005
+000000fd  ADD @00000005 $00000006
+00000106  ADD @00000006 $00000007
+0000010f  ADD @00000007 $00000008
+00000118  ADD @00000008 $00000009
+00000121  ADD @00000009 $0000000a
+0000012a  ADD @0000000a $0000000b
+00000133  ADD @0000000b $0000000c
+0000013c  ADD @0000000c $0000000d
+00000145  ADD @0000000d $0000000e
+0000014e  ADD @0000000e $0000000f
+00000157  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000010100000001000000000000000102000000020000000000000001030000000300000000000000
+01040000000400000000000000010500000005000000000000000106000000060000000000000001070000000700000000000000
+0108000000080000000000000001090000000900000000000000010a0000000a00000000000000010b0000000b00000000000000
+010c0000000c00000000000000010d0000000d00000000000000010e0000000e00000000000000010f0000000f00000000000000
+06000000000100000006010000000200000006020000000300000006030000000400000006040000000500000006050000000600
+000006060000000700000006070000000800000006080000000900000006090000000a000000060a0000000b000000060b000000
+0c000000060c0000000d000000060d0000000e000000060e0000000f00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 05 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 
+00000020 09 00 00 00 00 00 00 00 0b 00 00 00 00 00 00 00 
+00000030 0d 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000040 11 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 
+00000050 15 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 
+00000060 19 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 
+00000070 1d 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #fffffffffffffff0
+0000000d  SET @00000004 #000000000000000f
+0000001a  SET @00000007 #ffffffffffffffff
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #fffffffffffffff0
+00000041  SET @00000010 #000000000000000f
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #fffffffffffffff0
+00000075  SET @0000001c #000000000000000f
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #ffffffffffffffff
+0000009c  SET @00000025 #fffffffffffffff0
+000000a9  SET @00000028 #000000000000000f
+000000b6  SET @0000002b #ffffffffffffffff
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #fffffffffffffff0
+000000dd  SET @00000034 #000000000000000f
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #000000000000000f
+00000111  ADD @00000001 $00000004
+0000011a  ADD @00000004 $00000007
+00000123  ADD @00000007 $0000000a
+0000012c  ADD @0000000a $0000000d
+00000135  ADD @0000000d $00000010
+0000013e  ADD @00000010 $00000013
+00000147  ADD @00000013 $00000016
+00000150  ADD @00000016 $00000019
+00000159  ADD @00000019 $0000001c
+00000162  ADD @0000001c $0000001f
+0000016b  ADD @0000001f $00000022
+00000174  ADD @00000022 $00000025
+0000017d  ADD @00000025 $00000028
+00000186  ADD @00000028 $0000002b
+0000018f  ADD @0000002b $0000002e
+00000198  ADD @0000002e $00000031
+000001a1  ADD @00000031 $00000034
+000001aa  ADD @00000034 $00000037
+000001b3  ADD @00000037 $0000003a
+000001bc  ADD @0000003a $0000003d
+000001c5  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000f0ffffffffffffff01040000000f000000000000000107000000ffffffffffffffff010a000000ffffffffffffffff
+010d000000f0ffffffffffffff01100000000f000000000000000113000000ffffffffffffffff0116000000ffffffffffffffff
+0119000000f0ffffffffffffff011c0000000f00000000000000011f000000ffffffffffffffff0122000000ffffffffffffffff
+0125000000f0ffffffffffffff01280000000f00000000000000012b000000ffffffffffffffff012e000000ffffffffffffffff
+0131000000f0ffffffffffffff01340000000f000000000000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d0000000f0000000000000006010000000400000006040000000700000006070000000a000000060a0000000d000000060d00
+00001000000006100000001300000006130000001600000006160000001900000006190000001c000000061c0000001f00000006
+1f0000002200000006220000002500000006250000002800000006280000002b000000062b0000002e000000062e000000310000
+0006310000003400000006340000003700000006370000003a000000063a0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 fe ff ff ff ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 ef ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 fe ff ff ff ff ff ff ff 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 ef ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 fe ff ff ff ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 ef ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 fe ff ff ff ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 ef ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 fe ff ff ff ff ff ff ff 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #0f0d0b0907050301
+0000000d  SET @00000004 #e0c0a08060402000
+0000001a  SET @00000007 #0f0d0b0907050301
+00000027  SET @0000000a #e0c0a08060402000
+00000034  SET @0000000d #0f0d0b0907050301
+00000041  SET @00000010 #e0c0a08060402000
+0000004e  SET @00000013 #0f0d0b0907050301
+0000005b  SET @00000016 #e0c0a08060402000
+00000068  SET @00000019 #0f0d0b0907050301
+00000075  SET @0000001c #e0c0a08060402000
+00000082  SET @0000001f #0f0d0b0907050301
+0000008f  SET @00000022 #e0c0a08060402000
+0000009c  SET @00000025 #0f0d0b0907050301
+000000a9  SET @00000028 #e0c0a08060402000
+000000b6  SET @0000002b #0f0d0b0907050301
+000000c3  SET @0000002e #e0c0a08060402000
+000000d0  SET @00000031 #0f0d0b0907050301
+000000dd  SET @00000034 #e0c0a08060402000
+000000ea  SET @00000037 #0f0d0b0907050301
+000000f7  SET @0000003a #e0c0a08060402000
+00000104  SET @0000003d #0f0d0b0907050301
+00000111  ADD @00000001 $00000004
+0000011a  ADD @00000004 $00000007
+00000123  ADD @00000007 $0000000a
+0000012c  ADD @0000000a $0000000d
+00000135  ADD @0000000d $00000010
+0000013e  ADD @00000010 $00000013
+00000147  ADD @00000013 $00000016
+00000150  ADD @00000016 $00000019
+00000159  ADD @00000019 $0000001c
+00000162  ADD @0000001c $0000001f
+0000016b  ADD @0000001f $00000022
+00000174  ADD @00000022 $00000025
+0000017d  ADD @00000025 $00000028
+00000186  ADD @00000028 $0000002b
+0000018f  ADD @0000002b $0000002e
+00000198  ADD @0000002e $00000031
+000001a1  ADD @00000031 $00000034
+000001aa  ADD @00000034 $00000037
+000001b3  ADD @00000037 $0000003a
+000001bc  ADD @0000003a $0000003d
+000001c5  FIN
+
+
+Machine Code (Test 3):
+----------------------
+
+010100000001030507090b0d0f01040000000020406080a0c0e0010700000001030507090b0d0f010a0000000020406080a0c0e0
+010d00000001030507090b0d0f01100000000020406080a0c0e0011300000001030507090b0d0f01160000000020406080a0c0e0
+011900000001030507090b0d0f011c0000000020406080a0c0e0011f00000001030507090b0d0f01220000000020406080a0c0e0
+012500000001030507090b0d0f01280000000020406080a0c0e0012b00000001030507090b0d0f012e0000000020406080a0c0e0
+013100000001030507090b0d0f01340000000020406080a0c0e0013700000001030507090b0d0f013a0000000020406080a0c0e0
+013d00000001030507090b0d0f06010000000400000006040000000700000006070000000a000000060a0000000d000000060d00
+00001000000006100000001300000006130000001600000006160000001900000006190000001c000000061c0000001f00000006
+1f0000002200000006220000002500000006250000002800000006280000002b000000062b0000002e000000062e000000310000
+0006310000003400000006340000003700000006370000003a000000063a0000003d00000028
+
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 01 03 05 07 09 0b 0d 0f 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #5555555555555555
+0000000d  SET @00000001 #2222222222222222
+0000001a  SET @00000002 #9999999999999999
+00000027  SET @00000010 #6666666666666666
+00000034  SET @00000011 #1111111111111111
+00000041  SET @00000012 #9999999999999999
+0000004e  SET @00000020 #1111111111111111
+0000005b  SET @00000021 #2222222222222222
+00000068  SET @00000022 #9999999999999999
+00000075  SET @00000030 #4444444444444444
+00000082  SET @00000031 #1111111111111111
+0000008f  SET @00000032 #9999999999999999
+0000009c  ADD @00000000 $00000001
+000000a5  ADD @00000000 $00000001
+000000ae  ADD @00000010 $00000011
+000000b7  ADD @00000010 $00000011
+000000c0  ADD @00000010 $00000011
+000000c9  ADD @00000020 $00000021
+000000d2  ADD @00000020 $00000021
+000000db  ADD @00000020 $00000021
+000000e4  ADD @00000020 $00000021
+000000ed  ADD @00000030 $00000031
+000000f6  ADD @00000030 $00000031
+000000ff  ADD @00000030 $00000031
+00000108  ADD @00000030 $00000031
+00000111  ADD @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000005555555555555555010100000022222222222222220102000000999999999999999901100000006666666666666666
+01110000001111111111111111011200000099999999999999990120000000111111111111111101210000002222222222222222
+01220000009999999999999999013000000044444444444444440131000000111111111111111101320000009999999999999999
+06000000000100000006000000000100000006100000001100000006100000001100000006100000001100000006200000002100
+00000620000000210000000620000000210000000620000000210000000630000000310000000630000000310000000630000000
+3100000006300000003100000006300000003100000028
+
+
+Data Dump (Test 4):
+-------------------
+
+00000000 99 99 99 99 99 99 99 99 22 22 22 22 22 22 22 22 
+00000010 99 99 99 99 99 99 99 99 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 99 99 99 99 99 99 99 99 11 11 11 11 11 11 11 11 
+00000090 99 99 99 99 99 99 99 99 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 99 99 99 99 99 99 99 99 22 22 22 22 22 22 22 22 
+00000110 99 99 99 99 99 99 99 99 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 99 99 99 99 99 99 99 99 11 11 11 11 11 11 11 11 
+00000190 99 99 99 99 99 99 99 99 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #ffffffffffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  ADD @0000003e $0000003f
+00000023  ADD @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffffffffffff013f000000ffffffffffffffff063e0000003f000000063f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* ADD @ffffffff $ffffffff
+00000009  FIN
+
+Machine Code (Test 6):
+----------------------
+
+06ffffffffffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_and_dat.html b/docs/at_test_and_dat.html new file mode 100644 index 0000000..3c9e62c --- /dev/null +++ b/docs/at_test_and_dat.html @@ -0,0 +1,472 @@ + + + + +CIYAM AT - Test for AT instruction code 0x0b (AND_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x0b (AND_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  AND @00000000 $00000001
+000000cc  AND @00000001 $00000002
+000000d5  AND @00000002 $00000003
+000000de  AND @00000003 $00000004
+000000e7  AND @00000004 $00000005
+000000f0  AND @00000005 $00000006
+000000f9  AND @00000006 $00000007
+00000102  AND @00000007 $00000008
+0000010b  AND @00000008 $0000000a
+00000114  AND @00000009 $0000000a
+0000011d  AND @0000000a $0000000b
+00000126  AND @0000000b $0000000c
+0000012f  AND @0000000c $0000000d
+00000138  AND @0000000d $0000000e
+00000141  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e00000001000000000000000b00000000010000000b010000
+00020000000b02000000030000000b03000000040000000b04000000050000000b05000000060000000b06000000070000000b07
+000000080000000b080000000a0000000b090000000a0000000b0a0000000b0000000b0b0000000c0000000b0c0000000d000000
+0b0d0000000e00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 0e 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 
+00000010 0c 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 
+00000020 0a 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 
+00000030 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 05 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 
+00000050 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #0000000000000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #0000000000000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #0000000000000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #0000000000000000
+00000111  AND @00000001 $00000004
+0000011a  AND @00000004 $00000007
+00000123  AND @00000007 $0000000a
+0000012c  AND @0000000a $0000000d
+00000135  AND @0000000d $00000010
+0000013e  AND @00000010 $00000013
+00000147  AND @00000013 $00000016
+00000150  AND @00000016 $00000019
+00000159  AND @00000019 $0000001c
+00000162  AND @0000001c $0000001f
+0000016b  AND @0000001f $00000022
+00000174  AND @00000022 $00000025
+0000017d  AND @00000025 $00000028
+00000186  AND @00000028 $0000002b
+0000018f  AND @0000002b $0000002e
+00000198  AND @0000002e $00000031
+000001a1  AND @00000031 $00000034
+000001aa  AND @00000034 $00000037
+000001b3  AND @00000037 $0000003a
+000001bc  AND @0000003a $0000003d
+000001c5  AND @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff01070000000000000000000000010a000000ffffffffffffffff
+010d000000ffffffffffffffff011000000000000000000000000113000000ffffffffffffffff0116000000ffffffffffffffff
+01190000000000000000000000011c000000ffffffffffffffff011f000000ffffffffffffffff01220000000000000000000000
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b0000000000000000000000012e000000ffffffffffffffff
+0131000000ffffffffffffffff013400000000000000000000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d00000000000000000000000b01000000040000000b04000000070000000b070000000a0000000b0a0000000d0000000b0d00
+0000100000000b10000000130000000b13000000160000000b16000000190000000b190000001c0000000b1c0000001f0000000b
+1f000000220000000b22000000250000000b25000000280000000b280000002b0000000b2b0000002e0000000b2e000000310000
+000b31000000340000000b34000000370000000b370000003a0000000b3a0000003d0000000b3d0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #00000000ffffffff
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #00000000ffffffff
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #00000000ffffffff
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #efcdab8967452301
+00000111  AND @00000001 $00000004
+0000011a  AND @00000004 $00000007
+00000123  AND @00000007 $0000000a
+0000012c  AND @0000000a $0000000d
+00000135  AND @0000000d $00000010
+0000013e  AND @00000010 $00000013
+00000147  AND @00000013 $00000016
+00000150  AND @00000016 $00000019
+00000159  AND @00000019 $0000001c
+00000162  AND @0000001c $0000001f
+0000016b  AND @0000001f $00000022
+00000174  AND @00000022 $00000025
+0000017d  AND @00000025 $00000028
+00000186  AND @00000028 $0000002b
+0000018f  AND @0000002b $0000002e
+00000198  AND @0000002e $00000031
+000001a1  AND @00000031 $00000034
+000001aa  AND @00000034 $00000037
+000001b3  AND @00000037 $0000003a
+000001bc  AND @0000003a $0000003d
+000001c5  AND @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef0104000000ffffffffffffffff01070000000123456789abcdef010a000000ffffffff00000000
+010d0000000123456789abcdef0110000000000000000000000001130000000123456789abcdef0116000000ffffffffffffffff
+01190000000123456789abcdef011c000000ffffffff00000000011f0000000123456789abcdef01220000000000000000000000
+01250000000123456789abcdef0128000000ffffffffffffffff012b0000000123456789abcdef012e000000ffffffff00000000
+01310000000123456789abcdef0134000000000000000000000001370000000123456789abcdef013a000000ffffffffffffffff
+013d0000000123456789abcdef0b01000000040000000b04000000070000000b070000000a0000000b0a0000000d0000000b0d00
+0000100000000b10000000130000000b13000000160000000b16000000190000000b190000001c0000000b1c0000001f0000000b
+1f000000220000000b22000000250000000b25000000280000000b280000002b0000000b2b0000002e0000000b2e000000310000
+000b31000000340000000b34000000370000000b370000003a0000000b3a0000003d0000000b3d0000003d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 01 23 45 67 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 01 23 45 67 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 01 23 45 67 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 01 23 45 67 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 01 23 45 67 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 01 23 45 67 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #9999999999999999
+0000000d  SET @00000001 #8888888888888888
+0000001a  SET @00000002 #88888888ffffffff
+00000027  SET @00000010 #7777777777777777
+00000034  SET @00000011 #5555555555555555
+00000041  SET @00000012 #55555555ffffffff
+0000004e  SET @00000020 #6666666666666666
+0000005b  SET @00000021 #4444444444444444
+00000068  SET @00000022 #44444444ffffffff
+00000075  SET @00000030 #3333333333333333
+00000082  SET @00000031 #1111111111111111
+0000008f  SET @00000032 #11111111ffffffff
+0000009c  AND @00000000 $00000001
+000000a5  AND @00000000 $00000001
+000000ae  AND @00000010 $00000011
+000000b7  AND @00000010 $00000011
+000000c0  AND @00000010 $00000011
+000000c9  AND @00000020 $00000021
+000000d2  AND @00000020 $00000021
+000000db  AND @00000020 $00000021
+000000e4  AND @00000020 $00000021
+000000ed  AND @00000030 $00000031
+000000f6  AND @00000030 $00000031
+000000ff  AND @00000030 $00000031
+00000108  AND @00000030 $00000031
+00000111  AND @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000009999999999999999010100000088888888888888880102000000ffffffff8888888801100000007777777777777777
+011100000055555555555555550112000000ffffffff555555550120000000666666666666666601210000004444444444444444
+0122000000ffffffff4444444401300000003333333333333333013100000011111111111111110132000000ffffffff11111111
+0b00000000010000000b00000000010000000b10000000110000000b10000000110000000b10000000110000000b200000002100
+00000b20000000210000000b20000000210000000b20000000210000000b30000000310000000b30000000310000000b30000000
+310000000b30000000310000000b300000003100000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 
+00000010 ff ff ff ff 88 88 88 88 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 
+00000090 ff ff ff ff 55 55 55 55 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 
+00000110 ff ff ff ff 44 44 44 44 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 
+00000190 ff ff ff ff 11 11 11 11 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #00000000ffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  AND @0000003e $0000003f
+00000023  AND @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffff00000000013f000000ffffffffffffffff0b3e0000003f0000000b3f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 ff ff ff ff 00 00 00 00 ff ff ff ff ff ff ff ff   
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* AND @ffffffff $ffffffff
+00000009  FIN
+
+Machine Code (Test 6):
+----------------------
+
+0bffffffffffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_beq_dat.html b/docs/at_test_beq_dat.html new file mode 100644 index 0000000..f4eec81 --- /dev/null +++ b/docs/at_test_beq_dat.html @@ -0,0 +1,231 @@ + + + + +CIYAM AT - Test for AT instruction code 0x23 (BEQ_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x23 (BEQ_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Branch forwards and backwords.
+Test 3 - Branch to an out of range address.
+Test 4 - Branch to an invalid address.
+Test 5 - Infinite loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BEQ $00000000 $00000001 :00000031
+00000024  SET @00000002 #dddddddddddddddd
+00000031  DEC @00000000
+00000036  BEQ $00000000 $00000001 :0000004d
+00000040  SET @00000003 #eeeeeeeeeeeeeeee
+0000004d  INC @00000000
+00000052  INC @00000000
+00000057  BEQ $00000000 $00000001 :0000006e
+00000061  SET @00000004 #ffffffffffffffff
+0000006e  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000030000000000000001010000000300000000000000230000000001000000170102000000dddddddddddddddd050000
+0000230000000001000000170103000000eeeeeeeeeeeeeeee04000000000400000000230000000001000000170104000000ffff
+ffffffffffff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 04 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 ee ee ee ee ee ee ee ee 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BEQ $00000000 $00000001 :00000032
+00000024  SET @00000002 #dddddddddddddddd
+00000031  FIN
+00000032  DEC @00000000
+00000037  DEC @00000001
+0000003c  BEQ $00000000 $00000001 :00000024
+00000046  SET @00000004 #ffffffffffffffff
+00000053  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000030000000000000001010000000300000000000000230000000001000000180102000000dddddddddddddddd280500
+0000000501000000230000000001000000e80104000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 
+00000010 dd dd dd dd dd dd dd dd 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BEQ $00000000 $00000001 :00000040
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000030000000000000001010000000300000000000000230000000001000000260102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BEQ $00000000 $00000001 :0000002a
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000030000000000000001010000000300000000000000230000000001000000100102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BEQ $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000000
+00000036  INC @00000001
+0000003b  BEQ $00000000 $00000001 :00000024
+00000045  SET @00000003 #ffffffffffffffff
+00000052  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000030000000000000001010000000300000000000000230000000001000000170102000000eeeeeeeeeeeeeeee040000
+00000401000000230000000001000000e90103000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_bge_dat.html b/docs/at_test_bge_dat.html new file mode 100644 index 0000000..3a617f9 --- /dev/null +++ b/docs/at_test_bge_dat.html @@ -0,0 +1,228 @@ + + + + +CIYAM AT - Test for AT instruction code 0x21 (BGE_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x21 (BGE_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Jump forwards and backwords.
+Test 3 - Jump to an out of range address.
+Test 4 - Jump to an invalid address.
+Test 5 - Infinite loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  BGE $00000000 $00000001 :00000031
+00000024  SET @00000002 #dddddddddddddddd
+00000031  DEC @00000000
+00000036  BGE $00000000 $00000001 :0000004d
+00000040  SET @00000003 #eeeeeeeeeeeeeeee
+0000004d  DEC @00000000
+00000052  BGE $00000000 $00000001 :00000069
+0000005c  SET @00000004 #ffffffffffffffff
+00000069  FINN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000040000000000000001010000000300000000000000210000000001000000170102000000dddddddddddddddd050000
+0000210000000001000000170103000000eeeeeeeeeeeeeeee0500000000210000000001000000170104000000ffffffffffffff
+ff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 02 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00  
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  BGE $00000000 $00000001 :00000032
+00000024  SET @00000002 #dddddddddddddddd
+00000031  FIN
+00000032  DEC @00000000
+00000037  BGE $00000000 $00000001 :00000024
+00000041  SET @00000004 #ffffffffffffffff
+0000004e  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000040000000000000001010000000300000000000000210000000001000000180102000000dddddddddddddddd280500
+000000210000000001000000ed0104000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 03 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 dd dd dd dd dd dd dd dd 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BGE $00000000 $00000001 :00000040
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000030000000000000001010000000300000000000000210000000001000000260102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BGE $00000000 $00000001 :0000002a
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000020000000000000001010000000100000000000000210000000001000000100102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BGE $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000000
+00000036  BGE $00000000 $00000001 :00000024
+00000040  SET @00000003 #ffffffffffffffff
+0000004d  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000030000000000000001010000000300000000000000210000000001000000170102000000eeeeeeeeeeeeeeee040000
+0000210000000001000000ee0103000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_bgt_dat.html b/docs/at_test_bgt_dat.html new file mode 100644 index 0000000..5691b11 --- /dev/null +++ b/docs/at_test_bgt_dat.html @@ -0,0 +1,227 @@ + + + + +CIYAM AT - Test for AT instruction code 0x1f (BGT_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x1f (BGT_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Jump forwards and backwords.
+Test 3 - Jump to out range address.
+Test 4 - Jump to not valid address point.
+Test 5 - Infinite loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BGT $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  DEC @00000000
+00000036  DEC @00000000
+0000003b  BGT $00000000 $00000001 :00000052
+00000045  SET @00000003 #ffffffffffffffff
+00000052  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000200000000000000010100000001000000000000001f0000000001000000170102000000eeeeeeeeeeeeeeee050000
+000005000000001f0000000001000000170103000000ffffffffffffffff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BGT $00000000 $00000001 :00000032
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  FIN
+00000032  INC @00000001
+00000037  INC @00000001
+0000003c  BGT $00000001 $00000000 :00000024
+00000046  SET @00000003 #ffffffffffffffff
+00000053  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000000200000000000000010100000001000000000000001f0000000001000000180102000000eeeeeeeeeeeeeeee280401
+00000004010000001f0100000000000000e80103000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 02 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 ee ee ee ee ee ee ee ee 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BGT $00000000 $00000001 :00000040
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01000000000200000000000000010100000001000000000000001f0000000001000000260102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BGT $00000000 $00000001 :0000001d
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000000200000000000000010100000001000000000000001f0000000001000000030102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BGT $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000001
+00000036  INC @00000001
+0000003b  BGT $00000001 $00000000 :00000024
+00000045  SET @00000003 #ffffffffffffffff
+00000052  FIN
+
+Machine Code (Test 5):
+----------------------
+
+01000000000200000000000000010100000001000000000000001f0000000001000000170102000000eeeeeeeeeeeeeeee040100
+000004010000001f0100000000000000e90103000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ble_dat.html b/docs/at_test_ble_dat.html new file mode 100644 index 0000000..82e54e5 --- /dev/null +++ b/docs/at_test_ble_dat.html @@ -0,0 +1,259 @@ + + + + +CIYAM AT - Test for AT instruction code 0x22 (BLE_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x22 (BLE_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Jump forwards and backwords.
+Test 3 - Jump to an out of range address.
+Test 4 - Jump to an invalid address.
+Test 5 - Infinite loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLE $00000000 $00000001 :00000031
+00000024  SET @00000002 #dddddddddddddddd
+00000031  DEC @00000000
+00000036  BLE $00000000 $00000001 :0000004d
+00000040  SET @00000003 #eeeeeeeeeeeeeeee
+0000004d  DEC @00000000
+00000052  BLE $00000000 $00000001 :00000069
+0000005c  SET @00000004 #ffffffffffffffff
+00000069  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000040000000000000001010000000300000000000000220000000001000000170102000000dddddddddddddddd050000
+0000220000000001000000170103000000eeeeeeeeeeeeeeee0500000000220000000001000000170104000000ffffffffffffff
+ff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 02 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 dd dd dd dd dd dd dd dd 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLE $00000000 $00000001 :00000032
+00000024  SET @00000002 #dddddddddddddddd
+00000031  FIN
+00000032  DEC @00000000
+00000037  BLE $00000000 $00000001 :00000024
+00000041  SET @00000004 #ffffffffffffffff
+0000004e  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000030000000000000001010000000300000000000000220000000001000000180102000000dddddddddddddddd280500
+000000220000000001000000ed0104000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 02 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 dd dd dd dd dd dd dd dd 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLE $00000000 $00000001 :00000040
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000030000000000000001010000000300000000000000220000000001000000260102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000001
+0000001a  BLE $00000000 $00000001 :0000002a
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000020000000000000001010000000100000000000000220000000001000000100102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Data Dump (Test 4):
+-------------------
+
+00000000  02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+00000010  ee ee ee ee ee ee ee ee ff ff ff ff ff ff ff ff
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLE $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000001
+00000036  BLE $00000000 $00000001 :00000024
+00000040  SET @00000003 #ffffffffffffffff
+0000004d  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000030000000000000001010000000300000000000000220000000001000000170102000000eeeeeeeeeeeeeeee040100
+0000220000000001000000ee0103000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_blt_dat.html b/docs/at_test_blt_dat.html new file mode 100644 index 0000000..09c9b3c --- /dev/null +++ b/docs/at_test_blt_dat.html @@ -0,0 +1,228 @@ + + + + +CIYAM AT - Test for AT instruction code 0x20 (BLT_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x20 (BLT_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Jump forwards and backwords.
+Test 3 - Jump to out range address.
+Test 4 - Jump to invalid address.
+Test 5 - Infinite loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLT $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000000
+00000036  INC @00000000
+0000003b  BLT $00000000 $00000001 :00000052
+00000045  SET @00000003 #ffffffffffffffff
+00000052  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000020000000000000001010000000300000000000000200000000001000000170102000000eeeeeeeeeeeeeeee040000
+00000400000000200000000001000000170103000000ffffffffffffffff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 04 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLT $00000000 $00000001 :00000032
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  FIN
+00000032  DEC @00000001
+00000037  BLT $00000001 $00000000 :00000024
+00000041  DEC @00000001
+00000046  BLT $00000001 $00000000 :00000024
+00000050  SET @00000003 #ffffffffffffffff
+0000005d  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000020000000000000001010000000300000000000000200000000001000000180102000000eeeeeeeeeeeeeeee280501
+000000200100000000000000ed0501000000200100000000000000de0103000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 ee ee ee ee ee ee ee ee 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLT $00000000 $00000001 :00000040
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000020000000000000001010000000300000000000000200000000001000000260102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLT $00000000 $00000001 :0000002a
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000020000000000000001010000000300000000000000200000000001000000100102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BLT $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000001
+00000036  INC @00000001
+0000003b  BLT $00000000 $00000001 :00000024
+00000045  SET @00000003 #ffffffffffffffff
+00000052  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000020000000000000001010000000300000000000000200000000001000000170102000000eeeeeeeeeeeeeeee040100
+00000401000000200000000001000000e90103000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_bne_dat.html b/docs/at_test_bne_dat.html new file mode 100644 index 0000000..2587f8c --- /dev/null +++ b/docs/at_test_bne_dat.html @@ -0,0 +1,231 @@ + + + + +CIYAM AT - Test for AT instruction code 0x24 (BNE_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x24 (BNE_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Branch forwards and backwords.
+Test 3 - Branch to out of range address.
+Test 4 - Branch to invalid address.
+Test 5 - Infinite loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BNE $00000000 $00000001 :00000031
+00000024  SET @00000002 #dddddddddddddddd
+00000031  DEC @00000000
+00000036  BNE $00000000 $00000001 :0000004d
+00000040  SET @00000003 #eeeeeeeeeeeeeeee
+0000004d  INC @00000000
+00000052  INC @00000000
+00000057  BNE $00000000 $00000001 :0000006e
+00000061  SET @00000004 #ffffffffffffffff
+0000006e  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000020000000000000001010000000300000000000000240000000001000000170102000000dddddddddddddddd050000
+0000240000000001000000170103000000eeeeeeeeeeeeeeee04000000000400000000240000000001000000170104000000ffff
+ffffffffffff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 03 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000002
+0000000d  SET @00000001 #0000000000000003
+0000001a  BNE $00000000 $00000001 :00000032
+00000024  SET @00000002 #dddddddddddddddd
+00000031  FIN
+00000032  DEC @00000000
+00000037  DEC @00000001
+0000003c  BNE $00000000 $00000001 :00000024
+00000046  SET @00000004 #ffffffffffffffff
+00000053  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000020000000000000001010000000300000000000000240000000001000000180102000000dddddddddddddddd280500
+0000000501000000240000000001000000e80104000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 
+00000010 dd dd dd dd dd dd dd dd 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  BNE $00000000 $00000001 :00000040
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000040000000000000001010000000300000000000000240000000001000000260102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000003
+0000001a  BEQ $00000000 $00000001 :0000002a
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  SET @00000003 #ffffffffffffffff
+0000003e  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000030000000000000001010000000500000000000000240000000001000000100102000000eeeeeeeeeeeeeeee010300
+0000ffffffffffffffff28
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000003
+0000000d  SET @00000001 #0000000000000004
+0000001a  BNE $00000000 $00000001 :00000031
+00000024  SET @00000002 #eeeeeeeeeeeeeeee
+00000031  INC @00000000
+00000036  INC @00000001
+0000003b  BNE $00000000 $00000001 :00000024
+00000045  SET @00000003 #ffffffffffffffff
+00000052  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000030000000000000001010000000400000000000000240000000001000000170102000000eeeeeeeeeeeeeeee040000
+00000401000000240000000001000000e90103000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_bnz_dat.html b/docs/at_test_bnz_dat.html new file mode 100644 index 0000000..a4bf8f8 --- /dev/null +++ b/docs/at_test_bnz_dat.html @@ -0,0 +1,226 @@ + + + + +CIYAM AT - Test for AT instruction code 0x1e (BNZ_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x1e (BNZ_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Jump forwards and backwords.
+Test 3 - Jump to out range address
+Test 4 - Jump to not valid address point
+Test 5 - infinite loop
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000001
+0000000d  BNZ $00000000, :00000021
+00000013  SET @00000001 #1111111111111111
+00000020  FIN
+00000021  DEC @00000000
+00000026  BNZ $00000000, :00000039
+0000002c  SET @00000002 #ffffffffffffffff
+00000039  FIN
+
+Machine Code (Test 1):
+----------------------
+
+010000000001000000000000001e0000000014010100000011111111111111112805000000001e00000000130102000000ffffff
+ffffffffff28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000001
+0000000d  BNZ $00000000, :00000021
+00000013  SET @00000001 #1111111111111111
+00000020  FIN
+00000021  SET @0000003f #ffffffffffffffff
+0000002e  BNZ $0000003f, :00000013
+00000034  SET @00000002 #ffffffffffffffff
+00000041  FIN
+
+Machine Code (Test 2):
+----------------------
+
+010000000001000000000000001e00000000140101000000111111111111111128013f000000ffffffffffffffff1e3f000000e5
+0102000000ffffffffffffffff28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000001
+0000000d  BNZ $00000000, :00000023
+00000013  SET @00000001 #1111111111111111
+00000020  FIN
+00000021  SET @0000003f #ffffffffffffffff
+0000002e  BNZ $0000003f, :00000013
+00000034  SET @00000002 #ffffffffffffffff
+00000041  FIN
+
+Machine Code (Test 3):
+----------------------
+
+010000000001000000000000001e00000000160101000000111111111111111128013f000000ffffffffffffffff1e3f000000e5
+0102000000ffffffffffffffff28
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000001
+0000000d  BNZ $00000000, :00000021
+00000013  SET @00000001 #1111111111111111
+00000020  FIN
+00000021  SET @0000003f #ffffffffffffffff
+0000002e  BNZ $0000003f, :ffffffff
+00000034  SET @00000002 #ffffffffffffffff
+00000041  FIN
+
+Machine Code (Test 4):
+----------------------
+
+010000000001000000000000001e00000000140101000000111111111111111128013f000000ffffffffffffffff1e3f000000d1
+0102000000ffffffffffffffff28
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000001
+0000000d  BNZ $00000000, :00000020
+00000013  SET @00000001 #1111111111111111
+00000020  SET @0000003f #ffffffffffffffff
+0000002d  BNZ $0000003f, :00000013
+00000033  SET @00000002 #ffffffffffffffff
+00000040  FIN
+
+Machine Code (Test 5):
+----------------------
+
+010000000001000000000000001e000000001301010000001111111111111111013f000000ffffffffffffffff1e3f000000e601
+02000000ffffffffffffffff28
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_bor_dat.html b/docs/at_test_bor_dat.html new file mode 100644 index 0000000..d2f85c9 --- /dev/null +++ b/docs/at_test_bor_dat.html @@ -0,0 +1,472 @@ + + + + +CIYAM AT - Test for AT instruction code 0x0a (BOR_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x0a (BOR_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  BOR @00000000 $00000001
+000000cc  BOR @00000001 $00000002
+000000d5  BOR @00000002 $00000003
+000000de  BOR @00000003 $00000004
+000000e7  BOR @00000004 $00000005
+000000f0  BOR @00000005 $00000006
+000000f9  BOR @00000006 $00000007
+00000102  BOR @00000007 $00000008
+0000010b  BOR @00000008 $0000000a
+00000114  BOR @00000009 $0000000a
+0000011d  BOR @0000000a $0000000b
+00000126  BOR @0000000b $0000000c
+0000012f  BOR @0000000c $0000000d
+00000138  BOR @0000000d $0000000e
+00000141  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e00000001000000000000000a00000000010000000a010000
+00020000000a02000000030000000a03000000040000000a04000000050000000a05000000060000000a06000000070000000a07
+000000080000000a080000000a0000000a090000000a0000000a0a0000000b0000000a0b0000000c0000000a0c0000000d000000
+0a0d0000000e00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 0f 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000010 0d 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000020 0b 00 00 00 00 00 00 00 0b 00 00 00 00 00 00 00 
+00000030 09 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000040 07 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 
+00000050 05 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 
+00000060 03 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000070 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #0000000000000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #0000000000000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #0000000000000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #0000000000000000
+00000111  BOR @00000001 $00000004
+0000011a  BOR @00000004 $00000007
+00000123  BOR @00000007 $0000000a
+0000012c  BOR @0000000a $0000000d
+00000135  BOR @0000000d $00000010
+0000013e  BOR @00000010 $00000013
+00000147  BOR @00000013 $00000016
+00000150  BOR @00000016 $00000019
+00000159  BOR @00000019 $0000001c
+00000162  BOR @0000001c $0000001f
+0000016b  BOR @0000001f $00000022
+00000174  BOR @00000022 $00000025
+0000017d  BOR @00000025 $00000028
+00000186  BOR @00000028 $0000002b
+0000018f  BOR @0000002b $0000002e
+00000198  BOR @0000002e $00000031
+000001a1  BOR @00000031 $00000034
+000001aa  BOR @00000034 $00000037
+000001b3  BOR @00000037 $0000003a
+000001bc  BOR @0000003a $0000003d
+000001c5  BOR @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff01070000000000000000000000010a000000ffffffffffffffff
+010d000000ffffffffffffffff011000000000000000000000000113000000ffffffffffffffff0116000000ffffffffffffffff
+01190000000000000000000000011c000000ffffffffffffffff011f000000ffffffffffffffff01220000000000000000000000
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b0000000000000000000000012e000000ffffffffffffffff
+0131000000ffffffffffffffff013400000000000000000000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d00000000000000000000000a01000000040000000a04000000070000000a070000000a0000000a0a0000000d0000000a0d00
+0000100000000a10000000130000000a13000000160000000a16000000190000000a190000001c0000000a1c0000001f0000000a
+1f000000220000000a22000000250000000a25000000280000000a280000002b0000000a2b0000002e0000000a2e000000310000
+000a31000000340000000a34000000370000000a370000003a0000000a3a0000003d0000000a3d0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #0000000000000000
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #ffffffffffffffff
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #0000000000000000
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #0000000000000000
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #ffffffffffffffff
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #0000000000000000
+00000104  SET @0000003d #efcdab8967452301
+00000111  BOR @00000001 $00000004
+0000011a  BOR @00000004 $00000007
+00000123  BOR @00000007 $0000000a
+0000012c  BOR @0000000a $0000000d
+00000135  BOR @0000000d $00000010
+0000013e  BOR @00000010 $00000013
+00000147  BOR @00000013 $00000016
+00000150  BOR @00000016 $00000019
+00000159  BOR @00000019 $0000001c
+00000162  BOR @0000001c $0000001f
+0000016b  BOR @0000001f $00000022
+00000174  BOR @00000022 $00000025
+0000017d  BOR @00000025 $00000028
+00000186  BOR @00000028 $0000002b
+0000018f  BOR @0000002b $0000002e
+00000198  BOR @0000002e $00000031
+000001a1  BOR @00000031 $00000034
+000001aa  BOR @00000034 $00000037
+000001b3  BOR @00000037 $0000003a
+000001bc  BOR @0000003a $0000003d
+000001c5  BOR @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef0104000000ffffffffffffffff01070000000123456789abcdef010a0000000000000000000000
+010d0000000123456789abcdef0110000000ffffffffffffffff01130000000123456789abcdef01160000000000000000000000
+01190000000123456789abcdef011c000000ffffffffffffffff011f0000000123456789abcdef01220000000000000000000000
+01250000000123456789abcdef0128000000ffffffffffffffff012b0000000123456789abcdef012e0000000000000000000000
+01310000000123456789abcdef0134000000ffffffffffffffff01370000000123456789abcdef013a0000000000000000000000
+013d0000000123456789abcdef0a01000000040000000a04000000070000000a070000000a0000000a0a0000000d0000000a0d00
+0000100000000a10000000130000000a13000000160000000a16000000190000000a190000001c0000000a1c0000001f0000000a
+1f000000220000000a22000000250000000a25000000280000000a280000002b0000000a2b0000002e0000000a2e000000310000
+000a31000000340000000a34000000370000000a370000003a0000000a3a0000003d0000000a3d0000003d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #9999999999999999
+0000000d  SET @00000001 #4444444444444444
+0000001a  SET @00000002 #ddddddddffffffff
+00000027  SET @00000010 #8888888888888888
+00000034  SET @00000011 #5555555555555555
+00000041  SET @00000012 #ddddddddffffffff
+0000004e  SET @00000020 #7777777777777777
+0000005b  SET @00000021 #8888888888888888
+00000068  SET @00000022 #ddddddddffffffff
+00000075  SET @00000030 #6666666666666666
+00000082  SET @00000031 #9999999999999999
+0000008f  SET @00000032 #ddddddddffffffff
+0000009c  BOR @00000000 $00000001
+000000a5  BOR @00000000 $00000001
+000000ae  BOR @00000010 $00000011
+000000b7  BOR @00000010 $00000011
+000000c0  BOR @00000010 $00000011
+000000c9  BOR @00000020 $00000021
+000000d2  BOR @00000020 $00000021
+000000db  BOR @00000020 $00000021
+000000e4  BOR @00000020 $00000021
+000000ed  BOR @00000030 $00000031
+000000f6  BOR @00000030 $00000031
+000000ff  BOR @00000030 $00000031
+00000108  BOR @00000030 $00000031
+00000111  BOR @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000009999999999999999010100000044444444444444440102000000ffffffffdddddddd01100000008888888888888888
+011100000055555555555555550112000000ffffffffdddddddd0120000000777777777777777701210000008888888888888888
+0122000000ffffffffdddddddd01300000006666666666666666013100000099999999999999990132000000ffffffffdddddddd
+0a00000000010000000a00000000010000000a10000000110000000a10000000110000000a10000000110000000a200000002100
+00000a20000000210000000a20000000210000000a20000000210000000a30000000310000000a30000000310000000a30000000
+310000000a30000000310000000a300000003100000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 dd dd dd dd dd dd dd dd 44 44 44 44 44 44 44 44 
+00000010 ff ff ff ff dd dd dd dd 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 dd dd dd dd dd dd dd dd 55 55 55 55 55 55 55 55 
+00000090 ff ff ff ff dd dd dd dd 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 ff ff ff ff ff ff ff ff 88 88 88 88 88 88 88 88 
+00000110 ff ff ff ff dd dd dd dd 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 ff ff ff ff ff ff ff ff 99 99 99 99 99 99 99 99 
+00000190 ff ff ff ff dd dd dd dd 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #00000000ffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  BOR @0000003e $0000003f
+00000023  BOR @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffff00000000013f000000ffffffffffffffff0a3e0000003f0000000a3f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* BOR @ffffffff $ffffffff
+00000009  FIN
+
+Machine Code (Test 6):
+----------------------
+
+0affffffffffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_bzr_dat.html b/docs/at_test_bzr_dat.html new file mode 100644 index 0000000..f3d32de --- /dev/null +++ b/docs/at_test_bzr_dat.html @@ -0,0 +1,221 @@ + + + + +CIYAM AT - Test for AT instruction code 0x1b (BZR_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x1b (BZR_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Jump forwards and backwords.
+Test 3 - Jump to out range address
+Test 4 - Jump to not valid address point
+Test 5 - infinite loop
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  BZR $00000000 :00000021
+00000013  SET @00000000 #1111111111111111
+00000020  FIN
+00000021  INC @00000000
+00000026  BZR $00000000 :00000013
+0000002c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+010000000000000000000000001b0000000014010000000011111111111111112804000000001b00000000ed28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  BZR $00000000 :00000021
+00000013  SET @00000000 #1111111111111111
+00000020  FIN
+00000021  INC @00000000
+00000026  DEC @00000000
+0000002b  BZR $00000000 :00000013
+00000031  FIN
+
+Machine Code (Test 2):
+----------------------
+
+010000000000000000000000001b00000000140100000000111111111111111128040000000005000000001b00000000e828
+
+Data Dump (Test 2):
+-------------------
+
+00000000 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  BZR $00000000 :00000021
+00000013  SET @00000000 #1111111111111111
+00000020  FIN
+00000021  INC @0000003f
+00000026  DEC @0000003f
+0000002b  BZR $0000003f :0000004b
+00000031  FIN
+
+Machine Code (Test 3):
+----------------------
+
+010000000000000000000000001b00000000140100000000111111111111111128043f000000053f0000001b3f0000002028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  BZR $00000000, :00000021
+00000013  SET @00000000 #1111111111111111
+00000020  FIN
+00000021  INC @0000003f
+00000026  DEC @0000003f
+0000002b  BZR $0000003f, :00000024
+00000031  FIN
+
+Machine Code (Test 4):
+----------------------
+
+010000000000000000000000001b00000000140100000000111111111111111128043f000000053f0000001b3f000000f928
+
+Runtime Error (Test 4):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  BZR $00000000 :00000021
+00000013  SET @00000000 #1111111111111111
+00000020  FIN
+00000021  INC @0000001f
+00000026  DEC @0000001f
+0000002b  BZR $0000001f :00000021
+00000031  FIN
+
+Machine Code (Test 5):
+----------------------
+
+010000000000000000000000001b00000000140100000000111111111111111128041f000000051f0000001b1f000000f628
+
+Runtime Result (Test 5):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_clr_dat.html b/docs/at_test_clr_dat.html new file mode 100644 index 0000000..ff769a6 --- /dev/null +++ b/docs/at_test_clr_dat.html @@ -0,0 +1,338 @@ + + + + +CIYAM AT - Test for AT instruction code 0x03 (CLR_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x03 (CLR_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000003 #0000000000000003
+0000001a  SET @00000006 #0000000000000006
+00000027  SET @00000009 #0000000000000009
+00000034  SET @0000000c #000000000000000c
+00000041  SET @0000000f #000000000000000f
+0000004e  SET @00000012 #0000000000000012
+0000005b  SET @00000015 #0000000000000015
+00000068  SET @00000018 #0000000000000018
+00000075  SET @0000001b #000000000000001b
+00000082  SET @0000001e #000000000000001e
+0000008f  SET @00000021 #0000000000000021
+0000009c  SET @00000024 #0000000000000024
+000000a9  SET @00000027 #0000000000000027
+000000b6  SET @0000002a #000000000000002a
+000000c3  SET @0000002d #000000000000002d
+000000d0  SET @00000030 #0000000000000030
+000000dd  SET @00000033 #0000000000000033
+000000ea  SET @00000036 #0000000000000036
+000000f7  SET @00000039 #0000000000000039
+00000104  SET @0000003c #000000000000003c
+00000111  SET @0000003f #000000000000003f
+0000011e  CLR @00000000
+00000123  CLR @00000003
+00000128  CLR @00000006
+0000012d  CLR @00000009
+00000132  CLR @0000000c
+00000137  CLR @0000000f
+0000013c  CLR @00000012
+00000141  CLR @00000015
+00000146  CLR @00000018
+0000014b  CLR @0000001b
+00000150  CLR @0000001e
+00000155  CLR @00000021
+0000015a  CLR @00000024
+0000015f  CLR @00000027
+00000164  CLR @0000002a
+00000169  CLR @0000002d
+0000016e  CLR @00000030
+00000173  CLR @00000033
+00000178  CLR @00000036
+0000017d  CLR @00000039
+00000182  CLR @0000003c
+00000187  CLR @0000003f
+0000018c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000010300000003000000000000000106000000060000000000000001090000000900000000000000
+010c0000000c00000000000000010f0000000f000000000000000112000000120000000000000001150000001500000000000000
+01180000001800000000000000011b0000001b00000000000000011e0000001e0000000000000001210000002100000000000000
+0124000000240000000000000001270000002700000000000000012a0000002a00000000000000012d0000002d00000000000000
+01300000003000000000000000013300000033000000000000000136000000360000000000000001390000003900000000000000
+013c0000003c00000000000000013f0000003f000000000000000300000000030300000003060000000309000000030c00000003
+0f000000031200000003150000000318000000031b000000031e000000032100000003240000000327000000032a000000032d00
+00000330000000033300000003360000000339000000033c000000033f00000028
+
+(data dump should be all zeros)
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #ffffffffffffffff
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #ffffffffffffffff
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #ffffffffffffffff
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #ffffffffffffffff
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #ffffffffffffffff
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #ffffffffffffffff
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #ffffffffffffffff
+00000111  CLR @00000001
+00000116  CLR @00000004
+0000011b  CLR @00000007
+00000120  CLR @0000000a
+00000125  CLR @0000000d
+0000012a  CLR @00000010
+0000012f  CLR @00000013
+00000134  CLR @00000016
+00000139  CLR @00000019
+0000013e  CLR @0000001c
+00000143  CLR @0000001f
+00000148  CLR @00000022
+0000014d  CLR @00000025
+00000152  CLR @00000028
+00000157  CLR @0000002b
+0000015c  CLR @0000002e
+00000161  CLR @00000031
+00000166  CLR @00000034
+0000016b  CLR @00000037
+00000170  CLR @0000003a
+00000175  CLR @0000003d
+0000017a  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff0107000000ffffffffffffffff010a000000ffffffffffffffff
+010d000000ffffffffffffffff0110000000ffffffffffffffff0113000000ffffffffffffffff0116000000ffffffffffffffff
+0119000000ffffffffffffffff011c000000ffffffffffffffff011f000000ffffffffffffffff0122000000ffffffffffffffff
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b000000ffffffffffffffff012e000000ffffffffffffffff
+0131000000ffffffffffffffff0134000000ffffffffffffffff0137000000ffffffffffffffff013a000000ffffffffffffffff
+013d000000ffffffffffffffff030100000003040000000307000000030a000000030d0000000310000000031300000003160000
+000319000000031c000000031f000000032200000003250000000328000000032b000000032e0000000331000000033400000003
+37000000033a000000033d00000028
+
+(data dump should be all zeros)
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000002 #efcdab8967452301
+0000000d  SET @00000005 #efcdab8967452301
+0000001a  SET @00000008 #efcdab8967452301
+00000027  SET @0000000b #efcdab8967452301
+00000034  SET @0000000e #efcdab8967452301
+00000041  SET @00000011 #efcdab8967452301
+0000004e  SET @00000014 #efcdab8967452301
+0000005b  SET @00000017 #efcdab8967452301
+00000068  SET @0000001a #efcdab8967452301
+00000075  SET @0000001d #efcdab8967452301
+00000082  SET @00000020 #efcdab8967452301
+0000008f  SET @00000023 #efcdab8967452301
+0000009c  SET @00000026 #efcdab8967452301
+000000a9  SET @00000029 #efcdab8967452301
+000000b6  SET @0000002c #efcdab8967452301
+000000c3  SET @0000002f #efcdab8967452301
+000000d0  SET @00000032 #efcdab8967452301
+000000dd  SET @00000035 #efcdab8967452301
+000000ea  SET @00000038 #efcdab8967452301
+000000f7  SET @0000003b #efcdab8967452301
+00000104  SET @0000003e #efcdab8967452301
+00000111  CLR @00000002
+00000116  CLR @00000005
+0000011b  CLR @00000008
+00000120  CLR @0000000b
+00000125  CLR @0000000e
+0000012a  CLR @00000011
+0000012f  CLR @00000014
+00000134  CLR @00000017
+00000139  CLR @0000001a
+0000013e  CLR @0000001d
+00000143  CLR @00000020
+00000148  CLR @00000023
+0000014d  CLR @00000026
+00000152  CLR @00000029
+00000157  CLR @0000002c
+0000015c  CLR @0000002f
+00000161  CLR @00000032
+00000166  CLR @00000035
+0000016b  CLR @00000038
+00000170  CLR @0000003b
+00000175  CLR @0000003e
+0000017a  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01020000000123456789abcdef01050000000123456789abcdef01080000000123456789abcdef010b0000000123456789abcdef
+010e0000000123456789abcdef01110000000123456789abcdef01140000000123456789abcdef01170000000123456789abcdef
+011a0000000123456789abcdef011d0000000123456789abcdef01200000000123456789abcdef01230000000123456789abcdef
+01260000000123456789abcdef01290000000123456789abcdef012c0000000123456789abcdef012f0000000123456789abcdef
+01320000000123456789abcdef01350000000123456789abcdef01380000000123456789abcdef013b0000000123456789abcdef
+013e0000000123456789abcdef030200000003050000000308000000030b000000030e0000000311000000031400000003170000
+00031a000000031d0000000320000000032300000003260000000329000000032c000000032f0000000332000000033500000003
+38000000033b000000033e00000028
+
+(data dump should be all zeros)
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000002 #0000000000000000
+0000000d  SET @00000003 #ffffffffffffffff
+0000001a  SET @00000004 #1111111111111111
+00000027  SET @00000011 #5555555555555555
+00000034  SET @00000014 #8888888888888888
+00000041  SET @00000017 #4444444444444444
+0000004e  SET @00000022 #2222222222222222
+0000005b  SET @00000023 #7777777777777777
+00000068  SET @00000024 #3333333333333333
+00000075  CLR @00000003
+0000007a  CLR @00000003
+0000007f  CLR @00000003
+00000084  CLR @00000011
+00000089  CLR @00000011
+0000008e  CLR @00000017
+00000093  CLR @00000017
+00000098  CLR @00000023
+0000009d  CLR @00000023
+000000a2  CLR @00000023
+000000a7  FIN
+
+Machine Code (Test 4):
+----------------------
+
+010200000000000000000000000103000000ffffffffffffffff0104000000111111111111111101110000005555555555555555
+01140000008888888888888888011700000044444444444444440122000000222222222222222201230000007777777777777777
+01240000003333333333333333030300000003030000000303000000031100000003110000000317000000031700000003230000
+000323000000032300000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  88 88 88 88 88 88 88 88 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  22 22 22 22 22 22 22 22 00 00 00 00 00 00 00 00
+00000120  33 33 33 33 33 33 33 33 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #ffffffffffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  CLR @0000003f
+0000001f  CLR @00000040
+00000024  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffffffffffff013f000000ffffffffffffffff033f000000034000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* CLR @ffffffff
+00000005  FIN
+
+Machine Code (Test 6):
+----------------------
+
+03ffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_dec_dat.html b/docs/at_test_dec_dat.html new file mode 100644 index 0000000..2474663 --- /dev/null +++ b/docs/at_test_dec_dat.html @@ -0,0 +1,493 @@ + + + + +CIYAM AT - Test for AT instruction code 0x05 (DEC_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x05 (DEC_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check lowest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000000000001
+0000001a  SET @00000002 #0000000000000002
+00000027  SET @00000003 #0000000000000003
+00000034  SET @00000004 #0000000000000004
+00000041  SET @00000005 #0000000000000005
+0000004e  SET @00000006 #0000000000000006
+0000005b  SET @00000007 #0000000000000007
+00000068  SET @00000008 #0000000000000008
+00000075  SET @00000009 #0000000000000009
+00000082  SET @0000000a #000000000000000a
+0000008f  SET @0000000b #000000000000000b
+0000009c  SET @0000000c #000000000000000c
+000000a9  SET @0000000d #000000000000000d
+000000b6  SET @0000000e #000000000000000e
+000000c3  SET @0000000f #000000000000000f
+000000d0  SET @00000010 #0000000000000010
+000000dd  SET @00000011 #0000000000000011
+000000ea  SET @00000012 #0000000000000012
+000000f7  SET @00000013 #0000000000000013
+00000104  SET @00000014 #0000000000000014
+00000111  SET @00000015 #0000000000000015
+0000011e  DEC @00000000
+00000123  DEC @00000001
+00000128  DEC @00000002
+0000012d  DEC @00000003
+00000132  DEC @00000004
+00000137  DEC @00000005
+0000013c  DEC @00000006
+00000141  DEC @00000007
+00000146  DEC @00000008
+0000014b  DEC @00000009
+00000150  DEC @0000000a
+00000155  DEC @0000000b
+0000015a  DEC @0000000c
+0000015f  DEC @0000000d
+00000164  DEC @0000000e
+00000169  DEC @0000000f
+0000016e  DEC @00000010
+00000173  DEC @00000011
+00000178  DEC @00000012
+0000017d  DEC @00000013
+00000182  DEC @00000014
+00000187  DEC @00000015
+0000018c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000010100000001000000000000000102000000020000000000000001030000000300000000000000
+01040000000400000000000000010500000005000000000000000106000000060000000000000001070000000700000000000000
+0108000000080000000000000001090000000900000000000000010a0000000a00000000000000010b0000000b00000000000000
+010c0000000c00000000000000010d0000000d00000000000000010e0000000e00000000000000010f0000000f00000000000000
+01100000001000000000000000011100000011000000000000000112000000120000000000000001130000001300000000000000
+01140000001400000000000000011500000015000000000000000500000000050100000005020000000503000000050400000005
+050000000506000000050700000005080000000509000000050a000000050b000000050c000000050d000000050e000000050f00
+000005100000000511000000051200000005130000000514000000051500000028
+
+
+Data Dump (Test 1):
+-------------------
+
+00000000 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000010 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 
+00000020 03 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 
+00000030 05 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 
+00000040 07 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 
+00000050 09 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 
+00000060 0b 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 
+00000070 0d 00 00 00 00 00 00 00 0e 00 00 00 00 00 00 00 
+00000080 0f 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 
+00000090 11 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 
+000000a0 13 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #000000000000000e
+0000000d  SET @00000004 #0000000000000000
+0000001a  SET @00000007 #000000000000000e
+00000027  SET @0000000a #0000000000000000
+00000034  SET @0000000d #000000000000000e
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #000000000000000e
+0000005b  SET @00000016 #0000000000000000
+00000068  SET @00000019 #000000000000000e
+00000075  SET @0000001c #0000000000000000
+00000082  SET @0000001f #000000000000000e
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #000000000000000e
+000000a9  SET @00000028 #0000000000000000
+000000b6  SET @0000002b #000000000000000e
+000000c3  SET @0000002e #0000000000000000
+000000d0  SET @00000031 #000000000000000e
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #000000000000000e
+000000f7  SET @0000003a #0000000000000000
+00000104  SET @0000003d #000000000000000e
+00000111  DEC @00000001
+00000116  DEC @00000004
+0000011b  DEC @00000007
+00000120  DEC @0000000a
+00000125  DEC @0000000d
+0000012a  DEC @00000010
+0000012f  DEC @00000013
+00000134  DEC @00000016
+00000139  DEC @00000019
+0000013e  DEC @0000001c
+00000143  DEC @0000001f
+00000148  DEC @00000022
+0000014d  DEC @00000025
+00000152  DEC @00000028
+00000157  DEC @0000002b
+0000015c  DEC @0000002e
+00000161  DEC @00000031
+00000166  DEC @00000034
+0000016b  DEC @00000037
+00000170  DEC @0000003a
+00000175  DEC @0000003d
+0000017a  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01010000000e000000000000000104000000000000000000000001070000000e00000000000000010a0000000000000000000000
+010d0000000e000000000000000110000000000000000000000001130000000e0000000000000001160000000000000000000000
+01190000000e00000000000000011c0000000000000000000000011f0000000e0000000000000001220000000000000000000000
+01250000000e0000000000000001280000000000000000000000012b0000000e00000000000000012e0000000000000000000000
+01310000000e000000000000000134000000000000000000000001370000000e00000000000000013a0000000000000000000000
+013d0000000e00000000000000050100000005040000000507000000050a000000050d0000000510000000051300000005160000
+000519000000051c000000051f000000052200000005250000000528000000052b000000052e0000000531000000053400000005
+37000000053a000000053d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000030 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000060 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000090 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+000000c0 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+000000f0 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000120 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000150 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000180 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+000001b0 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+000001e0 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #efcdab8967452301
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #efcdab8967452301
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #efcdab8967452301
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #efcdab8967452301
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #efcdab8967452301
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #efcdab8967452301
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #efcdab8967452301
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #efcdab8967452301
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #efcdab8967452301
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #efcdab8967452301
+00000104  SET @0000003d #efcdab8967452301
+00000111  DEC @00000001
+00000116  DEC @00000004
+0000011b  DEC @00000007
+00000120  DEC @0000000a
+00000125  DEC @0000000d
+0000012a  DEC @00000010
+0000012f  DEC @00000013
+00000134  DEC @00000016
+00000139  DEC @00000019
+0000013e  DEC @0000001c
+00000143  DEC @0000001f
+00000148  DEC @00000022
+0000014d  DEC @00000025
+00000152  DEC @00000028
+00000157  DEC @0000002b
+0000015c  DEC @0000002e
+00000161  DEC @00000031
+00000166  DEC @00000034
+0000016b  DEC @00000037
+00000170  DEC @0000003a
+00000175  DEC @0000003d
+0000017a  FIN
+
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef01040000000123456789abcdef01070000000123456789abcdef010a0000000123456789abcdef
+010d0000000123456789abcdef01100000000123456789abcdef01130000000123456789abcdef01160000000123456789abcdef
+01190000000123456789abcdef011c0000000123456789abcdef011f0000000123456789abcdef01220000000123456789abcdef
+01250000000123456789abcdef01280000000123456789abcdef012b0000000123456789abcdef012e0000000123456789abcdef
+01310000000123456789abcdef01340000000123456789abcdef01370000000123456789abcdef013a0000000123456789abcdef
+013d0000000123456789abcdef050100000005040000000507000000050a000000050d0000000510000000051300000005160000
+000519000000051c000000051f000000052200000005250000000528000000052b000000052e0000000531000000053400000005
+37000000053a000000053d00000028
+
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+00000030 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+00000060 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+00000090 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+000000c0 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+000000f0 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+00000120 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+00000150 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+00000180 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+000001b0 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0 00 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00
+000001e0 00 00 00 00 00 00 00 00 00 23 45 67 89 ab cd ef
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000001 #0000000000000002
+0000001a  SET @00000002 #ffffffffffffffff
+00000027  SET @00000010 #ffffffffffffffff
+00000034  SET @00000011 #0000000000000003
+00000041  SET @00000012 #ffffffffffffffff
+0000004e  SET @00000020 #ffffffffffffffff
+0000005b  SET @00000021 #0000000000000004
+00000068  SET @00000022 #ffffffffffffffff
+00000075  SET @00000030 #ffffffffffffffff
+00000082  SET @00000031 #0000000000000005
+0000008f  SET @00000032 #ffffffffffffffff
+0000009c  DEC @00000001
+000000a1  DEC @00000001
+000000a6  DEC @00000011
+000000ab  DEC @00000011
+000000b0  DEC @00000011
+000000b5  DEC @00000021
+000000ba  DEC @00000021
+000000bf  DEC @00000021
+000000c4  DEC @00000021
+000000c9  DEC @00000031
+000000ce  DEC @00000031
+000000d3  DEC @00000031
+000000d8  DEC @00000031
+000000dd  DEC @00000031
+000000e2  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000ffffffffffffffff010100000002000000000000000102000000ffffffffffffffff0110000000ffffffffffffffff
+011100000003000000000000000112000000ffffffffffffffff0120000000ffffffffffffffff01210000000400000000000000
+0122000000ffffffffffffffff0130000000ffffffffffffffff013100000005000000000000000132000000ffffffffffffffff
+05010000000501000000051100000005110000000511000000052100000005210000000521000000052100000005310000000531
+00000005310000000531000000053100000028
+
+
+Data Dump (Test 4):
+-------------------
+
+00000000 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000010 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000090 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+00000190 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003d #fffffffffffffffe
+0000000d  SET @0000003e #0000000000000000
+0000001a  SET @0000003f #fffffffffffffffe
+00000027  DEC @0000003d
+0000002c  DEC @0000003e
+00000031  DEC @0000003f
+00000036  DEC @00000040
+0000003b  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013d000000feffffffffffffff013e0000000000000000000000013f000000feffffffffffffff053d000000053e000000053f00
+0000054000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0 00 00 00 00 00 00 00 00 fd ff ff ff ff ff ff ff
+000001f0 ff ff ff ff ff ff ff ff fd ff ff ff ff ff ff ff
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* DEC @ffffffff
+00000005  FIN
+
+Machine Code (Test 6):
+----------------------
+
+05ffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_div_dat.html b/docs/at_test_div_dat.html new file mode 100644 index 0000000..4dc312b --- /dev/null +++ b/docs/at_test_div_dat.html @@ -0,0 +1,491 @@ + + + + +CIYAM AT - Test for AT instruction code 0x09 (DIV_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x09 (DIV_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check divided by zero fails.
+Test 7 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  DIV @00000000 $00000001
+000000cc  DIV @00000001 $00000002
+000000d5  DIV @00000002 $00000003
+000000de  DIV @00000003 $00000004
+000000e7  DIV @00000004 $00000005
+000000f0  DIV @00000005 $00000006
+000000f9  DIV @00000006 $00000007
+00000102  DIV @00000007 $00000008
+0000010b  DIV @00000008 $00000009
+00000114  DIV @00000009 $0000000a
+0000011d  DIV @0000000a $0000000b
+00000126  DIV @0000000b $0000000c
+0000012f  DIV @0000000c $0000000d
+00000138  DIV @0000000d $0000000e
+00000141  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e000000010000000000000009000000000100000009010000
+00020000000902000000030000000903000000040000000904000000050000000905000000060000000906000000070000000907
+0000000800000009080000000900000009090000000a000000090a0000000b000000090b0000000c000000090c0000000d000000
+090d0000000e00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000020 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000030 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000040 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000060 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 
+00000070 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #0000000100000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #0000000100000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #0000000100000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #0000000100000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #0000000100000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #0000000100000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #0000000100000000
+00000111  DIV @00000001 $00000004
+0000011a  DIV @00000004 $00000007
+00000123  DIV @00000007 $0000000a
+0000012c  DIV @0000000a $0000000d
+00000135  DIV @0000000d $00000010
+0000013e  DIV @00000010 $00000013
+00000147  DIV @00000013 $00000016
+00000150  DIV @00000016 $00000019
+00000159  DIV @00000019 $0000001c
+00000162  DIV @0000001c $0000001f
+0000016b  DIV @0000001f $00000022
+00000174  DIV @00000022 $00000025
+0000017d  DIV @00000025 $00000028
+00000186  DIV @00000028 $0000002b
+0000018f  DIV @0000002b $0000002e
+00000198  DIV @0000002e $00000031
+000001a1  DIV @00000031 $00000034
+000001aa  DIV @00000034 $00000037
+000001b3  DIV @00000037 $0000003a
+000001bc  DIV @0000003a $0000003d
+000001c5  DIV @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff01070000000000000001000000010a000000ffffffffffffffff
+010d000000ffffffffffffffff011000000000000000010000000113000000ffffffffffffffff0116000000ffffffffffffffff
+01190000000000000001000000011c000000ffffffffffffffff011f000000ffffffffffffffff01220000000000000001000000
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b0000000000000001000000012e000000ffffffffffffffff
+0131000000ffffffffffffffff013400000000000000010000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d000000000000000100000009010000000400000009040000000700000009070000000a000000090a0000000d000000090d00
+00001000000009100000001300000009130000001600000009160000001900000009190000001c000000091c0000001f00000009
+1f0000002200000009220000002500000009250000002800000009280000002b000000092b0000002e000000092e000000310000
+0009310000003400000009340000003700000009370000003a000000093a0000003d000000093d0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #0000000100000000
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #0000000100000000
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #0000000100000000
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #0000000100000000
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #0000000100000000
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #0000000100000000
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #0000000100000000
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #0000000100000000
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #0000000100000000
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #0000000100000000
+00000104  SET @0000003d #efcdab8967452301
+00000111  DIV @00000001 $00000004
+0000011a  DIV @00000004 $00000007
+00000123  DIV @00000007 $0000000a
+0000012c  DIV @0000000a $0000000d
+00000135  DIV @0000000d $00000010
+0000013e  DIV @00000010 $00000013
+00000147  DIV @00000013 $00000016
+00000150  DIV @00000016 $00000019
+00000159  DIV @00000019 $0000001c
+00000162  DIV @0000001c $0000001f
+0000016b  DIV @0000001f $00000022
+00000174  DIV @00000022 $00000025
+0000017d  DIV @00000025 $00000028
+00000186  DIV @00000028 $0000002b
+0000018f  DIV @0000002b $0000002e
+00000198  DIV @0000002e $00000031
+000001a1  DIV @00000031 $00000034
+000001aa  DIV @00000034 $00000037
+000001b3  DIV @00000037 $0000003a
+000001bc  DIV @0000003a $0000003d
+000001c5  DIV @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef0104000000000000000100000001070000000123456789abcdef010a0000000000000001000000
+010d0000000123456789abcdef0110000000000000000100000001130000000123456789abcdef01160000000000000001000000
+01190000000123456789abcdef011c0000000000000001000000011f0000000123456789abcdef01220000000000000001000000
+01250000000123456789abcdef01280000000000000001000000012b0000000123456789abcdef012e0000000000000001000000
+01310000000123456789abcdef0134000000000000000100000001370000000123456789abcdef013a0000000000000001000000
+013d0000000123456789abcdef09010000000400000009040000000700000009070000000a000000090a0000000d000000090d00
+00001000000009100000001300000009130000001600000009160000001900000009190000001c000000091c0000001f00000009
+1f0000002200000009220000002500000009250000002800000009280000002b000000092b0000002e000000092e000000310000
+0009310000003400000009340000003700000009370000003a000000093a0000003d000000093d0000003d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 8a ab cd ef ff ff ff ff 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #9999999900000000
+0000000d  SET @00000001 #0000000000010000
+0000001a  SET @00000002 #0000000099999999
+00000027  SET @00000010 #9999999900000000
+00000034  SET @00000011 #0000000000001000
+00000041  SET @00000012 #0000000009999999
+0000004e  SET @00000020 #9999999900000000
+0000005b  SET @00000021 #0000000000000100
+00000068  SET @00000022 #0000000099999999
+00000075  SET @00000030 #9999999900000000
+00000082  SET @00000031 #0000000000000010
+0000008f  SET @00000032 #0000099999999000
+0000009c  DIV @00000000 $00000001
+000000a5  DIV @00000000 $00000001
+000000ae  DIV @00000010 $00000011
+000000b7  DIV @00000010 $00000011
+000000c0  DIV @00000010 $00000011
+000000c9  DIV @00000020 $00000021
+000000d2  DIV @00000020 $00000021
+000000db  DIV @00000020 $00000021
+000000e4  DIV @00000020 $00000021
+000000ed  DIV @00000030 $00000031
+000000f6  DIV @00000030 $00000031
+000000ff  DIV @00000030 $00000031
+00000108  DIV @00000030 $00000031
+00000111  DIV @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000000000000099999999010100000000000100000000000102000000999999990000000001100000000000000099999999
+01110000000010000000000000011200000099999909000000000120000000000000009999999901210000000001000000000000
+01220000009999999900000000013000000000000000999999990131000000100000000000000001320000000090999999090000
+09000000000100000009000000000100000009100000001100000009100000001100000009100000001100000009200000002100
+00000920000000210000000920000000210000000920000000210000000930000000310000000930000000310000000930000000
+3100000009300000003100000009300000003100000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 99 99 99 99 ff ff ff ff 00 00 01 00 00 00 00 00 
+00000010 99 99 99 99 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 9a 99 99 f9 ff ff ff ff 00 10 00 00 00 00 00 00 
+00000090 99 99 99 09 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 99 99 99 99 ff ff ff ff 00 01 00 00 00 00 00 00 
+00000110 99 99 99 99 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 90 99 99 99 f9 ff ff 10 00 00 00 00 00 00 00 
+00000190 00 90 99 99 99 09 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #ffffffffffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  DIV @0000003e $0000003f
+00000023  DIV @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffffffffffff013f000000ffffffffffffffff093e0000003f000000093f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 01 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff   
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* SET @0000003e #1111111111111111
+0000000d  SET @0000003f #0000000000000000
+0000001a  DIV @0000003e $0000003f
+00000023  FIN
+
+Machine Code (Test 6):
+----------------------
+
+013e0000001111111111111111013f0000000000000000000000093e0000003f00000028
+
+Runtime Error (Test 6):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 7):
+-----------------------
+
+00000000* DIV @ffffffff @ffffffff
+00000009  FIN
+
+Machine Code (Test 7):
+----------------------
+
+09ffffffffffffffff28
+
+Runtime Error (Test 7):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ext_fun.html b/docs/at_test_ext_fun.html new file mode 100644 index 0000000..04b364f --- /dev/null +++ b/docs/at_test_ext_fun.html @@ -0,0 +1,97 @@ + + + + +CIYAM AT - Test for AT instruction code 0x32 (EXT_FUN) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x32 (EXT_FUN)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check function 1 and 2.
+Test 2 - Check function 3.
+Test 2 - Check function 4.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* FUN 2
+00000003  FUN 1
+00000006  FIN
+
+Machine Code (Test 1):
+----------------------
+
+32020032010028
+
+Runtime Result (Test 1):
+-----------------------
+
+func: 1 rc: 0000000000000001
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* FUN 3
+00000003  FIN
+
+Machine Code (Test 2):
+----------------------
+
+32030028
+
+Runtime Result (Test 2):
+-----------------------
+
+func: 3 rc: 000000000000000a
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* FUN 4
+00000003  FIN
+
+Machine Code (Test 4):
+----------------------
+
+32040028
+
+Runtime Result (Test 4):
+-----------------------
+
+func: 4 rc: 0000000000000004
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ext_fun_dat.html b/docs/at_test_ext_fun_dat.html new file mode 100644 index 0000000..bd24a00 --- /dev/null +++ b/docs/at_test_ext_fun_dat.html @@ -0,0 +1,99 @@ + + + + +CIYAM AT - Test for AT instruction code 0x33 (EXT_FUN_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x33 (EXT_FUN_DAT)
+-----------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check function 1.
+Test 2 - Check function 2.
+Test 3 - Check function 3.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000001 #00000000000000ff
+0000000d  FUN 1 $00000001
+00000014  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0101000000ff000000000000003301000100000028
+
+Runtime Result (Test 1):
+-----------------------
+
+255
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #00000000000000ff
+0000000d  FUN 2 $00000001
+00000014  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ff000000000000003302000100000028
+
+Runtime Result (Test 2):
+-----------------------
+
+func1: 2 with 255 rc: 00000000000001fe
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #00000000000000ff
+0000000d  FUN 3 $00000001
+00000014  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0101000000ff000000000000003303000100000028
+
+Runtime Result (Test 3):
+-----------------------
+
+func1: 3 with 255 rc: 000000000000007f
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ext_fun_dat_2.html b/docs/at_test_ext_fun_dat_2.html new file mode 100644 index 0000000..023ae72 --- /dev/null +++ b/docs/at_test_ext_fun_dat_2.html @@ -0,0 +1,102 @@ + + + + +CIYAM AT - Test for AT instruction code 0x34 (EXT_FUN_DAT_2) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x34 (EXT_FUN_DAT_2)
+-------------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check function 2.
+Test 2 - Check function 3.
+Test 2 - Check function 4.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  FUN 2 $00000000 $00000001
+00000025  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000040000000000000001010000000300000000000000340200000000000100000028
+
+Runtime Result (Test 1):
+-----------------------
+
+func2: 2 with 4 and 3 rc: 000000000000000c
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000006
+0000000d  SET @00000001 #0000000000000003
+0000001a  FUN 3 $00000000 $00000001
+00000025  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000060000000000000001010000000300000000000000340300000000000100000028
+
+Runtime Result (Test 2):
+-----------------------
+
+func2: 3 with 6 and 3 rc: 0000000000000002
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000006
+0000000d  SET @00000001 #0000000000000003
+0000001a  FUN 4 $00000000 $00000001
+00000025  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000060000000000000001010000000300000000000000340400000000000100000028
+
+Runtime Result (Test 3):
+-----------------------
+
+func2: 4 with 6 and 3 rc: 0000000000000009
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ext_fun_ret.html b/docs/at_test_ext_fun_ret.html new file mode 100644 index 0000000..5c1be68 --- /dev/null +++ b/docs/at_test_ext_fun_ret.html @@ -0,0 +1,148 @@ + + + + +CIYAM AT - Test for AT instruction code 0x35 (EXT_FUN_RET) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x35 (EXT_FUN_RET)
+-----------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check it works with loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* FUN @00000004 4
+00000007  FUN @00000003 3
+0000000e  FUN @00000002 2
+00000015  FUN @00000001 1
+0000001c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+3504000400000035030003000000350200020000003501000100000028
+
+Data Dump (Test 1):
+-----------------------
+
+00000000 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 01 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 
+00000020 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #ffffffffffffffff
+0000001a  FUN @00000001 2
+00000021  INC @00000000
+00000026  BNZ $00000001 :0000001a
+0000002c  FIN
+
+Machine Code (Test 2):
+----------------------
+
+010000000000000000000000000101000000ffffffffffffffff3502000100000004000000001e01000000f428
+
+Data Dump (Test 2):
+-------------------
+
+00000000 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ext_fun_ret_dat.html b/docs/at_test_ext_fun_ret_dat.html new file mode 100644 index 0000000..fdf5894 --- /dev/null +++ b/docs/at_test_ext_fun_ret_dat.html @@ -0,0 +1,153 @@ + + + + +CIYAM AT - Test for AT instruction code 0x36 (EXT_FUN_RET_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x36 (EXT_FUN_RET_DAT)
+---------------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check it works with loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000001 #000000000000000f
+0000000d  FUN @00000000 2 $00000001
+00000018  SET @00000003 #0000000000000008
+00000025  FUN @00000002 3 $00000003
+00000030  FIN
+
+Machine Code and Function Setting (Test 1):
+----------------------
+
+01010000000f00000000000000360200000000000100000001030000000800000000000000360300020000000300000028
+
+Data Dump (Test 1):
+-----------------------
+
+00000000 1e 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000010 04 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #0000000000000001
+0000000d  SET @00000002 #0fffffffffffffff
+0000001a  FUN @00000001 2 $00000001
+00000025  INC @00000000
+0000002a  BLT $00000001 $00000002 :0000001a
+00000034  FIN
+
+Machine Code and Function Setting (Test 2):
+----------------------
+
+010100000001000000000000000102000000ffffffffffffff0f36020001000000010000000400000000200100000002000000f028
+
+Data Dump (Test 2):
+-----------------------
+
+00000000 21 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 
+00000010 ff ff ff ff ff ff ff 0f 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Runtime Result (Test 2):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ext_fun_ret_dat_2.html b/docs/at_test_ext_fun_ret_dat_2.html new file mode 100644 index 0000000..bfa672f --- /dev/null +++ b/docs/at_test_ext_fun_ret_dat_2.html @@ -0,0 +1,157 @@ + + + + +CIYAM AT - Test for AT instruction code 0x37 (EXT_FUN_RET_DAT_2) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x37 (EXT_FUN_RET_DAT_2)
+-----------------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check it works with loop.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  FUN @00000002 2 $00000000 $00000001
+00000029  FUN @00000003 3 $00000000 $00000001
+00000038  FUN @00000004 4 $00000000 $00000001
+00000047  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000400000000000000010100000003000000000000003702000200000000000000010000003703000300000000000000
+0100000037040004000000000000000100000028
+
+Data Dump (Test 1):
+--------------------
+
+00000000 04 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 0c 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000020 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000004
+0000000d  SET @00000001 #0000000000000003
+0000001a  SET @00000002 #0fffffffffffffff
+00000027  FUN @00000001 4 $00000000 $00000001
+00000036  INC @00000003
+0000003b  BLT $00000001 $00000002 :00000027
+00000045  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000000400000000000000010100000003000000000000000102000000ffffffffffffff0f37040001000000000000000100
+00000403000000200100000002000000ec28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 04 00 00 00 00 00 00 00 87 00 00 00 00 00 00 00 
+00000010 ff ff ff ff ff ff ff 0f 20 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Runtime Result (Test 2):
+-----------------------
+
+stopped - zero balance
+
+
+
+
+ + + + + + diff --git a/docs/at_test_fin_imd.html b/docs/at_test_fin_imd.html new file mode 100644 index 0000000..694f8eb --- /dev/null +++ b/docs/at_test_fin_imd.html @@ -0,0 +1,145 @@ + + + + +CIYAM AT - Test for AT instruction code 0x28 (FIN_IMD) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x28 (FIN_IMD)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check it stops.
+Test 2 - FIN_IMD first command.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000011111111
+0000000d  PCS
+0000000e  FIN
+0000000f  SET @00000000 #2222222200000000
+0000001c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000111111110000000030280100000000000000002222222228
+
+Data Dump (Test 1):
+-------------------
+
+00000000  11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* FIN
+00000001  SET @00000000 #0000000011111111
+0000000e  FIN
+
+Machine Code (Test 2):
+----------------------
+
+280100000000111111110000000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+
+
+
+ + + + + + diff --git a/docs/at_test_fiz_dat.html b/docs/at_test_fiz_dat.html new file mode 100644 index 0000000..fb6d45b --- /dev/null +++ b/docs/at_test_fiz_dat.html @@ -0,0 +1,115 @@ + + + + +CIYAM AT - Test for AT instruction code 0x26 (FIZ_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x26 (FIZ_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Basic usage.
+Test 2 - Jump to not existing address.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000011111111
+0000000d  FIZ $00000000
+00000012  SET @00000000 #0000000000000000
+0000001f  FIZ $00000000
+00000024  SET @00000000 #0000000011111111
+00000031  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000111111110000000026000000000100000000000000000000000026000000000100000000111111110000000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000011111111
+0000000d  FIZ $11111111
+00000012  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000001111111100000000261111111128
+
+Runtime Error (Test 2):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_inc_dat.html b/docs/at_test_inc_dat.html new file mode 100644 index 0000000..ed9fde6 --- /dev/null +++ b/docs/at_test_inc_dat.html @@ -0,0 +1,492 @@ + + + + +CIYAM AT - Test for AT instruction code 0x04 (INC_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x04 (INC_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000000000001
+0000001a  SET @00000002 #0000000000000002
+00000027  SET @00000003 #0000000000000003
+00000034  SET @00000004 #0000000000000004
+00000041  SET @00000005 #0000000000000005
+0000004e  SET @00000006 #0000000000000006
+0000005b  SET @00000007 #0000000000000007
+00000068  SET @00000008 #0000000000000008
+00000075  SET @00000009 #0000000000000009
+00000082  SET @0000000a #000000000000000a
+0000008f  SET @0000000b #000000000000000b
+0000009c  SET @0000000c #000000000000000c
+000000a9  SET @0000000d #000000000000000d
+000000b6  SET @0000000e #000000000000000e
+000000c3  SET @0000000f #000000000000000f
+000000d0  SET @00000010 #0000000000000010
+000000dd  SET @00000011 #0000000000000011
+000000ea  SET @00000012 #0000000000000012
+000000f7  SET @00000013 #0000000000000013
+00000104  SET @00000014 #0000000000000014
+00000111  SET @00000015 #0000000000000015
+0000011e  INC @00000000
+00000123  INC @00000001
+00000128  INC @00000002
+0000012d  INC @00000003
+00000132  INC @00000004
+00000137  INC @00000005
+0000013c  INC @00000006
+00000141  INC @00000007
+00000146  INC @00000008
+0000014b  INC @00000009
+00000150  INC @0000000a
+00000155  INC @0000000b
+0000015a  INC @0000000c
+0000015f  INC @0000000d
+00000164  INC @0000000e
+00000169  INC @0000000f
+0000016e  INC @00000010
+00000173  INC @00000011
+00000178  INC @00000012
+0000017d  INC @00000013
+00000182  INC @00000014
+00000187  INC @00000015
+0000018c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000010100000001000000000000000102000000020000000000000001030000000300000000000000
+01040000000400000000000000010500000005000000000000000106000000060000000000000001070000000700000000000000
+0108000000080000000000000001090000000900000000000000010a0000000a00000000000000010b0000000b00000000000000
+010c0000000c00000000000000010d0000000d00000000000000010e0000000e00000000000000010f0000000f00000000000000
+01100000001000000000000000011100000011000000000000000112000000120000000000000001130000001300000000000000
+01140000001400000000000000011500000015000000000000000400000000040100000004020000000403000000040400000004
+050000000406000000040700000004080000000409000000040a000000040b000000040c000000040d000000040e000000040f00
+000004100000000411000000041200000004130000000414000000041500000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 
+00000010 03 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 
+00000020 05 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 
+00000030 07 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 
+00000040 09 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 
+00000050 0b 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 
+00000060 0d 00 00 00 00 00 00 00 0e 00 00 00 00 00 00 00 
+00000070 0f 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 
+00000080 11 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 
+00000090 13 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 
+000000a0 15 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #fffffffffffffffe
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #fffffffffffffffe
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #fffffffffffffffe
+00000041  SET @00000010 #ffffffffffffffff
+0000004e  SET @00000013 #fffffffffffffffe
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #fffffffffffffffe
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #fffffffffffffffe
+0000008f  SET @00000022 #ffffffffffffffff
+0000009c  SET @00000025 #fffffffffffffffe
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #fffffffffffffffe
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #fffffffffffffffe
+000000dd  SET @00000034 #ffffffffffffffff
+000000ea  SET @00000037 #fffffffffffffffe
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #fffffffffffffffe
+00000111  INC @00000001
+00000116  INC @00000004
+0000011b  INC @00000007
+00000120  INC @0000000a
+00000125  INC @0000000d
+0000012a  INC @00000010
+0000012f  INC @00000013
+00000134  INC @00000016
+00000139  INC @00000019
+0000013e  INC @0000001c
+00000143  INC @0000001f
+00000148  INC @00000022
+0000014d  INC @00000025
+00000152  INC @00000028
+00000157  INC @0000002b
+0000015c  INC @0000002e
+00000161  INC @00000031
+00000166  INC @00000034
+0000016b  INC @00000037
+00000170  INC @0000003a
+00000175  INC @0000003d
+0000017a  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000feffffffffffffff0104000000ffffffffffffffff0107000000feffffffffffffff010a000000ffffffffffffffff
+010d000000feffffffffffffff0110000000ffffffffffffffff0113000000feffffffffffffff0116000000ffffffffffffffff
+0119000000feffffffffffffff011c000000ffffffffffffffff011f000000feffffffffffffff0122000000ffffffffffffffff
+0125000000feffffffffffffff0128000000ffffffffffffffff012b000000feffffffffffffff012e000000ffffffffffffffff
+0131000000feffffffffffffff0134000000ffffffffffffffff0137000000feffffffffffffff013a000000ffffffffffffffff
+013d000000feffffffffffffff040100000004040000000407000000040a000000040d0000000410000000041300000004160000
+000419000000041c000000041f000000042200000004250000000428000000042b000000042e0000000431000000043400000004
+37000000043a000000043d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #efcdab8967452301
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #efcdab8967452301
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #efcdab8967452301
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #efcdab8967452301
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #efcdab8967452301
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #efcdab8967452301
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #efcdab8967452301
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #efcdab8967452301
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #efcdab8967452301
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #efcdab8967452301
+00000104  SET @0000003d #efcdab8967452301
+00000111  INC @00000001
+00000116  INC @00000004
+0000011b  INC @00000007
+00000120  INC @0000000a
+00000125  INC @0000000d
+0000012a  INC @00000010
+0000012f  INC @00000013
+00000134  INC @00000016
+00000139  INC @00000019
+0000013e  INC @0000001c
+00000143  INC @0000001f
+00000148  INC @00000022
+0000014d  INC @00000025
+00000152  INC @00000028
+00000157  INC @0000002b
+0000015c  INC @0000002e
+00000161  INC @00000031
+00000166  INC @00000034
+0000016b  INC @00000037
+00000170  INC @0000003a
+00000175  INC @0000003d
+0000017a  FIN
+
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef01040000000123456789abcdef01070000000123456789abcdef010a0000000123456789abcdef
+010d0000000123456789abcdef01100000000123456789abcdef01130000000123456789abcdef01160000000123456789abcdef
+01190000000123456789abcdef011c0000000123456789abcdef011f0000000123456789abcdef01220000000123456789abcdef
+01250000000123456789abcdef01280000000123456789abcdef012b0000000123456789abcdef012e0000000123456789abcdef
+01310000000123456789abcdef01340000000123456789abcdef01370000000123456789abcdef013a0000000123456789abcdef
+013d0000000123456789abcdef040100000004040000000407000000040a000000040d0000000410000000041300000004160000
+000419000000041c000000041f000000042200000004250000000428000000042b000000042e0000000431000000043400000004
+37000000043a000000043d00000028
+
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 02 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 02 23 45 67 89 ab cd ef 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000001 #9999999999999997
+0000001a  SET @00000002 #ffffffffffffffff
+00000027  SET @00000010 #ffffffffffffffff
+00000034  SET @00000011 #9999999999999996
+00000041  SET @00000012 #ffffffffffffffff
+0000004e  SET @00000020 #ffffffffffffffff
+0000005b  SET @00000021 #9999999999999995
+00000068  SET @00000022 #ffffffffffffffff
+00000075  SET @00000030 #ffffffffffffffff
+00000082  SET @00000031 #9999999999999994
+0000008f  SET @00000032 #ffffffffffffffff
+0000009c  INC @00000001
+000000a1  INC @00000001
+000000a6  INC @00000011
+000000ab  INC @00000011
+000000b0  INC @00000011
+000000b5  INC @00000021
+000000ba  INC @00000021
+000000bf  INC @00000021
+000000c4  INC @00000021
+000000c9  INC @00000031
+000000ce  INC @00000031
+000000d3  INC @00000031
+000000d8  INC @00000031
+000000dd  INC @00000031
+000000e2  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000ffffffffffffffff010100000097999999999999990102000000ffffffffffffffff0110000000ffffffffffffffff
+011100000096999999999999990112000000ffffffffffffffff0120000000ffffffffffffffff01210000009599999999999999
+0122000000ffffffffffffffff0130000000ffffffffffffffff013100000094999999999999990132000000ffffffffffffffff
+04010000000401000000041100000004110000000411000000042100000004210000000421000000042100000004310000000431
+00000004310000000431000000043100000028
+
+
+Data Dump (Test 4):
+-------------------
+
+00000000 ff ff ff ff ff ff ff ff 99 99 99 99 99 99 99 99 
+00000010 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 99 99 99 99 99 99 99 99 
+00000090 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 ff ff ff ff ff ff ff ff 99 99 99 99 99 99 99 99 
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 ff ff ff ff ff ff ff ff 99 99 99 99 99 99 99 99 
+00000190 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003d #fffffffffffffffe
+0000000d  SET @0000003e #ffffffffffffffff
+0000001a  SET @0000003f #fffffffffffffffe
+00000027  INC @0000003d
+0000002c  INC @0000003e
+00000031  INC @0000003f
+00000036  INC @00000040
+0000003b  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013d000000feffffffffffffff013e000000ffffffffffffffff013f000000feffffffffffffff043d000000043e000000043f00
+0000044000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000001f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* INC @ffffffff
+00000005  FIN
+
+Machine Code (Test 6):
+----------------------
+
+04ffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_jmp_adr.html b/docs/at_test_jmp_adr.html new file mode 100644 index 0000000..681edf0 --- /dev/null +++ b/docs/at_test_jmp_adr.html @@ -0,0 +1,133 @@ + + + + +CIYAM AT - Test for AT instruction code 0x1a (JMP_ADR) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x1a (JMP_ADR)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check it jumps.
+Test 2 - Jump to invalid address.
+Test 3 - Jump to negative address.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* JMP :00000006
+00000005  FIN
+00000006  SET @00000000 #0000000022222222
+00000013  FIN
+
+Machine Code (Test 1):
+----------------------
+
+1a06000000280100000000222222220000000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000  22 22 22 22 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* JMP :00000016
+00000005  FIN
+00000006  SET @00000000 #0000000022222222
+00000013  FIN
+
+Machine Code (Test 2):
+----------------------
+
+1a16000000280100000000222222220000000028
+
+Runtime Error (Test 2):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* JMP :11111111
+00000005  FIN
+00000006  SET @00000000 #0000000022222222
+00000013  FIN
+
+Machine Code (Test 3):
+----------------------
+
+1a11111111280100000000222222220000000028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: error overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_jmp_sub.html b/docs/at_test_jmp_sub.html new file mode 100644 index 0000000..a4baba7 --- /dev/null +++ b/docs/at_test_jmp_sub.html @@ -0,0 +1,187 @@ + + + + +CIYAM AT - Test for AT instruction code 0x12 (JMP_SUB) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x12 (JMP_SUB)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage.
+Test 2 - Check some basic usage (using ret).
+Test 3 - Jump to not valid address point
+Test 4 - infinite loop
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  JSR :0000001f
+00000012  SET @00000000 #1111111111111111
+0000001f  INC @00000000
+00000024  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000121f00000001000000001111111111111111040000000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000  SET @00000000 #0000000000000000
+0000000d* JSR :00000018
+00000012  INC @00000000
+00000017  FIN
+00000018  SET @00000000 #1111111111111110
+00000025  RET
+
+Machine Code (Test 2):
+----------------------
+
+0100000000000000000000000012180000000400000000280100000000101111111111111113
+
+Data Dump (Test 2):
+-------------------
+
+00000000  11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000  SET @00000000 #0000000000000000
+0000000d* JSR :00000020
+00000012  INC @00000000
+00000017  FIN
+00000018  SET @00000000 #1111111111111110
+00000025  RET
+
+Machine Code (Test 3):
+-----------------------
+
+0100000000000000000000000012220000000400000000280100000000101111111111111113
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000  SET @00000000 #0000000000000000
+0000000d  INC @00000000
+00000012* JSR :00000000
+00000017  FIN
+
+Machine Code (Test 4):
+-----------------------
+
+010000000000000000000000000400000000120000000028
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_mul_dat.html b/docs/at_test_mul_dat.html new file mode 100644 index 0000000..7b42e1b --- /dev/null +++ b/docs/at_test_mul_dat.html @@ -0,0 +1,474 @@ + + + + +CIYAM AT - Test for AT instruction code 0x08 (MUL_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x08 (MUL_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  SET @0000000f #0000000000000000
+000000d0  MUL @00000000 $00000001
+000000d9  MUL @00000001 $00000002
+000000e2  MUL @00000002 $00000003
+000000eb  MUL @00000003 $00000004
+000000f4  MUL @00000004 $00000005
+000000fd  MUL @00000005 $00000006
+00000106  MUL @00000006 $00000007
+0000010f  MUL @00000007 $00000008
+00000118  MUL @00000008 $00000009
+00000121  MUL @00000009 $0000000a
+0000012a  MUL @0000000a $0000000b
+00000133  MUL @0000000b $0000000c
+0000013c  MUL @0000000c $0000000d
+00000145  MUL @0000000d $0000000e
+0000014e  MUL @0000000e $0000000f
+00000157  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e0000000100000000000000010f0000000000000000000000
+08000000000100000008010000000200000008020000000300000008030000000400000008040000000500000008050000000600
+000008060000000700000008070000000800000008080000000900000008090000000a000000080a0000000b000000080b000000
+0c000000080c0000000d000000080d0000000e000000080e0000000f00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 d2 00 00 00 00 00 00 00 b6 00 00 00 00 00 00 00 
+00000010 9c 00 00 00 00 00 00 00 84 00 00 00 00 00 00 00 
+00000020 6e 00 00 00 00 00 00 00 5a 00 00 00 00 00 00 00 
+00000030 48 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 
+00000040 2a 00 00 00 00 00 00 00 1e 00 00 00 00 00 00 00 
+00000050 14 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 
+00000060 06 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #0000000000000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #0000000000000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #0000000000000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #0000000000000000
+00000111  MUL @00000001 $00000004
+0000011a  MUL @00000004 $00000007
+00000123  MUL @00000007 $0000000a
+0000012c  MUL @0000000a $0000000d
+00000135  MUL @0000000d $00000010
+0000013e  MUL @00000010 $00000013
+00000147  MUL @00000013 $00000016
+00000150  MUL @00000016 $00000019
+00000159  MUL @00000019 $0000001c
+00000162  MUL @0000001c $0000001f
+0000016b  MUL @0000001f $00000022
+00000174  MUL @00000022 $00000025
+0000017d  MUL @00000025 $00000028
+00000186  MUL @00000028 $0000002b
+0000018f  MUL @0000002b $0000002e
+00000198  MUL @0000002e $00000031
+000001a1  MUL @00000031 $00000034
+000001aa  MUL @00000034 $00000037
+000001b3  MUL @00000037 $0000003a
+000001bc  MUL @0000003a $0000003d
+000001c5  MUL @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff01070000000000000000000000010a000000ffffffffffffffff
+010d000000ffffffffffffffff011000000000000000000000000113000000ffffffffffffffff0116000000ffffffffffffffff
+01190000000000000000000000011c000000ffffffffffffffff011f000000ffffffffffffffff01220000000000000000000000
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b0000000000000000000000012e000000ffffffffffffffff
+0131000000ffffffffffffffff013400000000000000000000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d000000000000000000000008010000000400000008040000000700000008070000000a000000080a0000000d000000080d00
+00001000000008100000001300000008130000001600000008160000001900000008190000001c000000081c0000001f00000008
+1f0000002200000008220000002500000008250000002800000008280000002b000000082b0000002e000000082e000000310000
+0008310000003400000008340000003700000008370000003a000000083a0000003d000000083d0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #1111111111111111
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #1111111111111111
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #1111111111111111
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #1111111111111111
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #1111111111111111
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #1111111111111111
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #1111111111111111
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #1111111111111111
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #1111111111111111
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #1111111111111111
+00000104  SET @0000003d #efcdab8967452301
+00000111  MUL @00000001 $00000004
+0000011a  MUL @00000004 $00000007
+00000123  MUL @00000007 $0000000a
+0000012c  MUL @0000000a $0000000d
+00000135  MUL @0000000d $00000010
+0000013e  MUL @00000010 $00000013
+00000147  MUL @00000013 $00000016
+00000150  MUL @00000016 $00000019
+00000159  MUL @00000019 $0000001c
+00000162  MUL @0000001c $0000001f
+0000016b  MUL @0000001f $00000022
+00000174  MUL @00000022 $00000025
+0000017d  MUL @00000025 $00000028
+00000186  MUL @00000028 $0000002b
+0000018f  MUL @0000002b $0000002e
+00000198  MUL @0000002e $00000031
+000001a1  MUL @00000031 $00000034
+000001aa  MUL @00000034 $00000037
+000001b3  MUL @00000037 $0000003a
+000001bc  MUL @0000003a $0000003d
+000001c5  MUL @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef0104000000111111111111111101070000000123456789abcdef010a0000001111111111111111
+010d0000000123456789abcdef0110000000111111111111111101130000000123456789abcdef01160000001111111111111111
+01190000000123456789abcdef011c0000001111111111111111011f0000000123456789abcdef01220000001111111111111111
+01250000000123456789abcdef01280000001111111111111111012b0000000123456789abcdef012e0000001111111111111111
+01310000000123456789abcdef0134000000111111111111111101370000000123456789abcdef013a0000001111111111111111
+013d0000000123456789abcdef08010000000400000008040000000700000008070000000a000000080a0000000d000000080d00
+00001000000008100000001300000008130000001600000008160000001900000008190000001c000000081c0000001f00000008
+1f0000002200000008220000002500000008250000002800000008280000002b000000082b0000002e000000082e000000310000
+0008310000003400000008340000003700000008370000003a000000083a0000003d000000083d0000003d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 11 64 fb d6 f6 5a 03 f0 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 11 64 fb d6 f6 5a 03 f0 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 01 46 53 b1 e8 81 05 fc 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000099999999
+0000000d  SET @00000001 #0000000000010000
+0000001a  SET @00000002 #9999999900000000
+00000027  SET @00000010 #0000000099999999
+00000034  SET @00000011 #0000000000001000
+00000041  SET @00000012 #9999999000000000
+0000004e  SET @00000020 #0000000099999999
+0000005b  SET @00000021 #0000000000000100
+00000068  SET @00000022 #9999999900000000
+00000075  SET @00000030 #0000099999999000
+00000082  SET @00000031 #0000000000000010
+0000008f  SET @00000032 #9999999900000000
+0000009c  MUL @00000000 $00000001
+000000a5  MUL @00000000 $00000001
+000000ae  MUL @00000010 $00000011
+000000b7  MUL @00000010 $00000011
+000000c0  MUL @00000010 $00000011
+000000c9  MUL @00000020 $00000021
+000000d2  MUL @00000020 $00000021
+000000db  MUL @00000020 $00000021
+000000e4  MUL @00000020 $00000021
+000000ed  MUL @00000030 $00000031
+000000f6  MUL @00000030 $00000031
+000000ff  MUL @00000030 $00000031
+00000108  MUL @00000030 $00000031
+00000111  MUL @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000009999999900000000010100000000000100000000000102000000000000009999999901100000009999999900000000
+01110000000010000000000000011200000000000000909999990120000000999999990000000001210000000001000000000000
+01220000000000000099999999013000000000909999990900000131000000100000000000000001320000000000000099999999
+08000000000100000008000000000100000008100000001100000008100000001100000008100000001100000008200000002100
+00000820000000210000000820000000210000000820000000210000000830000000310000000830000000310000000830000000
+3100000008300000003100000008300000003100000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 00 00 00 00 99 99 99 99 00 00 01 00 00 00 00 00 
+00000010 00 00 00 00 99 99 99 99 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 90 99 99 99 00 10 00 00 00 00 00 00 
+00000090 00 00 00 00 90 99 99 99 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 99 99 99 99 00 01 00 00 00 00 00 00 
+00000110 00 00 00 00 99 99 99 99 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 99 99 99 99 10 00 00 00 00 00 00 00 
+00000190 00 00 00 00 99 99 99 99 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #1111111111111111
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  MUL @0000003e $0000003f
+00000023  MUL @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e0000001111111111111111013f000000ffffffffffffffff083e0000003f000000083f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 ef ee ee ee ee ee ee ee ff ff ff ff ff ff ff ff   
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* MUL @ffffffff $ffffffff
+00000009  FIN
+
+Machine Code (Test 6):
+----------------------
+
+08ffffffffffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_not_dat.html b/docs/at_test_not_dat.html new file mode 100644 index 0000000..27c76db --- /dev/null +++ b/docs/at_test_not_dat.html @@ -0,0 +1,473 @@ + + + + +CIYAM AT - Test for AT instruction code 0x0d (NOT_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x0d (NOT_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  NOT @00000000
+000000c8  NOT @00000001
+000000cd  NOT @00000002
+000000d2  NOT @00000003
+000000d7  NOT @00000004
+000000dc  NOT @00000005
+000000e1  NOT @00000006
+000000e6  NOT @00000007
+000000eb  NOT @00000008
+000000f0  NOT @00000009
+000000f5  NOT @0000000a
+000000fa  NOT @0000000b
+000000ff  NOT @0000000c
+00000104  NOT @0000000d
+00000109  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e00000001000000000000000d000000000d010000000d0200
+00000d030000000d040000000d050000000d060000000d070000000d080000000d090000000d0a0000000d0b0000000d0c000000
+0d0d00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 f0 ff ff ff ff ff ff ff f1 ff ff ff ff ff ff ff 
+00000010 f2 ff ff ff ff ff ff ff f3 ff ff ff ff ff ff ff 
+00000020 f4 ff ff ff ff ff ff ff f5 ff ff ff ff ff ff ff 
+00000030 f6 ff ff ff ff ff ff ff f7 ff ff ff ff ff ff ff 
+00000040 f8 ff ff ff ff ff ff ff f9 ff ff ff ff ff ff ff 
+00000050 fa ff ff ff ff ff ff ff fb ff ff ff ff ff ff ff 
+00000060 fc ff ff ff ff ff ff ff fd ff ff ff ff ff ff ff 
+00000070 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #00000000ffffffff
+0000001a  SET @00000007 #0000000000000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #00000000ffffffff
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #00000000ffffffff
+00000068  SET @00000019 #0000000000000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #00000000ffffffff
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #00000000ffffffff
+000000b6  SET @0000002b #0000000000000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #00000000ffffffff
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #00000000ffffffff
+00000104  SET @0000003d #0000000000000000
+00000111  NOT @00000001
+00000116  NOT @00000004
+0000011b  NOT @00000007
+00000120  NOT @0000000a
+00000125  NOT @0000000d
+0000012a  NOT @00000010
+0000012f  NOT @00000013
+00000134  NOT @00000016
+00000139  NOT @00000019
+0000013e  NOT @0000001c
+00000143  NOT @0000001f
+00000148  NOT @00000022
+0000014d  NOT @00000025
+00000152  NOT @00000028
+00000157  NOT @0000002b
+0000015c  NOT @0000002e
+00000161  NOT @00000031
+00000166  NOT @00000034
+0000016b  NOT @00000037
+00000170  NOT @0000003a
+00000175  NOT @0000003d
+0000017a  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffff0000000001070000000000000000000000010a000000ffffffffffffffff
+010d000000ffffffff00000000011000000000000000000000000113000000ffffffffffffffff0116000000ffffffff00000000
+01190000000000000000000000011c000000ffffffffffffffff011f000000ffffffff0000000001220000000000000000000000
+0125000000ffffffffffffffff0128000000ffffffff00000000012b0000000000000000000000012e000000ffffffffffffffff
+0131000000ffffffff00000000013400000000000000000000000137000000ffffffffffffffff013a000000ffffffff00000000
+013d00000000000000000000000d010000000d040000000d070000000d0a0000000d0d0000000d100000000d130000000d160000
+000d190000000d1c0000000d1f0000000d220000000d250000000d280000000d2b0000000d2e0000000d310000000d340000000d
+370000000d3a0000000d3d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #00000000ffffffff
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #00000000ffffffff
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #00000000ffffffff
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #efcdab8967452301
+00000111  NOT @00000001
+00000116  NOT @00000004
+0000011b  NOT @00000007
+00000120  NOT @0000000a
+00000125  NOT @0000000d
+0000012a  NOT @00000010
+0000012f  NOT @00000013
+00000134  NOT @00000016
+00000139  NOT @00000019
+0000013e  NOT @0000001c
+00000143  NOT @0000001f
+00000148  NOT @00000022
+0000014d  NOT @00000025
+00000152  NOT @00000028
+00000157  NOT @0000002b
+0000015c  NOT @0000002e
+00000161  NOT @00000031
+00000166  NOT @00000034
+0000016b  NOT @00000037
+00000170  NOT @0000003a
+00000175  NOT @0000003d
+0000017a  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef0104000000ffffffffffffffff01070000000123456789abcdef010a000000ffffffff00000000
+010d0000000123456789abcdef0110000000000000000000000001130000000123456789abcdef0116000000ffffffffffffffff
+01190000000123456789abcdef011c000000ffffffff00000000011f0000000123456789abcdef01220000000000000000000000
+01250000000123456789abcdef0128000000ffffffffffffffff012b0000000123456789abcdef012e000000ffffffff00000000
+01310000000123456789abcdef0134000000000000000000000001370000000123456789abcdef013a000000ffffffffffffffff
+013d0000000123456789abcdef0d010000000d040000000d070000000d0a0000000d0d0000000d100000000d130000000d160000
+000d190000000d1c0000000d1f0000000d220000000d250000000d280000000d2b0000000d2e0000000d310000000d340000000d
+370000000d3a0000000d3d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 4):
+-----------------------
+
+000000e3  SET @00000000 #9999999999999999
+000000f0  SET @00000001 #1111111111111111
+000000fd  SET @00000002 #99999999ffffffff
+0000010a  SET @00000010 #8888888888888888
+00000117  SET @00000011 #2222222222222222
+00000124  SET @00000012 #77777777ffffffff
+00000131  SET @00000020 #6666666666666666
+0000013e  SET @00000021 #3333333333333333
+0000014b  SET @00000022 #66666666ffffffff
+00000158  SET @00000030 #5555555555555555
+00000165  SET @00000031 #4444444444444444
+00000172  SET @00000032 #aaaaaaaaffffffff
+0000017f  NOT @00000000
+00000184  NOT @00000000
+00000189  NOT @00000010
+0000018e  NOT @00000010
+00000193  NOT @00000010
+00000198  NOT @00000020
+0000019d  NOT @00000020
+000001a2  NOT @00000020
+000001a7  NOT @00000020
+000001ac  NOT @00000030
+000001b1  NOT @00000030
+000001b6  NOT @00000030
+000001bb  NOT @00000030
+000001c0  NOT @00000030
+000001c5  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000009999999999999999010100000011111111111111110102000000ffffffff9999999901100000008888888888888888
+011100000022222222222222220112000000ffffffff777777770120000000666666666666666601210000003333333333333333
+0122000000ffffffff6666666601300000005555555555555555013100000044444444444444440132000000ffffffffaaaaaaaa
+0d000000000d000000000d100000000d100000000d100000000d200000000d200000000d200000000d200000000d300000000d30
+0000000d300000000d300000000d300000002801000000009999999999999999010100000011111111111111110102000000ffff
+ffff9999999901100000008888888888888888011100000022222222222222220112000000ffffffff7777777701200000006666
+666666666666012100000033333333333333330122000000ffffffff666666660130000000555555555555555501310000004444
+4444444444440132000000ffffffffaaaaaaaa0d000000000d000000000d100000000d100000000d100000000d200000000d2000
+00000d200000000d200000000d300000000d300000000d300000000d300000000d3000000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 99 99 99 99 99 99 99 99 11 11 11 11 11 11 11 11 
+00000010 ff ff ff ff 99 99 99 99 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 77 77 77 77 77 77 77 77 22 22 22 22 22 22 22 22 
+00000090 ff ff ff ff 77 77 77 77 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 66 66 66 66 66 66 66 66 33 33 33 33 33 33 33 33 
+00000110 ff ff ff ff 66 66 66 66 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 aa aa aa aa aa aa aa aa 44 44 44 44 44 44 44 44 
+00000190 ff ff ff ff aa aa aa aa 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #00000000ffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  NOT @0000003e
+0000001f  NOT @0000003f
+00000024  NOT @00000040
+00000029  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffff00000000013f000000ffffffffffffffff0d3e0000000d3f0000000d4000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* NOT @ffffffff
+00000005  FIN
+
+Machine Code (Test 6):
+----------------------
+
+0dffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_pop_dat.html b/docs/at_test_pop_dat.html new file mode 100644 index 0000000..14299af --- /dev/null +++ b/docs/at_test_pop_dat.html @@ -0,0 +1,224 @@ + + + + +CIYAM AT - Test for AT instruction code 0x11 (POP_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x11 (POP_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage.
+Test 2 - Check address range.
+Test 3 - POP without PSH first
+Test 4 - POP to address out of range
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #1111111100000000
+0000000d  PSH $00000000
+00000012  PSH $00000000
+00000017  PSH $00000000
+0000001c  PSH $00000000
+00000021  PSH $00000000
+00000026  PSH $00000000
+0000002b  PSH $00000000
+00000030  PSH $00000000
+00000035  PSH $00000000
+0000003a  PSH $00000000
+0000003f  PSH $00000000
+00000044  POP @00000001
+00000049  POP @00000002
+0000004e  POP @00000003
+00000053  POP @00000004
+00000058  POP @00000005
+0000005d  POP @00000006
+00000062  POP @00000007
+00000067  POP @00000008
+0000006c  POP @00000009
+00000071  POP @0000000a
+00000076  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000011111111100000000010000000001000000000100000000010000000001000000000100000000010000000
+00100000000010000000001000000000110100000011020000001103000000110400000011050000001106000000110700000011
+080000001109000000110a00000028
+
+Stacks Dump (Test 1):
+---------------------
+
+00000000 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000010 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000020 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000030 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000040 00 00 00 00 11 11 11 11 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #1111111100000000
+0000000d  PSH $00000000
+00000012  SET @00000008 #1211111100000000
+0000001f  PSH $00000008
+00000024  SET @00000018 #1311111100000000
+00000031  PSH $00000018
+00000036  SET @00000028 #1411111100000000
+00000043  PSH $00000028
+00000048  SET @00000038 #1511111100000000
+00000055  PSH $00000038
+0000005a  SET @0000003a #1611111100000000
+00000067  PSH $0000003a
+0000006c  SET @0000003c #1711111100000000
+00000079  PSH $0000003c
+0000007e  SET @0000003e #1811111100000000
+0000008b  PSH $0000003e
+00000090  POP @00000001
+00000095  POP @00000009
+0000009a  POP @00000019
+0000009f  POP @00000029
+000000a4  POP @00000039
+000000a9  POP @0000003d
+000000ae  POP @0000003f
+000000b3  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000000000000011111111100000000001080000000000000011111112100800000001180000000000000011111113101800
+0000012800000000000000111111141028000000013800000000000000111111151038000000013a000000000000001111111610
+3a000000013c0000000000000011111117103c000000013e0000000000000011111118103e000000110100000011090000001119
+00000011290000001139000000113d000000113f00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 17 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 11 11 11 12 00 00 00 00 11 11 11 16 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 11 11 11 13 00 00 00 00 11 11 11 15 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 11 11 11 14 00 00 00 00 11 11 11 14 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 11 11 11 15 00 00 00 00 11 11 11 13 
+000001d0 00 00 00 00 11 11 11 16 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 11 11 11 17 00 00 00 00 11 11 11 12 
+000001f0 00 00 00 00 11 11 11 18 00 00 00 00 11 11 11 11 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* POP @00000001
+0000000d  FIN
+
+Machine Code (Test 3):
+-----------------------
+
+111000000028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000  SET @00000000 #0000000011111111
+0000000d  PSH $00000000
+00000012* POP @00000040
+00000017  FIN
+
+Machine Code (Test 4):
+-----------------------
+
+010000000011111111000000001000000000114000000028
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_psh_dat.html b/docs/at_test_psh_dat.html new file mode 100644 index 0000000..66359ad --- /dev/null +++ b/docs/at_test_psh_dat.html @@ -0,0 +1,277 @@ + + + + +CIYAM AT - Test for AT instruction code 0x10 (PSH_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x10 (PSH_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage.
+Test 2 - Check address range.
+Test 3 - Copying from address out of range.
+Test 4 - Pushing out of range
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #1111111100000000
+0000000d  PSH $00000000
+00000012  PSH $00000000
+00000017  PSH $00000000
+0000001c  PSH $00000000
+00000021  PSH $00000000
+00000026  PSH $00000000
+0000002b  PSH $00000000
+00000030  PSH $00000000
+00000035  PSH $00000000
+0000003a  PSH $00000000
+0000003f  PSH $00000000
+00000044  PSH $00000000
+00000049  PSH $00000000
+0000004e  PSH $00000000
+00000053  PSH $00000000
+00000058  PSH $00000000
+0000005d  PSH $00000000
+00000062  PSH $00000000
+00000067  PSH $00000000
+0000006c  PSH $00000000
+00000071  PSH $00000000
+00000076  PSH $00000000
+0000007b  PSH $00000000
+00000080  PSH $00000000
+00000085  PSH $00000000
+0000008a  PSH $00000000
+0000008f  PSH $00000000
+00000094  PSH $00000000
+00000099  PSH $00000000
+0000009e  PSH $00000000
+000000a3  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000011111111100000000010000000001000000000100000000010000000001000000000100000000010000000
+00100000000010000000001000000000100000000010000000001000000000100000000010000000001000000000100000000010
+00000000100000000010000000001000000000100000000010000000001000000000100000000010000000001000000000100000
+0000100000000028
+
+Stacks Dump (Test 1):
+-------------------
+
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000310 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000320 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000330 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000340 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000350 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000360 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000370 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000380 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+00000390 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+000003a0 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+000003b0 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+000003c0 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+000003d0 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+000003e0 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+000003f0 00 00 00 00 11 11 11 11 00 00 00 00 11 11 11 11 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #1111111100000000
+0000000d  PSH $00000000
+00000012  SET @00000008 #1211111100000000
+0000001f  PSH $00000008
+00000024  SET @00000018 #1311111100000000
+00000031  PSH $00000018
+00000036  SET @00000028 #1411111100000000
+00000043  PSH $00000028
+00000048  SET @00000038 #1511111100000000
+00000055  PSH $00000038
+0000005a  SET @0000003a #1611111100000000
+00000067  PSH $0000003a
+0000006c  SET @0000003c #1711111100000000
+00000079  PSH $0000003c
+0000007e  SET @0000003e #1811111100000000
+0000008b  PSH $0000003e
+00000090  SET @00000001 #1911111100000000
+0000009d  PSH $00000001
+000000a2  SET @00000009 #1a11111100000000
+000000af  PSH $00000009
+000000b4  SET @00000019 #1b11111100000000
+000000c1  PSH $00000019
+000000c6  SET @00000029 #1c11111100000000
+000000d3  PSH $00000029
+000000d8  SET @00000039 #1d11111100000000
+000000e5  PSH $00000039
+000000ea  SET @0000003d #1e11111100000000
+000000f7  PSH $0000003d
+000000fc  SET @0000003e #1f11111100000000
+00000109  PSH $0000003e
+0000010e  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000000000000011111111100000000001080000000000000011111112100800000001180000000000000011111113101800
+0000012800000000000000111111141028000000013800000000000000111111151038000000013a000000000000001111111610
+3a000000013c0000000000000011111117103c000000013e0000000000000011111118103e000000010100000000000000111111
+1910010000000109000000000000001111111a10090000000119000000000000001111111b101900000001290000000000000011
+11111c10290000000139000000000000001111111d1039000000013d000000000000001111111e103d000000013e000000000000
+001111111f103e00000028
+
+Stacks Dump (Test 2):
+-------------------
+
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000370 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000380 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 1f 
+00000390 00 00 00 00 11 11 11 1e 00 00 00 00 11 11 11 1d 
+000003a0 00 00 00 00 11 11 11 1c 00 00 00 00 11 11 11 1b 
+000003b0 00 00 00 00 11 11 11 1a 00 00 00 00 11 11 11 19 
+000003c0 00 00 00 00 11 11 11 18 00 00 00 00 11 11 11 17 
+000003d0 00 00 00 00 11 11 11 16 00 00 00 00 11 11 11 15 
+000003e0 00 00 00 00 11 11 11 14 00 00 00 00 11 11 11 13 
+000003f0 00 00 00 00 11 11 11 12 00 00 00 00 11 11 11 11
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* PSH @00000040
+0000000d  FIN
+
+Machine Code (Test 3):
+-----------------------
+
+104000000028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #1111111100000000
+0000000d  PSH $00000000
+00000012  PSH $00000000
+00000017  PSH $00000000
+0000001c  PSH $00000000
+00000021  PSH $00000000
+00000026  PSH $00000000
+0000002b  PSH $00000000
+00000030  PSH $00000000
+00000035  PSH $00000000
+0000003a  PSH $00000000
+0000003f  PSH $00000000
+00000044  PSH $00000000
+00000049  PSH $00000000
+0000004e  PSH $00000000
+00000053  PSH $00000000
+00000058  PSH $00000000
+0000005d  PSH $00000000
+00000062  PSH $00000000
+00000067  PSH $00000000
+0000006c  PSH $00000000
+00000071  PSH $00000000
+00000076  PSH $00000000
+0000007b  PSH $00000000
+00000080  PSH $00000000
+00000085  PSH $00000000
+0000008a  PSH $00000000
+0000008f  PSH $00000000
+00000094  PSH $00000000
+00000099  PSH $00000000
+0000009e  PSH $00000000
+000000a3  PSH $00000000
+000000a8  PSH $00000000
+000000ad  PSH $00000000
+000000b2  FIN
+
+Machine Code (Test 4):
+-----------------------
+
+01000000000000000011111111100000000010000000001000000000100000000010000000001000000000100000000010000000
+00100000000010000000001000000000100000000010000000001000000000100000000010000000001000000000100000000010
+00000000100000000010000000001000000000100000000010000000001000000000100000000010000000001000000000100000
+0000100000000010000000001000000000100000000028
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_ret_sub.html b/docs/at_test_ret_sub.html new file mode 100644 index 0000000..9689724 --- /dev/null +++ b/docs/at_test_ret_sub.html @@ -0,0 +1,233 @@ + + + + +CIYAM AT - Test for AT instruction code 0x13 (RET_SUB) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x13 (RET_SUB)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage.
+Test 2 - Multiple RETs
+Test 3 - RET without JMP.
+Test 4 - 2-RET 1-JMP
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  JSR :00000020
+00000012  SET @00000000 #1111111111111111
+0000001f  FIN
+00000020  INC @00000000
+00000025  RET
+
+Machine Code (Test 1):
+----------------------
+
+0100000000000000000000000012200000000100000000111111111111111128040000000013
+
+Data Dump (Test 1):
+-------------------
+
+00000000  11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  JSR :00000018
+00000012  INC @00000000
+00000017  FIN
+00000018  SET @00000000 #1111111111111110
+00000025  JSR :0000002b
+0000002a  RET
+0000002b  SET @00000010 #0000000011111111
+00000038  RET
+
+Machine Code (Test 2):
+----------------------
+
+01000000000000000000000000121800000004000000002801000000001011111111111111122b00000013011000000011111111
+0000000013
+
+Data Dump (Test 2):
+-------------------
+
+00000000 11 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Stacks Dump (Test 2):
+-------------------
+
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000002f0 2a 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 
+00000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000370 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000003a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000003b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000003c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000003d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000003e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000003f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000  SET @00000000 #0000000000000000
+0000000d  JSR :00000019
+00000012  INC @00000000
+00000017* RET
+00000018  FIN
+00000019  SET @00000000 #1111111111111110
+00000026  JSR :0000002c
+0000002b  RET
+0000002c  SET @00000010 #0000000011111111
+00000039  RET
+
+Machine Code (Test 3):
+----------------------
+
+0100000000000000000000000012190000000400000000132801000000001011111111111111122c000000130110000000111111
+110000000013
+
+Runtime Error (Test 3):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000  SET @00000000 #0000000000000000
+00000012  INC @00000000
+00000017* RET
+00000018  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000000000000000000004000000001328
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_set_dat.html b/docs/at_test_set_dat.html new file mode 100644 index 0000000..0dc66e1 --- /dev/null +++ b/docs/at_test_set_dat.html @@ -0,0 +1,287 @@ + + + + +CIYAM AT - Test for AT instruction code 0x02 (SET_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x02 (SET_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage (odd addresses).
+Test 2 - Check full address range.
+Test 3 - Copying to address out of range.
+Test 4 - Copying from address out of range.
+Test 5 - Copying to address out of range.
+Test 6 - Copying from address out of range.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #1111111111111111
+0000000d  SET @00000001 $00000000
+0000001a  SET @00000003 $00000000
+00000027  SET @00000005 $00000000
+00000034  SET @00000007 $00000000
+00000041  SET @00000009 $00000000
+0000004e  SET @0000000b $00000000
+0000005b  SET @0000000d $00000000
+00000068  SET @0000000f $00000000
+00000075  SET @00000011 $00000000
+00000082  SET @00000013 $00000000
+0000008f  SET @00000015 $00000000
+0000009c  SET @00000017 $00000000
+000000a9  SET @00000019 $00000000
+000000b6  SET @0000001b $00000000
+000000c3  SET @0000001d $00000000
+000000d0  SET @0000001f $00000000
+000000dd  SET @00000021 $00000000
+000000ea  SET @00000023 $00000000
+000000f7  SET @00000025 $00000000
+00000104  SET @00000027 $00000000
+00000111  SET @00000029 $00000000
+0000011e  SET @0000002b $00000000
+0000012b  SET @0000002d $00000000
+00000138  SET @0000002f $00000000
+00000145  SET @00000031 $00000000
+00000152  SET @00000033 $00000000
+0000015f  SET @00000035 $00000000
+0000016c  SET @00000037 $00000000
+00000179  SET @00000039 $00000000
+00000186  SET @0000003b $00000000
+00000193  SET @0000003d $00000000
+000001a0  SET @0000003f $00000000
+000001ab  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000001111111111111111020100000000000000020300000000000000020500000000000000020700000000000000020900
+000000000000020b00000000000000020d00000000000000020f0000000000000002110000000000000002130000000000000002
+1500000000000000021700000000000000021900000000000000021b00000000000000021d00000000000000021f000000000000
+00022100000000000000022300000000000000022500000000000000022700000000000000022900000000000000022b00000000
+000000022d00000000000000022f0000000000000002310000000000000002330000000000000002350000000000000002370000
+0000000000023900000000000000023b00000000000000023d00000000000000023f0000000000000028
+
+
+Data Dump (Test 1):
+-------------------
+
+00000000 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 
+00000010 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000020 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000030 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000040 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000050 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000060 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000070 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000080 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000090 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000a0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000b0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000c0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000d0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000e0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000f0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000100 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000110 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000120 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000130 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000140 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000150 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000160 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000170 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000180 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000190 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001a0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001b0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001c0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001d0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001e0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001f0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000002 $00000000
+0000001a  SET @00000004 $00000002
+00000027  SET @00000006 $00000004
+00000034  SET @00000008 $00000006
+00000041  SET @0000000a $00000008
+0000004e  SET @0000000c $0000000a
+0000005b  SET @0000000e $0000000c
+00000068  SET @00000010 $0000000e
+00000075  SET @00000012 $00000010
+00000082  SET @00000014 $00000012
+0000008f  SET @00000016 $00000014
+0000009c  SET @00000018 $00000016
+000000a9  SET @0000001a $00000018
+000000b6  SET @0000001c $0000001a
+000000c3  SET @0000001e $0000001c
+000000d0  SET @00000020 $0000001e
+000000dd  SET @00000022 $00000020
+000000ea  SET @00000024 $00000022
+000000f7  SET @00000026 $00000024
+00000104  SET @00000028 $00000026
+00000111  SET @0000002a $00000028
+0000011e  SET @0000002c $0000002a
+0000012b  SET @0000002e $0000002c
+00000138  SET @00000030 $0000002e
+00000145  SET @00000032 $00000030
+00000152  SET @00000034 $00000034
+0000015f  SET @00000036 $00000036
+0000016c  SET @00000038 $00000038
+00000179  SET @0000003a $0000003a
+00000186  SET @0000003c $0000003c
+00000193  SET @0000003e $0000003e
+000001ab  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000ffffffffffffffff020200000000000000020400000002000000020600000004000000020800000006000000020a00
+000008000000020c0000000a000000020e0000000c00000002100000000e00000002120000001000000002140000001200000002
+1600000014000000021800000016000000021a00000018000000021c0000001a000000021e0000001c00000002200000001e0000
+00022200000020000000022400000022000000022600000024000000022800000026000000022a00000028000000022c0000002a
+000000022e0000002c00000002300000002e00000002320000003000000002340000003200000002360000003400000002380000
+0036000000023a00000038000000023c0000003a000000023e0000003c00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000010 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000040 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000050 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000060 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000070 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000b0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000c0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000d0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000e0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000f0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000100 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000130 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000140 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000150 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000160 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000170 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000180 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000190 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001c0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001d0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001e0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001f0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000040 $00000000
+0000001a  FIN
+
+Machine Code (Test 3):
+-----------------------
+
+0100000000ffffffffffffffff02400000000000000028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: overflow
+
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000000 $00000040
+0000001a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000ffffffffffffffff02020000004000000028
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @ffffffff $00000000
+0000001a  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000ffffffffffffffff02ffffffff0000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000000 $ffffffff
+0000001a  FIN
+
+Machine Code (Test 6):
+----------------------
+
+0100000000ffffffffffffffff020200000ffffffff028
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_set_idx.html b/docs/at_test_set_idx.html new file mode 100644 index 0000000..9e3dff1 --- /dev/null +++ b/docs/at_test_set_idx.html @@ -0,0 +1,270 @@ + + + + +CIYAM AT - Test for AT instruction code 0x0f (SET_IDX) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x0f (SET_IDX)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage
+Test 2 - Check some basic usage (continue)
+Test 3 - Addr1 out of range (addr2+addr3)
+Test 4 - Addr2 out of range
+Test 5 - Addr3 out of range
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000011111111
+0000001a  SET @00000002 #0000000000000001
+00000027  SET @00000003 $($00000000+$00000002)
+00000034  SET @00000004 #0000000000000004
+00000041  SET @00000005 #0000000011111111
+0000004e  SET @00000006 #0000000000000001
+0000005b  SET @00000007 $($00000004+$00000006)
+00000068  SET @00000008 #0000000000000008
+00000075  SET @00000009 #0000000011111111
+00000082  SET @0000000a #0000000000000001
+0000008f  SET @0000000b $($00000008+$0000000a)
+0000009c  SET @0000000c #000000000000000c
+000000a9  SET @0000000d #0000000011111111
+000000b6  SET @0000000e #0000000000000001
+000000c3  SET @0000000f $($0000000c+$0000000e)
+000000d0  SET @00000010 #0000000000000010
+000000dd  SET @00000011 #0000000011111111
+000000ea  SET @00000012 #0000000000000001
+000000f7  SET @00000013 $($00000010+$00000012)
+00000104  SET @00000014 #0000000000000014
+00000111  SET @00000015 #0000000011111111
+0000011e  SET @00000016 #0000000000000001
+0000012b  SET @00000017 $($00000014+$00000016)
+00000138  SET @00000018 #0000000000000018
+00000145  SET @00000019 #0000000011111111
+00000152  SET @0000001a #0000000000000001
+0000015f  SET @0000001b $($00000018+$0000001a)
+0000016c  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000000000000000000001010000001111111100000000010200000001000000000000000f030000000000000002000000
+0104000000040000000000000001050000001111111100000000010600000001000000000000000f070000000400000006000000
+0108000000080000000000000001090000001111111100000000010a00000001000000000000000f0b000000080000000a000000
+010c0000000c00000000000000010d0000001111111100000000010e00000001000000000000000f0f0000000c0000000e000000
+0110000000100000000000000001110000001111111100000000011200000001000000000000000f130000001000000012000000
+0114000000140000000000000001150000001111111100000000011600000001000000000000000f170000001400000016000000
+0118000000180000000000000001190000001111111100000000011a00000001000000000000000f1b000000180000001a000000
+28
+
+Data Dump (Test 1):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000010 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000020 04 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000030 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000040 08 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000060 0c 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000070 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000080 10 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000090 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000000a0 14 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000000b0 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000000c0 18 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000000d0 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @0000001c #000000000000001c
+0000000d  SET @0000001d #0000000011111111
+0000001a  SET @0000001e #0000000000000001
+00000027  SET @0000001f $($0000001c+$0000001e)
+00000034  SET @00000020 #0000000000000020
+00000041  SET @00000021 #0000000011111111
+0000004e  SET @00000022 #0000000000000001
+0000005b  SET @00000023 $($00000020+$00000022)
+00000068  SET @00000024 #0000000000000024
+00000075  SET @00000025 #0000000011111111
+00000082  SET @00000026 #0000000000000001
+0000008f  SET @00000027 $($00000024+$00000026)
+0000009c  SET @00000028 #0000000000000028
+000000a9  SET @00000029 #0000000011111111
+000000b6  SET @0000002a #0000000000000001
+000000c3  SET @0000002b $($00000028+$0000002a)
+000000d0  SET @0000002c #000000000000002c
+000000dd  SET @0000002d #0000000011111111
+000000ea  SET @0000002e #0000000000000001
+000000f7  SET @0000002f $($0000002c+$0000002e)
+00000104  SET @00000030 #0000000000000030
+00000111  SET @00000031 #0000000011111111
+0000011e  SET @00000032 #0000000000000001
+0000012b  SET @00000033 $($00000030+$00000032)
+00000138  SET @00000034 #0000000000000034
+00000145  SET @00000035 #0000000011111111
+00000152  SET @00000036 #0000000000000001
+0000015f  SET @00000037 $($00000034+$00000036)
+0000016c  SET @00000038 #0000000000000038
+00000179  SET @00000039 #0000000011111111
+00000186  SET @0000003a #0000000000000001
+00000193  SET @0000003b $($0000003a+$00000038)
+000001a0  FIN
+
+Machine Code (Test 2):
+----------------------
+
+011c0000001c00000000000000011d0000001111111100000000011e00000001000000000000000f1f0000001c0000001e000000
+0120000000200000000000000001210000001111111100000000012200000001000000000000000f230000002000000022000000
+0124000000240000000000000001250000001111111100000000012600000001000000000000000f270000002400000026000000
+0128000000280000000000000001290000001111111100000000012a00000001000000000000000f2b000000280000002a000000
+012c0000002c00000000000000012d0000001111111100000000012e00000001000000000000000f2f0000002c0000002e000000
+0130000000300000000000000001310000001111111100000000013200000001000000000000000f330000003000000032000000
+0134000000340000000000000001350000001111111100000000013600000001000000000000000f370000003400000036000000
+0138000000380000000000000001390000001111111100000000013a00000001000000000000000f3b0000003a00000038000000
+28
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 1c 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000000f0 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000100 20 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000110 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000120 24 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000130 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000140 28 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000150 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000160 2c 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000170 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000180 30 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000190 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000001a0 34 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000001b0 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000001c0 38 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000001d0 01 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #000000000000003f
+0000000d  SET @00000001 #0000000000000001
+0000001a  SET @00000002 $($00000001+$00000000)
+00000027  FIN
+
+Machine Code (Test 3):
+-----------------------
+
+01000000003f00000000000000010100000001000000000000000f02000000010000000000000028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000  SET @00000000 #0000000000000040
+0000000d  SET @00000001 #0000000000000001
+0000001a* SET @00000002 $($00000001+$00000000)
+00000027  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000004000000000000000010100000001000000000000000f02000000010000000000000028
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #000000000000003a
+0000000d  SET @00000001 #0000000000000040
+0000001a  SET @00000002 $($00000001+$00000000)
+00000027  FIN
+
+Machine Code (Test 5):
+----------------------
+
+01000000003a00000000000000010100000040000000000000000f02000000010000000000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_set_ind.html b/docs/at_test_set_ind.html new file mode 100644 index 0000000..cd61684 --- /dev/null +++ b/docs/at_test_set_ind.html @@ -0,0 +1,287 @@ + + + + +CIYAM AT - Test for AT instruction code 0x0e (SET_IND) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x0e (SET_IND)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+Test 1 - Check some basic usage (odd addresses).
+Test 2 - Check full address range.
+Test 3 - Copying to address out of range.
+Test 4 - Copying from address out of range.
+Test 5 - Copying to address out of range.
+Test 6 - Copying from address out of range.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000002f
+0000000d  SET @0000002f #1111111111111111
+0000001a  SET @00000001 $($00000000)
+00000023  SET @00000003 $($00000000)
+0000002c  SET @00000005 $($00000000)
+00000035  SET @00000007 $($00000000)
+0000003e  SET @00000009 $($00000000)
+00000047  SET @0000000b $($00000000)
+00000050  SET @0000000d $($00000000)
+00000059  SET @0000000f $($00000000)
+00000062  SET @00000011 $($00000000)
+0000006b  SET @00000013 $($00000000)
+00000074  SET @00000015 $($00000000)
+0000007d  SET @00000017 $($00000000)
+00000086  SET @00000019 $($00000000)
+0000008f  SET @0000001b $($00000000)
+00000098  SET @0000001d $($00000000)
+000000a1  SET @0000001f $($00000000)
+000000aa  SET @00000021 $($00000000)
+000000b3  SET @00000023 $($00000000)
+000000bc  SET @00000025 $($00000000)
+000000c5  SET @00000027 $($00000000)
+000000ce  SET @00000029 $($00000000)
+000000d7  SET @0000002b $($00000000)
+000000e0  SET @0000002d $($00000000)
+000000e9  SET @0000002f $($00000000)
+000000f2  SET @00000031 $($00000000)
+000000fb  SET @00000033 $($00000000)
+00000104  SET @00000035 $($00000000)
+0000010d  SET @00000037 $($00000000)
+00000116  SET @00000039 $($00000000)
+0000011f  SET @0000003b $($00000000)
+00000128  SET @0000003d $($00000000)
+00000131  SET @0000003f $($00000000)
+0000013a  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000002f00000000000000012f00000011111111111111110e01000000000000000e03000000000000000e05000000000000
+000e07000000000000000e09000000000000000e0b000000000000000e0d000000000000000e0f000000000000000e1100000000
+0000000e13000000000000000e15000000000000000e17000000000000000e19000000000000000e1b000000000000000e1d0000
+00000000000e1f000000000000000e21000000000000000e23000000000000000e25000000000000000e27000000000000000e29
+000000000000000e2b000000000000000e2d000000000000000e2f000000000000000e31000000000000000e3300000000000000
+0e35000000000000000e37000000000000000e39000000000000000e3b000000000000000e3d000000000000000e3f0000000000
+000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 2f 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000010 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000020 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000030 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000040 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000050 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000060 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000070 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000080 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000090 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000a0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000b0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000c0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000d0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000e0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000000f0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000100 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000110 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000120 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000130 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000140 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000150 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000160 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000170 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000180 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+00000190 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001a0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001b0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001c0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001d0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001e0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+000001f0 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000022
+0000000d  SET @00000002 $($00000000)
+00000016  SET @00000004 $($00000002)
+0000001f  SET @00000006 $($00000004)
+00000028  SET @00000008 $($00000006)
+00000031  SET @0000000a $($00000008)
+0000003a  SET @0000000c $($0000000a)
+00000043  SET @0000000e $($0000000c)
+0000004c  SET @00000010 $($0000000e)
+00000055  SET @00000012 $($00000010)
+0000005e  SET @00000014 $($00000012)
+00000067  SET @00000016 $($00000014)
+00000070  SET @00000018 $($00000016)
+00000079  SET @0000001a $($00000018)
+00000082  SET @0000001c $($0000001a)
+0000008b  SET @0000001e $($0000001c)
+00000094  SET @00000020 $($0000001e)
+0000009d  SET @00000022 $($00000020)
+000000a6  SET @00000024 $($00000022)
+000000af  SET @00000026 $($00000024)
+000000b8  SET @00000028 $($00000026)
+000000c1  SET @0000002a $($00000028)
+000000ca  SET @0000002c $($0000002a)
+000000d3  SET @0000002e $($0000002c)
+000000dc  SET @00000030 $($0000002e)
+000000e5  SET @00000032 $($00000030)
+000000ee  SET @00000034 $($00000032)
+000000f7  SET @00000036 $($00000034)
+00000100  SET @00000038 $($00000036)
+00000109  SET @0000003a $($00000038)
+00000112  SET @0000003c $($0000003a)
+0000011b  SET @0000003e $($0000003c)
+00000124  FIN
+
+Machine Code (Test 2):
+----------------------
+
+010000000022000000000000000e02000000000000000e04000000020000000e06000000040000000e08000000060000000e0a00
+0000080000000e0c0000000a0000000e0e0000000c0000000e100000000e0000000e12000000100000000e14000000120000000e
+16000000140000000e18000000160000000e1a000000180000000e1c0000001a0000000e1e0000001c0000000e200000001e0000
+000e22000000200000000e24000000220000000e26000000240000000e28000000260000000e2a000000280000000e2c0000002a
+0000000e2e0000002c0000000e300000002e0000000e32000000300000000e34000000320000000e36000000340000000e380000
+00360000000e3a000000380000000e3c0000003a0000000e3e0000003c00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* IDN @00000000 #ffffffffffffffff
+0000000d  IDN @00000040 @00000000
+0000001a  FIN
+
+Machine Code (Test 3):
+-----------------------
+
+0100000000ffffffffffffffff0e400000000000000028
+
+Runtime Error (Test 3):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000040 $($00000000)
+00000016  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000ffffffffffffffff0e000000004000000028
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @ffffffff $($00000000)
+00000016  FIN
+
+Machine Code (Test 5):
+----------------------
+
+0100000000ffffffffffffffff0effffffff0000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* IDN @00000000 #ffffffffffffffff
+0000000d  IDN @00000000 @ffffffff
+0000001a  FIN
+
+Machine Code (Test 6):
+----------------------
+
+0100000000ffffffffffffffff0e00000000ffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_set_pcs.html b/docs/at_test_set_pcs.html new file mode 100644 index 0000000..305e11b --- /dev/null +++ b/docs/at_test_set_pcs.html @@ -0,0 +1,130 @@ + + + + +CIYAM AT - Test for AT instruction code 0x30 (SET_PCS) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x30 (SET_PCS)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Basic usage.
+Test 2 - Only SET_PCS.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000  SET @00000000 #0000000011111111
+0000000d  PCS
+0000000e  SET @00000000 #0000000022222222
+0000001b  PCS
+0000001c  PCS
+0000001d  FIN
+
+Machine Code (Test 1):
+----------------------
+
+010000000011111111000000003001000000002222222200000000303028
+
+State (Test 1):
+---------------
+
+pc: 0000001d
+cs: 0
+us: 0
+pcs: 0000001d
+steps: 6
+
+Data Dump (Test 1):
+-------------------
+
+00000000  22 22 22 22 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* PCS
+00000001  PCS
+00000002  PCS
+00000003  PCS
+00000004  FIN
+
+Machine Code (Test 2):
+----------------------
+
+3030303028
+
+State (Test 2):
+---------------
+
+pc: 00000004
+cs: 0
+us: 0
+pcs: 00000004
+steps: 5
+
+
+
+
+ + + + + + diff --git a/docs/at_test_set_val.html b/docs/at_test_set_val.html new file mode 100644 index 0000000..66a98d5 --- /dev/null +++ b/docs/at_test_set_val.html @@ -0,0 +1,432 @@ + + + + +CIYAM AT - Test for AT instruction code 0x01 (SET_VAL) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x01 (SET_VAL)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000000000001
+0000001a  SET @00000002 #0000000000000002
+00000027  SET @00000003 #0000000000000003
+00000034  SET @00000004 #0000000000000004
+00000041  SET @00000005 #0000000000000005
+0000004e  SET @00000006 #0000000000000006
+0000005b  SET @00000007 #0000000000000007
+00000068  SET @00000008 #0000000000000008
+00000075  SET @00000009 #0000000000000009
+00000082  SET @0000000a #000000000000000a
+0000008f  SET @0000000b #000000000000000b
+0000009c  SET @0000000c #000000000000000c
+000000a9  SET @0000000d #000000000000000d
+000000b6  SET @0000000e #000000000000000e
+000000c3  SET @0000000f #000000000000000f
+000000d0  SET @00000010 #0000000000000010
+000000dd  SET @00000011 #0000000000000011
+000000ea  SET @00000012 #0000000000000012
+000000f7  SET @00000013 #0000000000000013
+00000104  SET @00000014 #0000000000000014
+00000111  SET @00000015 #0000000000000015
+0000011e  SET @00000016 #0000000000000016
+0000012b  SET @00000017 #0000000000000017
+00000138  SET @00000018 #0000000000000018
+00000145  SET @00000019 #0000000000000019
+00000152  SET @0000001a #000000000000001a
+0000015f  SET @0000001b #000000000000001b
+0000016c  SET @0000001c #000000000000001c
+00000179  SET @0000001d #000000000000001d
+00000186  SET @0000001e #000000000000001e
+00000193  SET @0000001f #000000000000001f
+000001a0  SET @00000020 #0000000000000020
+000001ad  SET @00000021 #0000000000000021
+000001ba  SET @00000022 #0000000000000022
+000001c7  SET @00000023 #0000000000000023
+000001d4  SET @00000024 #0000000000000024
+000001e1  SET @00000025 #0000000000000025
+000001ee  SET @00000026 #0000000000000026
+000001fb  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000010100000001000000000000000102000000020000000000000001030000000300000000000000
+01040000000400000000000000010500000005000000000000000106000000060000000000000001070000000700000000000000
+0108000000080000000000000001090000000900000000000000010a0000000a00000000000000010b0000000b00000000000000
+010c0000000c00000000000000010d0000000d00000000000000010e0000000e00000000000000010f0000000f00000000000000
+01100000001000000000000000011100000011000000000000000112000000120000000000000001130000001300000000000000
+01140000001400000000000000011500000015000000000000000116000000160000000000000001170000001700000000000000
+0118000000180000000000000001190000001900000000000000011a0000001a00000000000000011b0000001b00000000000000
+011c0000001c00000000000000011d0000001d00000000000000011e0000001e00000000000000011f0000001f00000000000000
+01200000002000000000000000012100000021000000000000000122000000220000000000000001230000002300000000000000
+01240000002400000000000000012500000025000000000000000126000000260000000000000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000  00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+00000010  02 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00
+00000020  04 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00
+00000030  06 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00
+00000040  08 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00
+00000050  0a 00 00 00 00 00 00 00 0b 00 00 00 00 00 00 00
+00000060  0c 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00
+00000070  0e 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00
+00000080  10 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00
+00000090  12 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00
+000000a0  14 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00
+000000b0  16 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00
+000000c0  18 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00
+000000d0  1a 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00
+000000e0  1c 00 00 00 00 00 00 00 1d 00 00 00 00 00 00 00
+000000f0  1e 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00
+00000100  20 00 00 00 00 00 00 00 21 00 00 00 00 00 00 00
+00000110  22 00 00 00 00 00 00 00 23 00 00 00 00 00 00 00
+00000120  24 00 00 00 00 00 00 00 25 00 00 00 00 00 00 00
+00000130  26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #ffffffffffffffff
+0000000d  SET @00000001 #ffffffffffffffff
+0000001a  SET @00000004 #ffffffffffffffff
+00000027  SET @00000005 #ffffffffffffffff
+00000034  SET @00000008 #ffffffffffffffff
+00000041  SET @00000009 #ffffffffffffffff
+0000004e  SET @0000000c #ffffffffffffffff
+0000005b  SET @0000000d #ffffffffffffffff
+00000068  SET @00000010 #ffffffffffffffff
+00000075  SET @00000011 #ffffffffffffffff
+00000082  SET @00000014 #ffffffffffffffff
+0000008f  SET @00000015 #ffffffffffffffff
+0000009c  SET @00000018 #ffffffffffffffff
+000000a9  SET @00000019 #ffffffffffffffff
+000000b6  SET @0000001c #ffffffffffffffff
+000000c3  SET @0000001d #ffffffffffffffff
+000000d0  SET @00000020 #ffffffffffffffff
+000000dd  SET @00000021 #ffffffffffffffff
+000000ea  SET @00000024 #ffffffffffffffff
+000000f7  SET @00000025 #ffffffffffffffff
+00000104  SET @00000028 #ffffffffffffffff
+00000111  SET @00000029 #ffffffffffffffff
+0000011e  SET @0000002c #ffffffffffffffff
+0000012b  SET @0000002d #ffffffffffffffff
+00000138  SET @00000030 #ffffffffffffffff
+00000145  SET @00000031 #ffffffffffffffff
+00000152  SET @00000034 #ffffffffffffffff
+0000015f  SET @00000035 #ffffffffffffffff
+0000016c  SET @00000038 #ffffffffffffffff
+00000179  SET @00000039 #ffffffffffffffff
+00000186  SET @0000003c #ffffffffffffffff
+00000193  SET @0000003d #ffffffffffffffff
+000001a0  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0100000000ffffffffffffffff0101000000ffffffffffffffff0104000000ffffffffffffffff0105000000ffffffffffffffff
+0108000000ffffffffffffffff0109000000ffffffffffffffff010c000000ffffffffffffffff010d000000ffffffffffffffff
+0110000000ffffffffffffffff0111000000ffffffffffffffff0114000000ffffffffffffffff0115000000ffffffffffffffff
+0118000000ffffffffffffffff0119000000ffffffffffffffff011c000000ffffffffffffffff011d000000ffffffffffffffff
+0120000000ffffffffffffffff0121000000ffffffffffffffff0124000000ffffffffffffffff0125000000ffffffffffffffff
+0128000000ffffffffffffffff0129000000ffffffffffffffff012c000000ffffffffffffffff012d000000ffffffffffffffff
+0130000000ffffffffffffffff0131000000ffffffffffffffff0134000000ffffffffffffffff0135000000ffffffffffffffff
+0138000000ffffffffffffffff0139000000ffffffffffffffff013c000000ffffffffffffffff013d000000ffffffffffffffff
+28
+
+Data Dump (Test 2):
+-------------------
+
+00000000  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0123456789abcdef
+0000000d  SET @00000005 #0123456789abcdef
+0000001a  SET @00000008 #0123456789abcdef
+00000027  SET @0000000d #0123456789abcdef
+00000034  SET @00000010 #0123456789abcdef
+00000041  SET @00000015 #0123456789abcdef
+0000004e  SET @00000018 #0123456789abcdef
+0000005b  SET @0000001d #0123456789abcdef
+00000068  SET @00000020 #0123456789abcdef
+00000075  SET @00000025 #0123456789abcdef
+00000082  SET @00000028 #0123456789abcdef
+0000008f  SET @0000002d #0123456789abcdef
+0000009c  SET @00000030 #0123456789abcdef
+000000a9  SET @00000035 #0123456789abcdef
+000000b6  SET @00000038 #0123456789abcdef
+000000c3  SET @0000003d #0123456789abcdef
+000000d0  FIN
+
+Machine Code (Test 3):
+----------------------
+
+0100000000efcdab89674523010105000000efcdab89674523010108000000efcdab8967452301010d000000efcdab8967452301
+0110000000efcdab89674523010115000000efcdab89674523010118000000efcdab8967452301011d000000efcdab8967452301
+0120000000efcdab89674523010125000000efcdab89674523010128000000efcdab8967452301012d000000efcdab8967452301
+0130000000efcdab89674523010135000000efcdab89674523010138000000efcdab8967452301013d000000efcdab8967452301
+28
+
+Data Dump (Test 3):
+-------------------
+
+00000000  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  ef cd ab 89 67 45 23 01 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 ef cd ab 89 67 45 23 01
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000000 #ffffffffffffffff
+0000001a  SET @00000000 #1111111111111111
+00000027  SET @00000001 #2222222222222222
+00000034  SET @00000010 #0000000000000000
+00000041  SET @00000010 #ffffffffffffffff
+0000004e  SET @00000010 #3333333333333333
+0000005b  SET @00000011 #4444444444444444
+00000068  SET @00000020 #0000000000000000
+00000075  SET @00000020 #ffffffffffffffff
+00000082  SET @00000020 #5555555555555555
+0000008f  SET @00000021 #6666666666666666
+0000009c  SET @00000030 #0000000000000000
+000000a9  SET @00000030 #ffffffffffffffff
+000000b6  SET @00000030 #7777777777777777
+000000c3  SET @00000031 #8888888888888888
+000000d0  FIN
+
+Machine Code (Test 4):
+----------------------
+
+010000000000000000000000000100000000ffffffffffffffff0100000000111111111111111101010000002222222222222222
+011000000000000000000000000110000000ffffffffffffffff0110000000333333333333333301110000004444444444444444
+012000000000000000000000000120000000ffffffffffffffff0120000000555555555555555501210000006666666666666666
+013000000000000000000000000130000000ffffffffffffffff0130000000777777777777777701310000008888888888888888
+28
+
+Data Dump (Test 4):
+-------------------
+
+00000000  11 11 11 11 11 11 11 11 22 22 22 22 22 22 22 22
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  33 33 33 33 33 33 33 33 44 44 44 44 44 44 44 44
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  55 55 55 55 55 55 55 55 66 66 66 66 66 66 66 66
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  77 77 77 77 77 77 77 77 88 88 88 88 88 88 88 88
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003f #1111111111111111
+0000000d  SET @00000040 #1111111111111111
+0000001a  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013f00000011111111111111110140000000111111111111111128
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* SET @ffffffff #1111111111111111
+0000000d  FIN
+
+Machine Code (Test 6):
+----------------------
+
+01ffffffff111111111111111128
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_stp_imd.html b/docs/at_test_stp_imd.html new file mode 100644 index 0000000..93ab97a --- /dev/null +++ b/docs/at_test_stp_imd.html @@ -0,0 +1,104 @@ + + + + +CIYAM AT - Test for AT instruction code 0x29 (STP_IMD) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x29 (STP_IMD)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Basic usage.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000011111111
+0000000d  STZ $00000000
+00000012  SET @00000000 #0000000000000000
+0000001f  STP
+
+Machine Code (Test 1):
+----------------------
+
+0100000000111111110000000027000000000100000000000000000000000029
+
+Data Dump (Test 1):
+-------------------
+
+00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+State Info (Test 1):
+--------------------
+
+pc: 0000001f
+cs: 0
+us: 0
+pcs: 00000000
+steps: 4
+
+
+
+
+ + + + + + diff --git a/docs/at_test_stz_dat.html b/docs/at_test_stz_dat.html new file mode 100644 index 0000000..945bc1e --- /dev/null +++ b/docs/at_test_stz_dat.html @@ -0,0 +1,124 @@ + + + + +CIYAM AT - Test for AT instruction code 0x27 (STZ_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x27 (STZ_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Basic usage.
+Test 2 - Jump to not existing address.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000011111111
+0000000d  STZ $00000000
+00000012  SET @00000000 #0000000000000000
+0000001f  STZ $00000000
+00000024  SET @00000000 #0000000011111111
+00000031  FIN
+
+Machine Code (Test 1):
+----------------------
+
+0100000000111111110000000027000000000100000000000000000000000027000000000100000000111111110000000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+State Info (Test 1):
+--------------------
+
+pc: 0000001f
+cs: 0
+us: 0
+pcs: 00000000
+steps: 4
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000011111111
+0000000d  STZ $11111111
+00000012  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000001111111100000000271111111128
+
+Runtime Error (Test 2):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_sub_dat.html b/docs/at_test_sub_dat.html new file mode 100644 index 0000000..633e587 --- /dev/null +++ b/docs/at_test_sub_dat.html @@ -0,0 +1,474 @@ + + + + +CIYAM AT - Test for AT instruction code 0x07 (SUB_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x07 (SUB_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  SET @0000000f #0000000000000000
+000000d0  SUB @00000000 $00000001
+000000d9  SUB @00000001 $00000002
+000000e2  SUB @00000002 $00000003
+000000eb  SUB @00000003 $00000004
+000000f4  SUB @00000004 $00000005
+000000fd  SUB @00000005 $00000006
+00000106  SUB @00000006 $00000007
+0000010f  SUB @00000007 $00000008
+00000118  SUB @00000008 $00000009
+00000121  SUB @00000009 $0000000a
+0000012a  SUB @0000000a $0000000b
+00000133  SUB @0000000b $0000000c
+0000013c  SUB @0000000c $0000000d
+00000145  SUB @0000000d $0000000e
+0000014e  SUB @0000000e $0000000f
+00000157  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e0000000100000000000000010f0000000000000000000000
+07000000000100000007010000000200000007020000000300000007030000000400000007040000000500000007050000000600
+000007060000000700000007070000000800000007080000000900000007090000000a000000070a0000000b000000070b000000
+0c000000070c0000000d000000070d0000000e000000070e0000000f00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000010 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000020 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000030 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000040 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000060 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000070 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #0000000000000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #0000000000000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #0000000000000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #0000000000000000
+00000111  SUB @00000001 $00000004
+0000011a  SUB @00000004 $00000007
+00000123  SUB @00000007 $0000000a
+0000012c  SUB @0000000a $0000000d
+00000135  SUB @0000000d $00000010
+0000013e  SUB @00000010 $00000013
+00000147  SUB @00000013 $00000016
+00000150  SUB @00000016 $00000019
+00000159  SUB @00000019 $0000001c
+00000162  SUB @0000001c $0000001f
+0000016b  SUB @0000001f $00000022
+00000174  SUB @00000022 $00000025
+0000017d  SUB @00000025 $00000028
+00000186  SUB @00000028 $0000002b
+0000018f  SUB @0000002b $0000002e
+00000198  SUB @0000002e $00000031
+000001a1  SUB @00000031 $00000034
+000001aa  SUB @00000034 $00000037
+000001b3  SUB @00000037 $0000003a
+000001bc  SUB @0000003a $0000003d
+000001c5  SUB @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff01070000000000000000000000010a000000ffffffffffffffff
+010d000000ffffffffffffffff011000000000000000000000000113000000ffffffffffffffff0116000000ffffffffffffffff
+01190000000000000000000000011c000000ffffffffffffffff011f000000ffffffffffffffff01220000000000000000000000
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b0000000000000000000000012e000000ffffffffffffffff
+0131000000ffffffffffffffff013400000000000000000000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d000000000000000000000007010000000400000007040000000700000007070000000a000000070a0000000d000000070d00
+00001000000007100000001300000007130000001600000007160000001900000007190000001c000000071c0000001f00000007
+1f0000002200000007220000002500000007250000002800000007280000002b000000072b0000002e000000072e000000310000
+0007310000003400000007340000003700000007370000003a000000073a0000003d000000073d0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #debc9a7856341200
+0000001a  SET @00000007 #cdab896745230100
+00000027  SET @0000000a #bc9a785634120000
+00000034  SET @0000000d #ab89674523010000
+00000041  SET @00000010 #9a78563412000000
+0000004e  SET @00000013 #8967452301000000
+0000005b  SET @00000016 #7856341200000000
+00000068  SET @00000019 #6745230100000000
+00000075  SET @0000001c #5634120000000000
+00000082  SET @0000001f #4523010000000000
+0000008f  SET @00000022 #efcdab8967452301
+0000009c  SET @00000025 #debc9a7856341200
+000000a9  SET @00000028 #cdab896745230100
+000000b6  SET @0000002b #bc9a785634120000
+000000c3  SET @0000002e #ab89674523010000
+000000d0  SET @00000031 #9a78563412000000
+000000dd  SET @00000034 #8967452301000000
+000000ea  SET @00000037 #7856341200000000
+000000f7  SET @0000003a #6745230100000000
+00000104  SET @0000003d #5634120000000000
+00000111  SUB @00000001 $00000004
+0000011a  SUB @00000004 $00000007
+00000123  SUB @00000007 $0000000a
+0000012c  SUB @0000000a $0000000d
+00000135  SUB @0000000d $00000010
+0000013e  SUB @00000010 $00000013
+00000147  SUB @00000013 $00000016
+00000150  SUB @00000016 $00000019
+00000159  SUB @00000019 $0000001c
+00000162  SUB @0000001c $0000001f
+0000016b  SUB @0000001f $00000022
+00000174  SUB @00000022 $00000025
+0000017d  SUB @00000025 $00000028
+00000186  SUB @00000028 $0000002b
+0000018f  SUB @0000002b $0000002e
+00000198  SUB @0000002e $00000031
+000001a1  SUB @00000031 $00000034
+000001aa  SUB @00000034 $00000037
+000001b3  SUB @00000037 $0000003a
+000001bc  SUB @0000003a $0000003d
+000001c5  SUB @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef010400000000123456789abcde0107000000000123456789abcd010a0000000000123456789abc
+010d00000000000123456789ab0110000000000000123456789a0113000000000000012345678901160000000000000012345678
+01190000000000000001234567011c0000000000000000123456011f000000000000000001234501220000000123456789abcdef
+012500000000123456789abcde0128000000000123456789abcd012b0000000000123456789abc012e00000000000123456789ab
+0131000000000000123456789a0134000000000000012345678901370000000000000012345678013a0000000000000001234567
+013d000000000000000012345607010000000400000007040000000700000007070000000a000000070a0000000d000000070d00
+00001000000007100000001300000007130000001600000007160000001900000007190000001c000000071c0000001f00000007
+1f0000002200000007220000002500000007250000002800000007280000002b000000072b0000002e000000072e000000310000
+0007310000003400000007340000003700000007370000003a000000073a0000003d000000073d0000003d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 01 11 11 11 11 11 11 11 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 01 11 11 11 11 11 11 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 11 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 01 11 11 11 11 11 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 01 11 11 11 11 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 11 11 11 11 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 01 11 11 11 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 11 11 11 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 ff dc ba 98 76 55 55 55 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 01 11 11 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 01 11 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 11 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 01 11 11 11 11 11 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 11 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 01 11 11 11 11 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 01 11 11 11 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #cccccccccccccccc
+0000000d  SET @00000001 #4444444444444444
+0000001a  SET @00000002 #4444444444444444
+00000027  SET @00000010 #dddddddddddddddd
+00000034  SET @00000011 #3333333333333333
+00000041  SET @00000012 #4444444444444444
+0000004e  SET @00000020 #cccccccccccccccc
+0000005b  SET @00000021 #2222222222222222
+00000068  SET @00000022 #4444444444444444
+00000075  SET @00000030 #9999999999999999
+00000082  SET @00000031 #1111111111111111
+0000008f  SET @00000032 #4444444444444444
+0000009c  SUB @00000000 $00000001
+000000a5  SUB @00000000 $00000001
+000000ae  SUB @00000010 $00000011
+000000b7  SUB @00000010 $00000011
+000000c0  SUB @00000010 $00000011
+000000c9  SUB @00000020 $00000021
+000000d2  SUB @00000020 $00000021
+000000db  SUB @00000020 $00000021
+000000e4  SUB @00000020 $00000021
+000000ed  SUB @00000030 $00000031
+000000f6  SUB @00000030 $00000031
+000000ff  SUB @00000030 $00000031
+00000108  SUB @00000030 $00000031
+00000111  SUB @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+0100000000cccccccccccccccc01010000004444444444444444010200000044444444444444440110000000dddddddddddddddd
+01110000003333333333333333011200000044444444444444440120000000cccccccccccccccc01210000002222222222222222
+01220000004444444444444444013000000099999999999999990131000000111111111111111101320000004444444444444444
+07000000000100000007000000000100000007100000001100000007100000001100000007100000001100000007200000002100
+00000720000000210000000720000000210000000720000000210000000730000000310000000730000000310000000730000000
+3100000007300000003100000007300000003100000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 
+00000010 44 44 44 44 44 44 44 44 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 44 44 44 44 44 44 44 44 33 33 33 33 33 33 33 33 
+00000090 44 44 44 44 44 44 44 44 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 44 44 44 44 44 44 44 44 22 22 22 22 22 22 22 22 
+00000110 44 44 44 44 44 44 44 44 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 44 44 44 44 44 44 44 44 11 11 11 11 11 11 11 11 
+00000190 44 44 44 44 44 44 44 44 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #ffffffffffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  SUB @0000003e $0000003f
+00000023  SUB @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffffffffffff013f000000ffffffffffffffff073e0000003f000000073f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff  
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* SUB @ffffffff $ffffffff
+00000009  FIN
+
+Machine Code (Test 6):
+----------------------
+
+07ffffffffffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_sub_leq.html b/docs/at_test_sub_leq.html new file mode 100644 index 0000000..6fcf610 --- /dev/null +++ b/docs/at_test_sub_leq.html @@ -0,0 +1,195 @@ + + + + +CIYAM AT - Test for AT instruction code 0x25 (SUB_LEQ) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x25 (SUB_LEQ)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Basic usage (1).
+Test 2 - Basic usage (2).
+Test 3 - Invalid address.
+Test 4 - Out of range address.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000011111111
+0000001a  SLE @00000001 $00000000 :00000028
+00000027  FIN
+00000028  SET @00000000 #1111111111111111
+00000035  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000000000000000000010100000011111111000000002501000000000000002800000028010000000011111111111111
+1128
+
+Data Dump (Test 1):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 11 11 11 11 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000011111111
+0000001a  SLE @00000000 $00000001 :00000028
+00000027  FIN
+00000028  SET @00000000 #1111111111111111
+00000035  FIN
+
+Machine Code (Test 2):
+----------------------
+
+01000000000000000000000000010100000011111111000000002500000000010000002800000028010000000011111111111111
+1128
+
+Dump Data (Test 2):
+-----------------------
+
+00000000 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000011111111
+0000001a  SLE @00000000 $00000001 :00000026
+00000027  FIN
+00000028  SET @00000000 #1111111111111111
+00000035  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01000000000000000000000000010100000011111111000000002500000000010000002600000028010000000011111111111111
+1128
+
+Runtime Error (Test 3):
+-----------------------
+
+error: invalid code
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #0000000000000000
+0000000d  SET @00000001 #0000000011111111
+0000001a  SLE @00000000 $00000001 :11111111
+00000027  FIN
+00000028  SET @00000000 #1111111111111111
+00000035  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000000000000000000000010100000011111111000000002500000000010000001111111128010000000011111111111111
+1128
+
+Runtime Error (Test 4):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/at_test_xor_dat.html b/docs/at_test_xor_dat.html new file mode 100644 index 0000000..20090eb --- /dev/null +++ b/docs/at_test_xor_dat.html @@ -0,0 +1,472 @@ + + + + +CIYAM AT - Test for AT instruction code 0x0c (XOR_DAT) + + + + + + + +
+ + +
+
+
+Test for AT instruction code 0x0c (XOR_DAT)
+-------------------------------------------
+
+For each test the assembly and machine code are listed as is the data dump or expected error if test case has
+been created specifically to fail (with a data dump if any data was expected to have changed before the error
+occurred).
+
+A summary of the tests follows:
+
+Test 1 - Check some basic usage.
+Test 2 - Check highest value works.
+Test 3 - Check full address range.
+Test 4 - Check overwriting works.
+Test 5 - Check address range edge fail.
+Test 6 - Check negative adddress fails.
+
+Assembly Code (Test 1):
+-----------------------
+
+00000000* SET @00000000 #000000000000000f
+0000000d  SET @00000001 #000000000000000e
+0000001a  SET @00000002 #000000000000000d
+00000027  SET @00000003 #000000000000000c
+00000034  SET @00000004 #000000000000000b
+00000041  SET @00000005 #000000000000000a
+0000004e  SET @00000006 #0000000000000009
+0000005b  SET @00000007 #0000000000000008
+00000068  SET @00000008 #0000000000000007
+00000075  SET @00000009 #0000000000000006
+00000082  SET @0000000a #0000000000000005
+0000008f  SET @0000000b #0000000000000004
+0000009c  SET @0000000c #0000000000000003
+000000a9  SET @0000000d #0000000000000002
+000000b6  SET @0000000e #0000000000000001
+000000c3  XOR @00000000 $00000001
+000000cc  XOR @00000001 $00000002
+000000d5  XOR @00000002 $00000003
+000000de  XOR @00000003 $00000004
+000000e7  XOR @00000004 $00000005
+000000f0  XOR @00000005 $00000006
+000000f9  XOR @00000006 $00000007
+00000102  XOR @00000007 $00000008
+0000010b  XOR @00000008 $00000009
+00000114  XOR @00000009 $0000000a
+0000011d  XOR @0000000a $0000000b
+00000126  XOR @0000000b $0000000c
+0000012f  XOR @0000000c $0000000d
+00000138  XOR @0000000d $0000000e
+00000141  FIN
+
+Machine Code (Test 1):
+----------------------
+
+01000000000f0000000000000001010000000e0000000000000001020000000d0000000000000001030000000c00000000000000
+01040000000b0000000000000001050000000a000000000000000106000000090000000000000001070000000800000000000000
+0108000000070000000000000001090000000600000000000000010a0000000500000000000000010b0000000400000000000000
+010c0000000300000000000000010d0000000200000000000000010e00000001000000000000000c00000000010000000c010000
+00020000000c02000000030000000c03000000040000000c04000000050000000c05000000060000000c06000000070000000c07
+000000080000000c08000000090000000c090000000a0000000c0a0000000b0000000c0b0000000c0000000c0c0000000d000000
+0c0d0000000e00000028
+
+Data Dump (Test 1):
+-------------------
+
+00000000 01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000010 01 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 
+00000020 01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000030 01 00 00 00 00 00 00 00 0f 00 00 00 00 00 00 00 
+00000040 01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000050 01 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 
+00000060 01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 
+00000070 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 2):
+-----------------------
+
+00000000* SET @00000001 #ffffffffffffffff
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #0000000000000000
+00000027  SET @0000000a #ffffffffffffffff
+00000034  SET @0000000d #ffffffffffffffff
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #ffffffffffffffff
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #0000000000000000
+00000075  SET @0000001c #ffffffffffffffff
+00000082  SET @0000001f #ffffffffffffffff
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #ffffffffffffffff
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #0000000000000000
+000000c3  SET @0000002e #ffffffffffffffff
+000000d0  SET @00000031 #ffffffffffffffff
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #ffffffffffffffff
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #0000000000000000
+00000111  XOR @00000001 $00000004
+0000011a  XOR @00000004 $00000007
+00000123  XOR @00000007 $0000000a
+0000012c  XOR @0000000a $0000000d
+00000135  XOR @0000000d $00000010
+0000013e  XOR @00000010 $00000013
+00000147  XOR @00000013 $00000016
+00000150  XOR @00000016 $00000019
+00000159  XOR @00000019 $0000001c
+00000162  XOR @0000001c $0000001f
+0000016b  XOR @0000001f $00000022
+00000174  XOR @00000022 $00000025
+0000017d  XOR @00000025 $00000028
+00000186  XOR @00000028 $0000002b
+0000018f  XOR @0000002b $0000002e
+00000198  XOR @0000002e $00000031
+000001a1  XOR @00000031 $00000034
+000001aa  XOR @00000034 $00000037
+000001b3  XOR @00000037 $0000003a
+000001bc  XOR @0000003a $0000003d
+000001c5  XOR @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 2):
+----------------------
+
+0101000000ffffffffffffffff0104000000ffffffffffffffff01070000000000000000000000010a000000ffffffffffffffff
+010d000000ffffffffffffffff011000000000000000000000000113000000ffffffffffffffff0116000000ffffffffffffffff
+01190000000000000000000000011c000000ffffffffffffffff011f000000ffffffffffffffff01220000000000000000000000
+0125000000ffffffffffffffff0128000000ffffffffffffffff012b0000000000000000000000012e000000ffffffffffffffff
+0131000000ffffffffffffffff013400000000000000000000000137000000ffffffffffffffff013a000000ffffffffffffffff
+013d00000000000000000000000c01000000040000000c04000000070000000c070000000a0000000c0a0000000d0000000c0d00
+0000100000000c10000000130000000c13000000160000000c16000000190000000c190000001c0000000c1c0000001f0000000c
+1f000000220000000c22000000250000000c25000000280000000c280000002b0000000c2b0000002e0000000c2e000000310000
+000c31000000340000000c34000000370000000c370000003a0000000c3a0000003d0000000c3d0000003d00000028
+
+Data Dump (Test 2):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 3):
+-----------------------
+
+00000000* SET @00000001 #efcdab8967452301
+0000000d  SET @00000004 #ffffffffffffffff
+0000001a  SET @00000007 #efcdab8967452301
+00000027  SET @0000000a #00000000ffffffff
+00000034  SET @0000000d #efcdab8967452301
+00000041  SET @00000010 #0000000000000000
+0000004e  SET @00000013 #efcdab8967452301
+0000005b  SET @00000016 #ffffffffffffffff
+00000068  SET @00000019 #efcdab8967452301
+00000075  SET @0000001c #00000000ffffffff
+00000082  SET @0000001f #efcdab8967452301
+0000008f  SET @00000022 #0000000000000000
+0000009c  SET @00000025 #efcdab8967452301
+000000a9  SET @00000028 #ffffffffffffffff
+000000b6  SET @0000002b #efcdab8967452301
+000000c3  SET @0000002e #00000000ffffffff
+000000d0  SET @00000031 #efcdab8967452301
+000000dd  SET @00000034 #0000000000000000
+000000ea  SET @00000037 #efcdab8967452301
+000000f7  SET @0000003a #ffffffffffffffff
+00000104  SET @0000003d #efcdab8967452301
+00000111  XOR @00000001 $00000004
+0000011a  XOR @00000004 $00000007
+00000123  XOR @00000007 $0000000a
+0000012c  XOR @0000000a $0000000d
+00000135  XOR @0000000d $00000010
+0000013e  XOR @00000010 $00000013
+00000147  XOR @00000013 $00000016
+00000150  XOR @00000016 $00000019
+00000159  XOR @00000019 $0000001c
+00000162  XOR @0000001c $0000001f
+0000016b  XOR @0000001f $00000022
+00000174  XOR @00000022 $00000025
+0000017d  XOR @00000025 $00000028
+00000186  XOR @00000028 $0000002b
+0000018f  XOR @0000002b $0000002e
+00000198  XOR @0000002e $00000031
+000001a1  XOR @00000031 $00000034
+000001aa  XOR @00000034 $00000037
+000001b3  XOR @00000037 $0000003a
+000001bc  XOR @0000003a $0000003d
+000001c5  XOR @0000003d $0000003d
+000001ce  FIN
+
+Machine Code (Test 3):
+----------------------
+
+01010000000123456789abcdef0104000000ffffffffffffffff01070000000123456789abcdef010a000000ffffffff00000000
+010d0000000123456789abcdef0110000000000000000000000001130000000123456789abcdef0116000000ffffffffffffffff
+01190000000123456789abcdef011c000000ffffffff00000000011f0000000123456789abcdef01220000000000000000000000
+01250000000123456789abcdef0128000000ffffffffffffffff012b0000000123456789abcdef012e000000ffffffff00000000
+01310000000123456789abcdef0134000000000000000000000001370000000123456789abcdef013a000000ffffffffffffffff
+013d0000000123456789abcdef0c01000000040000000c04000000070000000c070000000a0000000c0a0000000d0000000c0d00
+0000100000000c10000000130000000c13000000160000000c16000000190000000c190000001c0000000c1c0000001f0000000c
+1f000000220000000c22000000250000000c25000000280000000c280000002b0000000c2b0000002e0000000c2e000000310000
+000c31000000340000000c34000000370000000c370000003a0000000c3a0000003d0000000c3d0000003d00000028
+
+Data Dump (Test 3):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 fe dc ba 98 76 54 32 10 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 fe dc ba 98 89 ab cd ef 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 fe dc ba 98 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 fe dc ba 98 76 54 32 10 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 fe dc ba 98 89 ab cd ef 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 fe dc ba 98 89 ab cd ef 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 fe dc ba 98 76 54 32 10 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 fe dc ba 98 89 ab cd ef 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 fe dc ba 98 89 ab cd ef 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 01 23 45 67 89 ab cd ef 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 01 23 45 67 89 ab cd ef 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 fe dc ba 98 76 54 32 10 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 fe dc ba 98 76 54 32 10 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 4):
+-----------------------
+
+00000000* SET @00000000 #9999999999999999
+0000000d  SET @00000001 #8888888888888888
+0000001a  SET @00000002 #99999999ffffffff
+00000027  SET @00000010 #7777777777777777
+00000034  SET @00000011 #5555555555555555
+00000041  SET @00000012 #22222222ffffffff
+0000004e  SET @00000020 #6666666666666666
+0000005b  SET @00000021 #4444444444444444
+00000068  SET @00000022 #66666666ffffffff
+00000075  SET @00000030 #3333333333333333
+00000082  SET @00000031 #1111111111111111
+0000008f  SET @00000032 #22222222ffffffff
+0000009c  XOR @00000000 $00000001
+000000a5  XOR @00000000 $00000001
+000000ae  XOR @00000010 $00000011
+000000b7  XOR @00000010 $00000011
+000000c0  XOR @00000010 $00000011
+000000c9  XOR @00000020 $00000021
+000000d2  XOR @00000020 $00000021
+000000db  XOR @00000020 $00000021
+000000e4  XOR @00000020 $00000021
+000000ed  XOR @00000030 $00000031
+000000f6  XOR @00000030 $00000031
+000000ff  XOR @00000030 $00000031
+00000108  XOR @00000030 $00000031
+00000111  XOR @00000030 $00000031
+0000011a  FIN
+
+Machine Code (Test 4):
+----------------------
+
+01000000009999999999999999010100000088888888888888880102000000ffffffff9999999901100000007777777777777777
+011100000055555555555555550112000000ffffffff222222220120000000666666666666666601210000004444444444444444
+0122000000ffffffff6666666601300000003333333333333333013100000011111111111111110132000000ffffffff22222222
+0c00000000010000000c00000000010000000c10000000110000000c10000000110000000c10000000110000000c200000002100
+00000c20000000210000000c20000000210000000c20000000210000000c30000000310000000c30000000310000000c30000000
+310000000c30000000310000000c300000003100000028
+
+Data Dump (Test 4):
+-------------------
+
+00000000 99 99 99 99 99 99 99 99 88 88 88 88 88 88 88 88 
+00000010 ff ff ff ff 99 99 99 99 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 22 22 22 22 22 22 22 22 55 55 55 55 55 55 55 55 
+00000090 ff ff ff ff 22 22 22 22 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 66 66 66 66 66 66 66 66 44 44 44 44 44 44 44 44 
+00000110 ff ff ff ff 66 66 66 66 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 22 22 22 22 22 22 22 22 11 11 11 11 11 11 11 11 
+00000190 ff ff ff ff 22 22 22 22 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+
+Assembly Code (Test 5):
+-----------------------
+
+00000000* SET @0000003e #00000000ffffffff
+0000000d  SET @0000003f #ffffffffffffffff
+0000001a  XOR @0000003e $0000003f
+00000023  XOR @0000003f $00000040
+0000002c  FIN
+
+Machine Code (Test 5):
+----------------------
+
+013e000000ffffffff00000000013f000000ffffffffffffffff0c3e0000003f0000000c3f0000004000000028
+
+Runtime Error (Test 5):
+-----------------------
+
+error: overflow
+
+Data Dump (Test 5):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+000001f0 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff 
+
+Assembly Code (Test 6):
+-----------------------
+
+00000000* XOR @ffffffff $ffffffff
+00000009  FIN
+
+Machine Code (Test 6):
+----------------------
+
+0cffffffffffffffff28
+
+Runtime Error (Test 6):
+-----------------------
+
+error: overflow
+
+
+
+
+ + + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..d810c94 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,91 @@ + + + + +CIYAM AT - Documentation Index + + + + + + + + +
+ + + + +
+
+

Automated Transactions (AT) is a technology created by CIYAM Developers which provides "Turing complete smart contracts" for any blockchain that implements it.

+

Automated Transactions Specification

+

Automated Transactions API Specification

+

Use Case: Atomic Cross-Chain Transfer

+

Use Case: Auction Agent

+

Use Case Tests: Auction Agent

+

Use Case: Crowdfunding Agent

+

Use Case Tests: Crowdfunding Agent

+

Use Case: Dormant Funds Transfer

+

Use Case Tests: Dormant Funds Transfer

+

Use Case: Lottery

+

Use Case Tests: Lottery

+

AT Metadata for UI

+

Integrating AT with Script

+

Test for AT instruction code 0x06 (ADD_DAT)

+

Test for AT instruction code 0x0b (AND_DAT)

+

Test for AT instruction code 0x23 (BEQ_DAT)

+

Test for AT instruction code 0x21 (BGE_DAT)

+

Test for AT instruction code 0x1f (BGT_DAT)

+

Test for AT instruction code 0x22 (BLE_DAT)

+

Test for AT instruction code 0x20 (BLT_DAT)

+

Test for AT instruction code 0x24 (BNE_DAT)

+

Test for AT instruction code 0x1e (BNZ_DAT)

+

Test for AT instruction code 0x0a (BOR_DAT)

+

Test for AT instruction code 0x1b (BZR_DAT)

+

Test for AT instruction code 0x03 (CLR_DAT)

+

Test for AT instruction code 0x05 (DEC_DAT)

+

Test for AT instruction code 0x09 (DIV_DAT)

+

Test for AT instruction code 0x32 (EXT_FUN)

+

Test for AT instruction code 0x33 (EXT_FUN_DAT)

+

Test for AT instruction code 0x34 (EXT_FUN_DAT_2)

+

Test for AT instruction code 0x35 (EXT_FUN_RET)

+

Test for AT instruction code 0x36 (EXT_FUN_RET_DAT)

+

Test for AT instruction code 0x37 (EXT_FUN_RET_DAT_2)

+

Test for AT instruction code 0x28 (FIN_IMD)

+

Test for AT instruction code 0x26 (FIZ_DAT)

+

Test for AT instruction code 0x04 (INC_DAT)

+

Test for AT instruction code 0x1a (JMP_ADR)

+

Test for AT instruction code 0x12 (JMP_SUB)

+

Test for AT instruction code 0x08 (MUL_DAT)

+

Test for AT instruction code 0x0d (NOT_DAT)

+

Test for AT instruction code 0x11 (POP_DAT)

+

Test for AT instruction code 0x10 (PSH_DAT)

+

Test for AT instruction code 0x13 (RET_SUB)

+

Test for AT instruction code 0x02 (SET_DAT)

+

Test for AT instruction code 0x0f (SET_IDX)

+

Test for AT instruction code 0x0e (SET_IND)

+

Test for AT instruction code 0x30 (SET_PCS)

+

Test for AT instruction code 0x01 (SET_VAL)

+

Test for AT instruction code 0x29 (STP_IMD)

+

Test for AT instruction code 0x27 (STZ_DAT)

+

Test for AT instruction code 0x07 (SUB_DAT)

+

Test for AT instruction code 0x25 (SUB_LEQ)

+

Test for AT instruction code 0x0c (XOR_DAT)

+

at.cpp

+
+
+ + + + + +