git @ Cat's Eye Technologies SixtyPical / inconsistent-initialization tests / SixtyPical Compilation.md
inconsistent-initialization

Tree @inconsistent-initialization (Download .tar.gz)

SixtyPical Compilation.md @inconsistent-initialization

feb5729
d0e3dfb
 
 
feb5729
d0e3dfb
 
 
feb5729
4bba758
d0e3dfb
feb5729
d0e3dfb
 
 
38119db
d0e3dfb
 
81aeb6c
d0e3dfb
1f992f8
 
38119db
1f992f8
 
 
 
 
 
d0e3dfb
 
38119db
d0e3dfb
 
 
 
 
 
 
81aeb6c
 
 
49d90df
 
 
38119db
49d90df
 
 
 
38119db
49d90df
2ffff3b
49d90df
 
 
 
81aeb6c
 
 
a3160a5
 
 
38119db
a3160a5
 
 
 
 
 
 
 
38119db
a3160a5
 
 
 
81aeb6c
 
 
 
 
 
e62fd85
 
 
 
 
38119db
e62fd85
 
 
 
 
 
81aeb6c
 
 
 
479b484
7b1ee60
 
522c771
 
38119db
522c771
 
 
 
 
81aeb6c
 
 
522c771
70247e0
 
9b912de
ebe53f5
9b912de
 
38119db
ebe53f5
 
9b912de
 
 
 
ebe53f5
 
70247e0
 
 
9b912de
 
 
ebe53f5
 
70247e0
 
 
 
9b912de
7b1ee60
 
 
 
38119db
7b1ee60
 
 
 
 
81aeb6c
 
 
7b1ee60
63f75a2
 
 
 
 
38119db
63f75a2
 
 
 
 
 
 
 
 
 
 
 
 
 
2f513f7
f87bcf5
70ecd52
f87bcf5
38119db
f87bcf5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f513f7
 
 
 
38119db
2f513f7
 
 
 
 
 
 
 
 
eadf1eb
 
 
 
2f513f7
 
 
 
eadf1eb
 
8091c45
eadf1eb
38119db
eadf1eb
 
 
 
 
 
 
 
 
8091c45
eadf1eb
 
479b484
 
 
 
38119db
479b484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e565234
 
479b484
81aeb6c
 
 
e565234
 
 
81aeb6c
 
 
e565234
81aeb6c
e565234
 
81aeb6c
 
e565234
81aeb6c
 
 
e565234
81aeb6c
e565234
81aeb6c
e565234
81aeb6c
e565234
81aeb6c
e565234
81aeb6c
e565234
81aeb6c
 
e565234
 
 
b6bb645
bc91ef1
 
 
 
38119db
bc91ef1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38119db
bc91ef1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38119db
bc91ef1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dcc944d
e74c7f2
 
 
 
 
 
 
 
dcc944d
97e6e61
e74c7f2
94ee042
97e6e61
e74c7f2
94ee042
97e6e61
 
d1a2970
97e6e61
 
d1a2970
97e6e61
 
 
e74c7f2
b6bb645
 
38119db
b6bb645
 
 
 
 
 
 
 
 
81aeb6c
 
 
 
 
 
b794d8d
49e42af
 
38119db
49e42af
 
 
 
 
 
 
 
 
81aeb6c
 
 
 
 
 
49e42af
b794d8d
 
38119db
b794d8d
 
 
ed1ed3e
b794d8d
 
 
 
81aeb6c
ed1ed3e
 
 
 
c5998ed
b9fb263
c5998ed
38119db
c5998ed
 
 
 
 
 
 
 
 
81aeb6c
 
 
 
 
 
49e42af
b9fb263
49e42af
38119db
49e42af
 
 
 
 
 
 
 
 
81aeb6c
 
 
 
 
 
49e42af
b9fb263
 
38119db
b9fb263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38119db
b9fb263
 
fa1b0cf
b9fb263
 
 
 
 
fa1b0cf
b9fb263
 
 
 
 
49e42af
 
38119db
49e42af
 
 
 
 
 
 
81aeb6c
 
 
 
a9bd8a3
4854077
 
38119db
4854077
 
 
 
 
 
 
adb53f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
07541d7
 
38119db
07541d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b63bcfc
 
38119db
b63bcfc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4986454
 
 
38119db
4986454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a9bd8a3
 
 
70ecd52
a9bd8a3
38119db
a9bd8a3
 
 
 
 
 
 
 
81aeb6c
 
 
 
 
04de73d
bc91ef1
404f8c7
70ecd52
 
404f8c7
38119db
404f8c7
 
 
 
 
 
 
 
81aeb6c
 
 
 
404f8c7
81aeb6c
404f8c7
 
 
 
38119db
404f8c7
 
 
 
 
 
 
81aeb6c
 
 
 
404f8c7
e2daa33
 
 
 
 
38119db
e2daa33
 
 
 
 
 
81aeb6c
 
 
e2daa33
 
 
 
 
 
38119db
e2daa33
 
 
 
 
 
81aeb6c
 
 
 
 
e2daa33
b2b2582
 
 
 
