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