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