38119db
b2b2582
 
 
ad8e064
b2b2582
81aeb6c
 
 
 
 
b2b2582
50390b0
 
70ecd52
50390b0
38119db
50390b0
 
 
 
 
 
 
 
 
 
 
 
 
 
e2daa33
04de73d
0be7216
 
04de73d
38119db
04de73d
 
 
 
 
 
81aeb6c
 
 
 
 
04de73d
b2b2582
04de73d
ed1ed3e
 
 
 
 
04de73d
38119db
04de73d
 
 
 
 
 
 
38119db
04de73d
 
 
 
 
 
 
81aeb6c
 
 
 
 
 
 
 
 
1664904
f6fa1ec
 
 
 
 
 
 
 
38119db
f6fa1ec
 
 
 
 
 
38119db
f6fa1ec
 
 
 
 
 
 
 
 
 
 
 
 
 
2216fce
84ca6c4
 
70ecd52
84ca6c4
38119db
84ca6c4
 
2216fce
84ca6c4
 
2216fce
84ca6c4
 
2216fce
 
 
84ca6c4
81aeb6c
2216fce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84ca6c4
1664904
 
ed1ed3e
 
 
 
1664904
38119db
ed1ed3e
 
 
1664904
 
 
38119db
ed1ed3e
 
 
1664904
 
 
81aeb6c
6c1c1cb
81aeb6c
6c1c1cb
81aeb6c
 
 
 
6c1c1cb
b4f5d60
16450e0
27df0d2
16450e0
38119db
ed1ed3e
 
 
 
16450e0
 
 
38119db
ed1ed3e
 
 
16450e0
 
 
81aeb6c
27df0d2
 
 
e41dd1a
a082aee
 
 
 
0be7216
a082aee
 
0be7216
08ec0e4
a082aee
08ec0e4
70ecd52
a082aee
38119db
a082aee
 
 
38119db
a082aee
 
 
 
 
 
7c8f113
a082aee
 
 
 
 
7c8f113
 
a082aee
7c8f113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a082aee
92525fd
 
a4fd0e5
92525fd
 
38119db
a4fd0e5
92525fd
 
 
 
 
 
81aeb6c
 
 
 
 
 
 
 
92525fd
a4fd0e5
 
 
 
38119db
a4fd0e5
 
 
 
 
 
 
81aeb6c
 
 
 
 
 
 
 
a4fd0e5
5f535c9
 
 
38119db
5f535c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38119db
5f535c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6afbf58
 
 
e41dd1a
c8c69a2
 
 
38119db
c8c69a2
 
 
 
 
32389e4
c8c69a2
81aeb6c
 
 
 
 
 
19a196f
6afbf58
19a196f
 
 
 
38119db
6afbf58
19a196f
 
 
 
32389e4
19a196f
 
81aeb6c
 
 
 
 
 
 
 
d84566a
 
 
 
 
 
 
38119db
6afbf58
 
d84566a
 
 
 
 
 
81aeb6c
 
 
 
 
 
 
 
d84566a
f9dc730
d84566a
 
 
 
 
38119db
6afbf58
d84566a
 
 
 
 
 
34daad0
d84566a
81aeb6c
f9dc730
81aeb6c
 
 
 
f9dc730
 
 
75cf18d
3c7d95a
 
 
 
 
 
38119db
3c7d95a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ca1c877
 
 
 
 
 
38119db
ca1c877
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75cf18d
 
 
 
 
 
 
 
38119db
75cf18d
 
ed1ed3e
75cf18d
 
 
ed1ed3e
75cf18d
 
 
 
 
81aeb6c
ed1ed3e
81aeb6c
ed1ed3e
81aeb6c
ed1ed3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c7861d3
 
 
 
 
38119db
c7861d3
 
 
 
 
 
 
 
 
 
 
71cded0
 
 
 
 
 
 
 
 
 
7a024f3
71cded0
 
 
 
 
 
 
 
7a024f3
71cded0
 
 
 
7a024f3
 
 
 
 
 
 
 
 
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
SixtyPical Compilation
======================

This is a test suite, written in [Falderal][] format, for compiling
SixtyPical to 6502 machine code.

[Falderal]:     http://catseye.tc/node/Falderal

    -> Functionality "Compile SixtyPical program" is implemented by
    -> shell command "bin/sixtypical --output-format=c64-basic-prg --traceback %(test-body-file) --output /tmp/foo && tests/appliances/bin/dcc6502-adapter </tmp/foo"

    -> Tests for functionality "Compile SixtyPical program"

Null program.

    | define main routine
    | {
    | }
    = $080D   RTS

`nop` program.

    | define main routine
    | {
    |     nop
    | }
    = $080D   NOP
    = $080E   RTS

Rudimentary program.

    | define main routine
    |   inputs a
    |   outputs a
    |   trashes c, z, n, v
    | {
    |     st off, c
    |     add a, 4
    | }
    = $080D   CLC
    = $080E   ADC #$04
    = $0810   RTS

