This program does no useful calculation but uses almost all of the orders. Start with a number x and it should print x at the end. The instructions are used in roughly numerical order except that 70, 79, 10, 19, 26 and 46 orders are used throughout. 0 N(2) = 0 p1=20 p10=13 choose an integer x, 0 < x < 100 tTEST ORDERS 0 - 9, ALL ARITHMETIC MODULO 2048 2fp10 2 order 3f50 3 order 70s100 s = 100 - (x + 50) = 50 - x 79s2 a(2) = 50 - x 4f2 4 order 46s100 N(M) = 100 + (50 - x) + (50 - x) = 200 - 2x 5f2 5 order 70t30 t = 30 - (50 - x) = x - 20 6f1 6 order N(M) = 400 - 4x 19f4 N(4) = 400 - 4x 10f2 N(M) = (50 - x)*2^20 7f19 7 order N(M) = 100 - 2x 8f4 8 order N(M) = 400 - 4x, N(4) = 100 - 2x 9f8 9 order N(8) = 0 79t8 a(8) = x - 20, a(9) = 0 19f6 N(6) = 400 - 4x 4f9 note a(9) = 0 5f7 3s0 subtract -(400 - 4x) + (50 - x) = -350 + 3x 70s0 s = 350 - 3x 5f5 a(5) = 100 - 2x 2t0 add x - 20 - (100 - 2x) = -120 + 3x 46s1818 N(M) = (-120 + 3x) + (350 - 3x) + 1818 = 2048 52r2 101f1 stop on non zero FLOATING POINT ARITHMETIC f read floating point numbers 26t80 F(M) = 80 + (x - 20) = 60.0 + x 19f4 F(4) = 60.0 + x = y 19f6 F(6) = y 11f6 11 order F(M) = -y 12*50.0 12 order F(M) = 50.0 - y 13f6 13 order F(M) = 50.0 - y - y = 50.0 - 2y 14f6 14 order F(M) = y*(50.0 - 2y) 15*2.0 15 order F(M) = 25.0*y - y^2 24*25.0 24 order F(K) = 25.0 16f6 16 order F(M) = 25.0*y - y^2 + 25.0*y = 50.0*y - y^2 24*51.0 17f6 17 order F(M) = -51.0*y - y^2 + 50.0*y = -y - y^2 18f6 18 order F(8) = F(M) = -y - y^2 + y = -y^2 20f6 20 order F(M) = |-y^2| = y^2 19f10 21f6 21 order F(M) = -|-y^2| = -y^2 22*-20.0 22 order F(M) = 20.0 - y^2 23f10 23 order F(M) = 20.0 - y^2 - y^2 = 20.0 - 2y^2 25*0.5 25 order F(M) = -0.5*(20.0 - 2y^2) = y^2 - 10.0 12f6 F(M) = - 10.0 12*10.0 F(M) = 0.0 52r2 101f3 FIXED POINT ARITHMETIC n real fixed point numbers 46t80 N(M) = 80 + (x - 20) = 60 + x 19f4 N(8) = 60 + x = y 19f6 N(8) = 60 + x = y 31f6 31 order N(M) = -y 32*50 32 order N(M) = 50 - y 33f6 33 order N(M) = 50 - y - y = 50 - 2y 34f6 34 order N(A) = y*(50 - 2y) 35*2 35 order N(M) = 25*y - y^2 7f39 N(A) = 25*y - y^2 44*25 44 order N(K) = 25 36f6 36 order N(A) = 25*y - y^2 + 25*y = 50*y - y^2 44*51 37f6 37 order N(A) = 50*y - y^2 - 51*y = -y - y^2 6f39 N(M) = -y - y^2 38f6 38 order N(6) = N(M) = -y - y^2 + y = -y^2 40f6 40 order N(M) = |-y^2| = y^2 19f10 41f6 41 order N(M) = -|-y^2| = -y^2 42*-20 42 order N(M) = 20 - y^2 43f10 43 order N(M) = 20 - y^2 - |-y^2| = 20 - 2y^2 7f1 N(M) = 10 - y^2 33f6 N(M) = 10 33*10 N(M) = 0 52r2 101f7 MISCELLANEOUS ARITHMETIC ORDERS check rounding with 8, 38 and 39 orders, also tests 29 order 46f1023 N(M) = 1023 7f1 N(M) = 511, L1 = 1 39f8 N(8) = 512, N(M) = 511, L1 = 1 19f6 N(6) = 511, N(M) = 511, L1 = 1 8f8 N(M) = 512, N(8) = 512, L = 0 33f6 N(M) = 1 29f8 N(8) = 513, N(M) = 1 30f8 N(M) = 513 7f1 N(M) = 256, L1 = 1 38f6 N(M) = 256 + 511 = 767, N(6) = 768, L1 = 1 46f768 N(M) = 768 33f6 N(M) = 0 52r2 101f15 70tp10 t = x 46t0 N(M) = x 6f10 N(M) = x*2^10 19f6 N(6) = x*2^10 9f4 N(4) = 0 10f4 N(M) = 0 79t4 N(4) = x*2^20 70t29 79t5 N(4) = x*2^20 + 29 47f4 47 order N(A) = x*2^20 + 29 45f6 45 order N(M) = 29, N(L) = 2^10 48f8 48 order N(8) = 2^10 49f10 49 order N(10) = 29, N(12) = 2^10 46fp10 N(M) = x 34f8 N(A) = x*2^10 6f39 N(M) = x*2^10 34f12 N(A) = x*2^20 6f39 N(M) = x*2^20 32f10 N(M) = x*2^20 + 29 33f4 N(M) = 0 52r2 101f63 JUMP ORDERS, M set to 0, 1 and -1 successively, test 52, 53, 54, 55, 56, 57 50r2 50 order skip next instruction 101f127(99 error stop 51r1 51 order N(M) = 0 53p99 53 order 55p99 55 order 56p99 56 order 46f1 N(M) = 1 52p99 52 order 55p99 55 order 56p99 56 order 19f4 31f4 N(M) = -1 52p99 52 order 54p99 54 order 56p99 56 order 6f39 N(M) = -2^39 56p99 56 order 6f1 N(M) < -2^39, alpha = True 57p99 57 order alpha = False 56p99 56 order 46f1 N(M) = 1 70s4 s = 4 58p98 58 order N(M) = 2 101f255 58p98 58 order N(M) = 4 101f255(97 19f4 46s0 N(M) = 4 33f4 N(M) = 0 53p97 TEST 62, 66 and 68 orders 46f124 N(M) = 01111100 = 124 19f2 46f231 N(M) = 11100111 = 231 62f2 62 order N(M) = 01100100 = 100 19f4 N(4) = 100 66s37 66 order N(M) = -2^39, N(L) = 1100, s = 12 66t3 N(M) = 0, N(L) = 8, t = 4 48f6 N(6) = 4 46s0 N(M) = 12 6f3 N(M) = 96 32f6 N(M) = 100 33f4 N(M) = 0 52r2 101f511 26fp10 F(M) = x = z*2^p 68f2 N(M) = z (as fraction), N(2) = z, s = p 6s-39 N(M) = x (as integer) 19f4 N(4) = x 46fp10 N(M) = x 33f4 N(M) = 0 52r2 101f511 MODIFIER ORDERS 70 - 89 70sp10 s = x 79s2 a(2) = x 71tp10 71 order t = -x 72sp10 72 order s = 2x 73tp10 73 order t = -2x 73s1 73 order s = s - 1 74tr-1 74 order loop x times, s = x 2fp10 70tp10 t = 2x 73s1 s = s - 1 75tr-1 75 order loop x times, s = 0 76s1 76 order s = 0, so not skip 77s1 77 order s = 0, so skip 101f1023 70s1 s = 1 79s3 a(3) = 1 70sp10 s = x 79s2 a(2) = x 78s2 78 order a(2) = 2x 80s2 80 order s = 2x 81t2 81 order t = -2x 82t3 82 order t= -2x + 1 83s3 83 order s = 2x - 1 2t0 2s0 70s0 s = s + t = 0 86s3 86 order s < a(3) so not skip 87s3 87 order s < a(3) so skip 101f2046 70s128 79s3 a(3) = 128 70s50 s = 50 88s3 88 order s = 128, a(3) = 50 82s3 s = 178 89sr1 89 order 0f2 order becomes 50r2 101f2044 ORDERS 90 - 128 excluding 101, 102, 105, 106, 107, 108, 112, 120, 121 51r1 N(A) = 0 90sr2 90 order skip if A = 0, s = -129 50p96 stop if 90 wrong 46sp12910 N(M) = x assuming s = -129 19f2 N(2) = x 7f37 N(A) = 4x 90sp96 90 order N(A) = x scaled 19f4 N(4) = x scaled 6f1 left shift should set overflow 56r2 check overflow is set and clear it 101f2040(96 10f4 N(M) = x scaled 6s37 N(M) = x 33f2 N(M) = 0 53p96 f 46p10 N(M) = x 6f2 N(M) = 4x 2^-39 as fraction 96f40 96 order F(M) = 8x 14*0.25 F(M) = 2x 19f4 F(4) = 2x 4f2 26p10 F(M) = x + x 13f4 F(M) = 0 52r2 101f2032 46p10 N(M) = x 19f6 N(6) = x 6f21 N(M) = x*2^21 32f6 N(M) = x*2^21 + x 98f2 98 order N(2 reserved) = x*2^21 + ???? 98f3 98 order N(2 reserved) = x*2^21 + x 99f2 99 order N(2 free) = x*2^21 + ???? 99f3 99 order N(3 free) = x*2^21 + x 100f2 100 order N(M) = x*2^21 + x 33f2 N(M) = 0 53r6 100f3 100 order N(M) = x*2^20 + x 33f2 N(M) = -x*2^20 7f20 N(M) = -x 32f6 N(M) = 0 52r2 101f2016 46f10 N(M) = 10 integer 6f36 N(M) = 1010..., alpha = True 109f8 109 order N(M) = 1010... 56r2 check alpha and clear 101f1984 33f8 N(M) = 0 53r-2 110f2 110 order N(M) = x*2^21 + x 33f2 N(M) = 0 53r6 110f3 110 order N(M) = x*2^20 + x 33f2 N(M) = -x*2^20 7f20 N(M) = -x 32f6 N(M) = 0 52r2 101f1920 101f0 70s1(98 subroutine s = 1 6f1 N(M) = 2*N(M) 60f1 60 order resets s = 4, return 1 order after 58 s20