Call extern.

    | define chrout routine
    |   inputs a
    |   trashes a
    |   @ 65490
    | 
    | define main routine
    |   inputs a
    |   trashes a, z, n
    | {
    |     ld a, 65
    |     call chrout
    | }
    = $080D   LDA #$41
    = $080F   JSR $FFD2
    = $0812   RTS

Call defined routine.

    | define foo routine
    |   outputs a, x, y
    |   trashes z, n
    | {
    |   ld a, 0
    |   ld x, 0
    |   ld y, 0
    | }
    | 
    | define main routine
    |   trashes a, x, y, z, n
    | {
    |     call foo
    | }
    = $080D   JSR $0811
    = $0810   RTS
    = $0811   LDA #$00
    = $0813   LDX #$00
    = $0815   LDY #$00
    = $0817   RTS

Access a defined memory location.

    | byte foo
    | 
    | define main routine
    |   trashes a, y, z, n, foo
    | {
    |     ld y, 0
    |     st y, foo
    |     ld a, foo
    | }
    = $080D   LDY #$00
    = $080F   STY $0816
    = $0812   LDA $0816
    = $0815   RTS

Memory location with explicit address.

    | byte screen @ 1024
    | 
    | define main routine
    |   trashes a, z, n, screen
    | {
    |   ld a, 100
    |   st a, screen
    | }
    = $080D   LDA #$64
    = $080F   STA $0400
    = $0812   RTS

Accesses to memory locations in zero-page with `ld` and `st`
and `and`, `or`, and `xor` use zero-page addressing.

    | byte zp @ $00
    | byte screen @ 100
    | 
    | define main routine
    |   inputs screen, zp
    |   outputs screen, zp
    |   trashes a, z, n
    | {
    |   ld a, screen
    |   st a, screen
    |   ld a, zp
    |   st a, zp
    |   and a, zp
    |   or a, zp
    |   xor a, zp
    | }
    = $080D   LDA $64
    = $080F   STA $64
    = $0811   LDA $00
    = $0813   STA $00
    = $0815   AND $00
    = $0817   ORA $00
    = $0819   EOR $00
    = $081B   RTS

Memory location with initial value.

    | byte lives : 3
    | 
    | define main routine
    |   inputs lives
    |   trashes a, z, n
    | {
    |   ld a, lives
    | }
    = $080D   LDA $0811
    = $0810   RTS
    = $0811   .byte $03

Word memory locations with explicit address, initial value.

    | word w1 @ 60001
    | word w2 : 3003
    | 
    | define main routine
    |   inputs w1
    |   outputs w2
    |   trashes a, z, n
    | {
    |   copy w1, w2
    | }
    = $080D   LDA $EA61
    = $0810   STA $081A
    = $0813   LDA $EA62
    = $0816   STA $081B
    = $0819   RTS
    = $081A   .byte $BB
    = $081B   .byte $0B

Initialized byte table, initialized with ASCII string.  Bytes allocated, but beyond the string, are 0's.

    | byte table[8] message : "WHAT?"
    | 
    | define main routine
    |   inputs message
    |   outputs x, a, z, n
    | {
    |   ld x, 0
    |   ld a, message + x
    | }
    = $080D   LDX #$00
    = $080F   LDA $0813,X
    = $0812   RTS
    = $0813   .byte $57
    = $0814   PHA
    = $0815   EOR ($54,X)
    = $0817   .byte $3F
    = $0818   BRK
    = $0819   BRK
    = $081A   BRK

Initialized byte table, initialized with list of byte values.

    | byte table[8] message : 255, 0, 129, 128, 127
    | 
    | define main routine
    |   inputs message
    |   outputs x, a, z, n
    | {
    |   ld x, 0
    |   ld a, message + x
    | }
    = $080D   LDX #$00
    = $080F   LDA $0813,X
    = $0812   RTS
    = $0813   .byte $FF
    = $0814   BRK
    = $0815   STA ($80,X)
    = $0817   .byte $7F
    = $0818   BRK
    = $0819   BRK
    = $081A   BRK

Initialized word table, initialized with list of word values.

    | word table[4] message : 65535, 0, 127, 127
    | 
    | define main routine
    | {
    | }
    = $080D   RTS
    = $080E   .byte $FF
    = $080F   .byte $FF
    = $0810   BRK
    = $0811   BRK
    = $0812   .byte $7F
    = $0813   BRK
    = $0814   .byte $7F
    = $0815   BRK

Some instructions.

    | byte foo
    | 
    | define main routine
    |   trashes a, x, y, z, n, c, v, foo
    | {
    |     ld a, 0
    |     ld x, 0
    |     ld y, 0
    |     st a, foo
    |     st x, foo
    |     st y, foo
    |     st on, c
    |     st off, c
    |     add a, 1
    |     add a, foo
    |     sub a, 1
    |     sub a, foo
    |     inc foo
    |     inc x
    |     inc y
    |     dec foo
    |     dec x
    |     dec y
    |     and a, 255
    |     and a, foo
    |     or a, 255
    |     or a, foo
    |     xor a, 255
    |     xor a, foo
    |     cmp a, 1
    |     cmp a, foo
    |     cmp x, 1
    |     cmp x, foo
    |     cmp y, 1
    |     cmp y, foo
    |     shl a
    |     shr a
    |     shl foo
    |     shr foo
    | }
    = $080D   LDA #$00
    = $080F   LDX #$00
    = $0811   LDY #$00
    = $0813   STA $0859
    = $0816   STX $0859
    = $0819   STY $0859
    = $081C   SEC
    = $081D   CLC
    = $081E   ADC #$01
    = $0820   ADC $0859
    = $0823   SBC #$01
    = $0825   SBC $0859
    = $0828   INC $0859
    = $082B   INX
    = $082C   INY
    = $082D   DEC $0859
    = $0830   DEX
    = $0831   DEY
    = $0832   AND #$FF
    = $0834   AND $0859
    = $0837   ORA #$FF
    = $0839   ORA $0859
    = $083C   EOR #$FF
    = $083E   EOR $0859
    = $0841   CMP #$01
    = $0843   CMP $0859
    = $0846   CPX #$01
    = $0848   CPX $0859
    = $084B   CPY #$01
    = $084D   CPY $0859
    = $0850   ROL A
    = $0851   ROR A
    = $0852   ROL $0859
    = $0855   ROR $0859
    = $0858   RTS

Some instructions on tables. (1/3)

    | byte table[256] many
    | 
    | define main routine
    |   inputs many
    |   outputs many
    |   trashes a, x, c, n, z, v
    | {
    |     ld x, 0
    |     ld a, 0
    |     st off, c
    |     add a, many + x
    |     sub a, many + x
    |     cmp a, many + x
    | }
    = $080D   LDX #$00
    = $080F   LDA #$00
    = $0811   CLC
    = $0812   ADC $081C,X
    = $0815   SBC $081C,X
    = $0818   CMP $081C,X
    = $081B   RTS

Some instructions on tables. (2/3)

    | byte table[256] many
    | 
    | define main routine
    |   inputs many
    |   outputs many
    |   trashes a, x, c, n, z
    | {
    |     ld x, 0
    |     ld a, 0
    |     and a, many + x
    |     or a, many + x
    |     xor a, many + x
    | }
    = $080D   LDX #$00
    = $080F   LDA #$00
    = $0811   AND $081B,X
    = $0814   ORA $081B,X
    = $0817   EOR $081B,X
    = $081A   RTS

Some instructions on tables. (3/3)

    | byte table[256] many
    | 
    | define main routine
    |   inputs many
    |   outputs many
    |   trashes a, x, c, n, z
    | {
    |     ld x, 0
    |     ld a, 0
    |     st off, c
    |     shl many + x
    |     shr many + x
    |     inc many + x
    |     dec many + x
    | }
    = $080D   LDX #$00
    = $080F   LDA #$00
    = $0811   CLC
    = $0812   ROL $081F,X
    = $0815   ROR $081F,X
    = $0818   INC $081F,X
    = $081B   DEC $081F,X
    = $081E   RTS

Compiling 16-bit `cmp`.

    | word za @ 60001
    | word zb : 3003
    | 
    | define main routine
    |   inputs za, zb
    |   trashes a, z, c, n
    | {
    |     cmp za, zb
    |     cmp za, 4000
    | }
    = $080D   LDA $EA61
    = $0810   CMP $0828
    = $0813   BNE $081B
    = $0815   LDA $EA62
    = $0818   CMP $0829
    = $081B   LDA $EA61
    = $081E   CMP #$A0
    = $0820   BNE $0827
    = $0822   LDA $EA62
    = $0825   CMP #$0F
    = $0827   RTS
    = $0828   .byte $BB
    = $0829   .byte $0B

Compiling `if`.

    | define main routine
    |   trashes a, x, y, z, n, c, v
    | {
    |     ld a, 0
    |     if z {
    |         ld y, 1
    |     } else {
    |         ld y, 2
    |     }
    | }
    = $080D   LDA #$00
    = $080F   BNE $0816
    = $0811   LDY #$01
    = $0813   JMP $0818
    = $0816   LDY #$02
    = $0818   RTS

Compiling `if not`.

    | define main routine
    |   trashes a, x, y, z, n, c, v
    | {
    |     ld a, 0
    |     if not z {
    |         ld y, 1
    |     } else {
    |         ld y, 2
    |     }
    | }
    = $080D   LDA #$00
    = $080F   BEQ $0816
    = $0811   LDY #$01
    = $0813   JMP $0818
    = $0816   LDY #$02
    = $0818   RTS

Compiling `if` without `else`.

    | define main routine
    |   trashes a, x, y, z, n, c, v
    | {
    |     ld a, 0
    |     ld y, 0
    |     if z {
    |         ld y, 1
    |     }
    | }
    = $080D   LDA #$00
    = $080F   LDY #$00
    = $0811   BNE $0815
    = $0813   LDY #$01
    = $0815   RTS

Compiling `repeat ... until z`.

    | define main routine
    |   trashes a, y, z, n, c
    | {
    |     ld y, 65
    |     repeat {
    |         ld a, y
    |         inc y
    |         cmp y, 91
    |     } until z
    | }
    = $080D   LDY #$41
    = $080F   TYA
    = $0810   INY
    = $0811   CPY #$5B
    = $0813   BNE $080F
    = $0815   RTS

Compiling `repeat ... until not z`.

    | define main routine
    |   trashes a, y, z, n, c
    | {
    |     ld y, 65
    |     repeat {
    |         ld a, y
    |         inc y
    |         cmp y, 91
    |     } until not z
    | }
    = $080D   LDY #$41
    = $080F   TYA
    = $0810   INY
    = $0811   CPY #$5B
    = $0813   BEQ $080F
    = $0815   RTS

Compiling `repeat ... until n`.

    | define main routine
    |   trashes a, y, z, n, c
    | {
    |     ld y, 65
    |     repeat {
    |         ld a, y
    |         dec y
    |     } until n
    | }
    = $080D   LDY #$41
    = $080F   TYA
    = $0810   DEY
    = $0811   BPL $080F
    = $0813   RTS

Compiling `repeat ... until not n`.

    | define main routine
    |   trashes a, y, z, n, c
    | {
    |     ld y, 199
    |     repeat {
    |         ld a, y
    |         inc y
    |     } until not n
    | }
    = $080D   LDY #$C7
    = $080F   TYA
    = $0810   INY
    = $0811   BMI $080F
    = $0813   RTS

Compiling `repeat forever`.

    | define main routine
    |   trashes a, y, z, n, c
    | {
    |     ld y, 65
    |     repeat {
    |         inc y
    |     } forever
    | }
    = $080D   LDY #$41
    = $080F   INY
    = $0810   JMP $080F
    = $0813   RTS

The body of `repeat forever` can be empty.

    | define main routine
    | {
    |     repeat {
    |     } forever
    | }
    = $080D   JMP $080D
    = $0810   RTS

Compiling `for ... up to`.

    | byte table[256] tab
    | 
    | define main routine
    |   inputs tab
    |   trashes a, x, c, z, v, n
    | {
    |     ld x, 0
    |     for x up to 15 {
    |         ld a, tab + x
    |     }
    | }
    = $080D   LDX #$00
    = $080F   LDA $0818,X
    = $0812   INX
    = $0813   CPX #$10
    = $0815   BNE $080F
    = $0817   RTS

Compiling `for ... down to`.

    | byte table[256] tab
    | 
    | define main routine
    |   inputs tab
    |   trashes a, x, c, z, v, n
    | {
    |     ld x, 15
    |     for x down to 0 {
    |         ld a, tab + x
    |     }
    | }
    = $080D   LDX #$0F
    = $080F   LDA $0818,X
    = $0812   DEX
    = $0813   CPX #$FF
    = $0815   BNE $080F
    = $0817   RTS

Compiling `save`.

    | define main routine
    |   inputs a
    |   outputs a
    |   trashes z, n
    | {
    |     save a {
    |         save x {
    |             ld a, 0
    |             ld x, 1
    |         }
    |     }
    | }
    = $080D   PHA
    = $080E   TXA
    = $080F   PHA
    = $0810   LDA #$00
    = $0812   LDX #$01
    = $0814   PLA
    = $0815   TAX
    = $0816   PLA
    = $0817   RTS

Compiling `save` with shortcut syntax.

    | define main routine
    |   inputs a
    |   outputs a
    |   trashes z, n
    | {
    |     save a, x {
    |         ld a, 0
    |         ld x, 1
    |     }
    | }
    = $080D   PHA
    = $080E   TXA
    = $080F   PHA
    = $0810   LDA #$00
    = $0812   LDX #$01
    = $0814   PLA
    = $0815   TAX
    = $0816   PLA
    = $0817   RTS

Compiling `save` on a user-defined location.

    | byte foo
    | define main routine
    |   trashes a, z, n
    | {
    |     save foo {
    |         ld a, 0
    |         st a, foo
    |     }
    | }
    = $080D   LDA $081B
    = $0810   PHA
    = $0811   LDA #$00
    = $0813   STA $081B
    = $0816   PLA
    = $0817   STA $081B
    = $081A   RTS

Indexed access.

    | byte one
    | byte table[256] many
    | 
    | define main routine
    |   outputs many
    |   trashes a, x, n, z
    | {
    |     ld x, 0
    |     ld a, 0
    |     st a, many + x
    |     ld a, many + x
    | }
    = $080D   LDX #$00
    = $080F   LDA #$00
    = $0811   STA $0819,X
    = $0814   LDA $0819,X
    = $0817   RTS

Byte tables take up, at most, 256 bytes in memory.

    | byte table[256] tab1
    | byte table[256] tab2
    | 
    | define main routine
    |   inputs tab1
    |   outputs tab2
    |   trashes a, x, n, z
    | {
    |     ld x, 0
    |     ld a, tab1 + x
    |     st a, tab2 + x
    | }
    = $080D   LDX #$00
    = $080F   LDA $0816,X
    = $0812   STA $0916,X
    = $0815   RTS

Byte storage locations take up only 1 byte in memory.

    | byte one
    | byte two
    | 
    | define main routine
    |   outputs one, two
    |   trashes a, x, n, z
    | {
    |     ld a, 0
    |     st a, one
    |     st a, two
    | }
    = $080D   LDA #$00
    = $080F   STA $0816
    = $0812   STA $0817
    = $0815   RTS

Copy byte to byte.

    | byte bar
    | byte baz
    | 
    | define main routine
    |   inputs baz
    |   outputs bar
    |   trashes a, n, z
    | {
    |   copy baz, bar
    | }
    = $080D   LDA $0815
    = $0810   STA $0814
    = $0813   RTS

Copy word to word.

    | word bar
    | word baz
    | 
    | define main routine
    |   inputs baz
    |   outputs bar
    |   trashes a, n, z
    | {
    |   copy baz, bar
    | }
    = $080D   LDA $081C
    = $0810   STA $081A
    = $0813   LDA $081D
    = $0816   STA $081B
    = $0819   RTS

Copy literal word to word.

    | word bar
    | 
    | define main routine
    |   outputs bar
    |   trashes a, n, z
    | {
    |   copy 2000, bar
    | }
    = $080D   LDA #$D0
    = $080F   STA $0818
    = $0812   LDA #$07
    = $0814   STA $0819
    = $0817   RTS

You can also copy a literal word to a word table.

    | word table[256] many
    | 
    | define main routine
    |   inputs many
    |   outputs many
    |   trashes a, x, n, z
    | {
    |     ld x, 0
    |     copy 9999, many + x
    | }
    = $080D   LDX #$00
    = $080F   LDA #$0F
    = $0811   STA $081A,X
    = $0814   LDA #$27
    = $0816   STA $091A,X
    = $0819   RTS

Copy vector to vector.

    | vector routine bar
    | vector routine baz
    | 
    | define main routine
    |   inputs baz
    |   outputs bar
    |   trashes a, n, z
    | {
    |   copy baz, bar
    | }
    = $080D   LDA $081C
    = $0810   STA $081A
    = $0813   LDA $081D
    = $0816   STA $081B
    = $0819   RTS

Copy routine to vector, inside an `interrupts off` block.

    | vector routine
    |   inputs x
    |   outputs x
    |   trashes z, n
    |     bar
    | 
    | define foo routine
    |   inputs x
    |   outputs x
    |   trashes z, n
    | {
    |     inc x
    | }
    | 
    | define main routine
    |   outputs bar
    |   trashes a, n, z
    | {
    |   with interrupts off {
    |     copy foo, bar
    |   }
    | }
    = $080D   SEI
    = $080E   LDA #$1A
    = $0810   STA $081C
    = $0813   LDA #$08
    = $0815   STA $081D
    = $0818   CLI
    = $0819   RTS
    = $081A   INX
    = $081B   RTS

Copy routine (by forward reference) to vector.

    | vector routine
    |   inputs x
    |   outputs x
    |   trashes z, n
    |     bar
    | 
    | define main routine
    |   outputs bar
    |   trashes a, n, z
    | {
    |     copy foo, bar
    | }
    | 
    | define foo routine
    |   inputs x
    |   outputs x
    |   trashes z, n
    | {
    |     inc x
    | }
    = $080D   LDA #$18
    = $080F   STA $081A
    = $0812   LDA #$08
    = $0814   STA $081B
    = $0817   RTS
    = $0818   INX
    = $0819   RTS

Copy word to word table and back, with both `x` and `y` as indexes.

    | word one
    | word table[256] many
    | 
    | define main routine
    |   inputs one, many
    |   outputs one, many
    |   trashes a, x, y, n, z
    | {
    |     ld x, 0
    |     ld y, 0
    |     copy 777, one
    |     copy one, many + x
    |     copy one, many + y
    |     copy many + x, one
    |     copy many + y, one
    | }
    = $080D   LDX #$00
    = $080F   LDY #$00
    = $0811   LDA #$09
    = $0813   STA $084C
    = $0816   LDA #$03
    = $0818   STA $084D
    = $081B   LDA $084C
    = $081E   STA $084E,X
    = $0821   LDA $084D
    = $0824   STA $094E,X
    = $0827   LDA $084C
    = $082A   STA $084E,Y
    = $082D   LDA $084D
    = $0830   STA $094E,Y
    = $0833   LDA $084E,X
    = $0836   STA $084C
    = $0839   LDA $094E,X
    = $083C   STA $084D
    = $083F   LDA $084E,Y
    = $0842   STA $084C
    = $0845   LDA $094E,Y
    = $0848   STA $084D
    = $084B   RTS

Indirect call.

    | vector routine
    |   outputs x
    |   trashes z, n
    |     foo
    | 
    | define bar routine
    |   outputs x
    |   trashes z, n
    | {
    |     ld x, 200
    | }
    | 
    | define main routine
    |   outputs x, foo
    |   trashes a, z, n
    | {
    |     copy bar, foo
    |     call foo
    | }
    = $080D   LDA #$1B
    = $080F   STA $0822
    = $0812   LDA #$08
    = $0814   STA $0823
    = $0817   JSR $081E
    = $081A   RTS
    = $081B   LDX #$C8
    = $081D   RTS
    = $081E   JMP ($0822)
    = $0821   RTS

Compiling `goto`.  Note that no `RTS` is emitted after the `JMP`.

    | define bar routine
    |   inputs y
    |   outputs x, y
    |   trashes z, n
    | {
    |     ld x, 200
    | }
    | 
    | define main routine
    |   outputs x, y
    |   trashes a, z, n
    | {
    |     ld y, 200
    |     goto bar
    | }
    = $080D   LDY #$C8
    = $080F   JMP $0812
    = $0812   LDX #$C8
    = $0814   RTS

### Vector tables

Copying to and from a vector table.

    | vector routine
    |   outputs x
    |   trashes a, z, n
    |     one
    | vector routine
    |   outputs x
    |   trashes a, z, n
    |     table[256] many
    | 
    | define bar routine outputs x trashes a, z, n {
    |     ld x, 200
    | }
    | 
    | define main routine
    |   inputs one, many
    |   outputs one, many
    |   trashes a, x, n, z
    | {
    |     ld x, 0
    |     copy bar, one
    |     copy bar, many + x
    |     copy one, many + x
    |     copy many + x, one
    |     call one
    | }
    = $080D   LDX #$00
    = $080F   LDA #$3F
    = $0811   STA $0846
    = $0814   LDA #$08
    = $0816   STA $0847
    = $0819   LDA #$3F
    = $081B   STA $0848,X
    = $081E   LDA #$08
    = $0820   STA $0948,X
    = $0823   LDA $0846
    = $0826   STA $0848,X
    = $0829   LDA $0847
    = $082C   STA $0948,X
    = $082F   LDA $0848,X
    = $0832   STA $0846
    = $0835   LDA $0948,X
    = $0838   STA $0847
    = $083B   JSR $0842
    = $083E   RTS
    = $083F   LDX #$C8
    = $0841   RTS
    = $0842   JMP ($0846)
    = $0845   RTS

### word operations

Adding a constant word to a word memory location.

    | word score
    | define main routine
    |   inputs score
    |   outputs score
    |   trashes a, c, z, v, n
    | {
    |     st off, c
    |     add score, 1999
    | }
    = $080D   CLC
    = $080E   LDA $081F
    = $0811   ADC #$CF
    = $0813   STA $081F
    = $0816   LDA $0820
    = $0819   ADC #$07
    = $081B   STA $0820
    = $081E   RTS

Adding a word memory location to another word memory location.

    | word score
    | word delta
    | define main routine
    |   inputs score, delta
    |   outputs score
    |   trashes a, c, z, v, n
    | {
    |     st off, c
    |     add score, delta
    | }
    = $080D   CLC
    = $080E   LDA $0821
    = $0811   ADC $0823
    = $0814   STA $0821
    = $0817   LDA $0822
    = $081A   ADC $0824
    = $081D   STA $0822
    = $0820   RTS

Subtracting a constant word from a word memory location.

    | word score
    | define main routine
    |   inputs score
    |   outputs score
    |   trashes a, c, z, v, n
    | {
    |     st on, c
    |     sub score, 1999
    | }
    = $080D   SEC
    = $080E   LDA $081F
    = $0811   SBC #$CF
    = $0813   STA $081F
    = $0816   LDA $0820
    = $0819   SBC #$07
    = $081B   STA $0820
    = $081E   RTS

Subtracting a word memory location from another word memory location.

    | word score
    | word delta
    | define main routine
    |   inputs score, delta
    |   outputs score
    |   trashes a, c, z, v, n
    | {
    |     st on, c
    |     sub score, delta
    | }
    = $080D   SEC
    = $080E   LDA $0821
    = $0811   SBC $0823
    = $0814   STA $0821
    = $0817   LDA $0822
    = $081A   SBC $0824
    = $081D   STA $0822
    = $0820   RTS

### Buffers and Pointers

Load address into pointer.

    | buffer[2048] buf
    | pointer ptr @ 254
    | 
    | define main routine
    |   inputs buf
    |   outputs buf, y
    |   trashes a, z, n, ptr
    | {
    |     ld y, 0
    |     copy ^buf, ptr
    | }
    = $080D   LDY #$00
    = $080F   LDA #$18
    = $0811   STA $FE
    = $0813   LDA #$08
    = $0815   STA $FF
    = $0817   RTS

Write literal through a pointer.

    | buffer[2048] buf
    | pointer ptr @ 254
    | 
    | define main routine
    |   inputs buf
    |   outputs buf, y
    |   trashes a, z, n, ptr
    | {
    |     ld y, 0
    |     copy ^buf, ptr
    |     copy 123, [ptr] + y
    | }
    = $080D   LDY #$00
    = $080F   LDA #$1C
    = $0811   STA $FE
    = $0813   LDA #$08
    = $0815   STA $FF
    = $0817   LDA #$7B
    = $0819   STA ($FE),Y
    = $081B   RTS

Write stored value through a pointer.

    | buffer[2048] buf
    | pointer ptr @ 254
    | byte foo
    | 
    | define main routine
    |   inputs foo, buf
    |   outputs y, buf
    |   trashes a, z, n, ptr
    | {
    |     ld y, 0
    |     copy ^buf, ptr
    |     copy foo, [ptr] + y
    | }
    = $080D   LDY #$00
    = $080F   LDA #$1D
    = $0811   STA $FE
    = $0813   LDA #$08
    = $0815   STA $FF
    = $0817   LDA $101D
    = $081A   STA ($FE),Y
    = $081C   RTS

Read through a pointer, into a byte storage location, or the `a` register.

    | buffer[2048] buf
    | pointer ptr @ 254
    | byte foo
    | 
    | define main routine
    |   inputs buf
    |   outputs y, foo
    |   trashes a, z, n, ptr
    | {
    |     ld y, 0
    |     copy ^buf, ptr
    |     copy [ptr] + y, foo
    |     ld a, [ptr] + y
    | }
    = $080D   LDY #$00
    = $080F   LDA #$1F
    = $0811   STA $FE
    = $0813   LDA #$08
    = $0815   STA $FF
    = $0817   LDA ($FE),Y
    = $0819   STA $101F
    = $081C   LDA ($FE),Y
    = $081E   RTS

Read and write through two pointers.

    | buffer[2048] buf
    | pointer ptra @ 252
    | pointer ptrb @ 254
    | 
    | define main routine
    |   inputs buf
    |   outputs buf
    |   trashes a, y, z, n, ptra, ptrb
    | {
    |     ld y, 0
    |     copy ^buf, ptra
    |     copy ^buf, ptrb
    |     copy [ptra] + y, [ptrb] + y
    | }
    = $080D   LDY #$00
    = $080F   LDA #$24
    = $0811   STA $FC
    = $0813   LDA #$08
    = $0815   STA $FD
    = $0817   LDA #$24
    = $0819   STA $FE
    = $081B   LDA #$08
    = $081D   STA $FF
    = $081F   LDA ($FC),Y
    = $0821   STA ($FE),Y
    = $0823   RTS

Write the `a` register through a pointer.

    | buffer[2048] buf
    | pointer ptr @ 254
    | byte foo
    | 
    | define main routine
    |   inputs buf
    |   outputs buf
    |   trashes a, y, z, n, ptr
    | {
    |     ld y, 0
    |     copy ^buf, ptr
    |     ld a, 255
    |     st a, [ptr] + y
    | }
    = $080D   LDY #$00
    = $080F   LDA #$1C
    = $0811   STA $FE
    = $0813   LDA #$08
    = $0815   STA $FF
    = $0817   LDA #$FF
    = $0819   STA ($FE),Y
    = $081B   RTS

Add a word memory location, and a literal word, to a pointer, and then read through it.
Note that this is *not* range-checked.  (Yet.)

    | buffer[2048] buf
    | pointer ptr @ 254
    | byte foo
    | word delta
    | 
    | define main routine
    |   inputs buf
    |   outputs y, foo, delta
    |   trashes a, c, v, z, n, ptr
    | {
    |     copy 619, delta
    |     ld y, 0
    |     st off, c
    |     copy ^buf, ptr
    |     add ptr, delta
    |     add ptr, word 1
    |     copy [ptr] + y, foo
    | }
    = $080D   LDA #$6B
    = $080F   STA $1043
    = $0812   LDA #$02
    = $0814   STA $1044
    = $0817   LDY #$00
    = $0819   CLC
    = $081A   LDA #$42
    = $081C   STA $FE
    = $081E   LDA #$08
    = $0820   STA $FF
    = $0822   LDA $FE
    = $0824   ADC $1043
    = $0827   STA $FE
    = $0829   LDA $FF
    = $082B   ADC $1044
    = $082E   STA $FF
    = $0830   LDA $FE
    = $0832   ADC #$01
    = $0834   STA $FE
    = $0836   LDA $FF
    = $0838   ADC #$00
    = $083A   STA $FF
    = $083C   LDA ($FE),Y
    = $083E   STA $1042
    = $0841   RTS

### Trash

Trash does nothing except indicate that we do not care about the value anymore.

    | define main routine
    |   inputs a
    |   outputs x
    |   trashes a, z, n
    | {
    |     ld x, a
    |     ld a, 0
    |     trash a
    | }
    = $080D   TAX
    = $080E   LDA #$00
    = $0810   RTS

### static ###

Memory locations defined static to a routine are allocated
just the same as initialized global storage locations are.

    | define foo routine
    |   inputs x
    |   outputs x
    |   trashes z, n
    |   static byte t : 255
    | {
    |   st x, t
    |   inc t
    |   ld x, t
    | }
    | 
    | define main routine
    |   trashes a, x, z, n
    |   static byte t : 7
    | {
    |   ld x, t
    |   call foo
    | }
    = $080D   LDX $081F
    = $0810   JSR $0814
    = $0813   RTS
    = $0814   STX $081E
    = $0817   INC $081E
    = $081A   LDX $081E
    = $081D   RTS
    = $081E   .byte $FF
    = $081F   .byte $07