Repository navigation
Expand file tree
/
Copy pathcgi.comments
More file actions
962 lines (962 loc) · 30.6 KB
/
Copy pathcgi.comments
File metadata and controls
962 lines (962 loc) · 30.6 KB
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
{-- Misc. pcodes -----------------------------------------------}
{ }
{ dc_cns - generate a constant value }
{ }
{ GenL1(dc_cns, lval, count); }
{ GenR1t(dc_cns, rval, count, type); }
{ Gen2t(dc_cns, ival, count, type); }
{ GenS(dc_cns, sptr); }
{ }
{ Creates COUNT occurrances of the constant lval, rval or }
{ ival, based on the type. In Gen2t can accept byte or word }
{ types. In the case of GenS, the operand is a string }
{ constant, and no repeat count is allowed. }
{ }
{ }
{ dc_glb - generate global label }
{ }
{ Gen2Name(dc_glb, r, q, lab) }
{ }
{ Creates a global label in the current segment with the name }
{ LAB^. If Q is 1, the label is marked as private to the }
{ current segment, otherwise it is marked as public. R bytes }
{ of space are reserved. }
{ }
{ }
{ dc_dst - generate global storage }
{ }
{ Gen1(dc_dst, q) }
{ }
{ Creates q bytes of storage (initialized to 0) at the }
{ current location. }
{ }
{ }
{ pc_lnm - line number }
{ }
{ Gen2(pc_lnm, lc, flag) }
{ }
{ Sets the current line number for the traceback facility and }
{ debugger. This p-code should only be generated after the }
{ pc_ent and pc_nam (if any), and should not be generated }
{ outside of a subroutine. Lc is the line number, while flag }
{ indicates the type of debugging action on this line: }
{ }
{ 0 - step/trace }
{ 1 - break point }
{ 2 - auto-go }
{ }
{ }
{ pc_mov - move memory }
{ }
{ Gen2(pc_mov, banks, bytes) }
{ }
{ The top of stack contains a source address, and TOS-1 has a }
{ destination address. The destination address is removed, }
{ and BYTES bytes are moved from the source to the }
{ destination. BANKS is the number of full banks to move; it }
{ is used when 64K or more must be moved. The memory areas }
{ must not overlap. }
{ }
{ }
{ pc_nam - subroutine name }
{ }
{ GenPS(pc_nam, str) }
{ }
{ Sets the subroutine name for the traceback facility, }
{ debugger, and profiler. Str is a pointer to the subroutine }
{ name. The following global variables should be set to }
{ appropriate values when this p-code is used: }
{ }
{ debugFlag - are we generating debug code? }
{ profileFlag - are we profiling? }
{ traceBack - are we doing tracebacks? }
{ includeFile - current source file name }
{ }
{-- Pcodes involved expressions --------------------------------}
{ }
{ pc_abi - integer absolute value }
{ pc_abl - longint absolute value }
{ pc_abr - real absolute value }
{ }
{ Gen0(pc_abi) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_abl) cgLong,cgULong }
{ Gen0(pc_abr) cgReal,cgDouble,cgComp,cgExtended }
{ }
{ The value on the top of the evaluation stack is replaced }
{ by its absolute value. }
{ }
{ }
{ pc_acs - arc cosine }
{ }
{ Gen0 (pc_acs) }
{ }
{ Replace the top of stack with its arc cosine. }
{ }
{ }
{ pc_adi - integer addition }
{ pc_adl - long addition }
{ pc_adr - real addition }
{ }
{ Gen0(pc_adi) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_adl) cgLong,cgULong }
{ Gen0(pc_adr) cgReal,cgDouble,cgComp,cgExtended }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and added. The result is placed back on the stack. }
{ }
{ }
{ pc_and - logical and }
{ pc_lnd - long logical and }
{ }
{ Gen0(pc_and) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_lnd) cgLong,cgULong }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and anded. The result is placed back on the stack. }
{ Zero is treated as false, and any other value as true. The }
{ and is a logical and. See pc_bnd for a bitwise and. }
{ }
{ If the first operand is false, the second operand is not }
{ evaluated. }
{ }
{ }
{ pc_asn - arc sine }
{ }
{ Gen0 (pc_asn) }
{ }
{ Replace the top of stack with its arc sine. }
{ }
{ }
{ pc_atn - arc tangent }
{ }
{ Gen0 (pc_atn) }
{ }
{ Replace the top of stack with its arc tangent. }
{ }
{ }
{ pc_at2 - two argument arc tangent }
{ }
{ Gen0 (pc_at2) }
{ }
{ Removes two real arguments from the stack, replacing then }
{ with their two-argument arc-tangent. }
{ }
{ }
{ pc_bnd - bitwise and }
{ pc_bal - long bitwise and }
{ }
{ Gen0(pc_bnd) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_bal) cgLong,cgULong }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and anded. The result is placed back on the stack. }
{ }
{ }
{ pc_bno - binary operand no-operation }
{ }
{ Gen0t(pc_bno, type) }
{ }
{ The left operand is evaluated and discarded, followed by }
{ the evaluation of the right operand. The type is the type }
{ of the right operand; it is used in case a pc_pop is }
{ attached to remove a result left on the stack. This }
{ instruction is used by C for the comma operator and for }
{ parameter lists for function and procedure calls, and by }
{ pc_tri to hold the two expressions. }
{ }
{ }
{ pc_bnt - bitwise negation }
{ pc_bnl - long bitwise negation }
{ }
{ Gen0(pc_bnt) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_bnl) cgLong,cgULong }
{ }
{ The value on the top of the evaluation stack is removed, }
{ exclusive ored with $FFFF, and replaced. (One's compliment.)}
{ }
{ }
{ pc_bor - bitwise or }
{ pc_blr - long bitwise or }
{ }
{ Gen0(pc_bor) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_blr) cgLong,cgULong }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and ored. The result is placed back on the stack. }
{ }
{ }
{ pc_bxr - exclusive or }
{ pc_blx - long exclusive or }
{ }
{ Gen0(pc_bxr) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_blx) cgLong,cgULong }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and exclusive ored. The result is placed back on }
{ the stack. }
{ }
{ }
{ pc_cbf - copy bit field }
{ }
{ pc_chk - check subrange }
{ }
{ Gen2t(pc_chk, low, high, type) cgByte,cgUByte,cgWord, }
{ cgUWord }
{ GenL2t(pc_chk, low, high, type) cgLong,cgULong }
{ }
{ Make sure the value on the top of stack is in [low..high]. }
{ }
{ }
{ pc_cop - copy to a local variable }
{ }
{ Gen2t(pc_cop, label, disp, type) }
{ }
{ Saves the value on the top of the evaluation stack to DISP }
{ bytes past the local label LABEL. TYPE is the type of the }
{ value being saved. }
{ }
{ }
{ pc_cos - cosine }
{ }
{ Gen0 (pc_cos) }
{ }
{ Replace the top of stack with its cosine. }
{ }
{ }
{ pc_cnv - convert from one scalar type to another }
{ pc_cnn - convert from one scalar type to another }
{ }
{ Gen2(pc_cnv, from, to) }
{ Gen2(pc_cnn, from, to) }
{ }
{ Converts from one scalar type to another. The from and to }
{ parameters are ordinal values of type baseTypeEnum. The }
{ table below shows what from values (along the left edge) and }
{ to values (along the top) are allowed, and what action is }
{ taken for each combination. CgDouble, cgComp or cgExtended }
{ may be used anywhere that cgReal is used, with the same }
{ results. }
{ }
{ The pc_cnn form converts the value at tos-1. The value at }
{ tos is assumed to be the same size as the result type. }
{ }
{ cgByte cgUByte cgWord cgUWord cgLong cgULong cgReal }
{ cgByte extend extend float }
{ cgUByte padd padd float }
{ cgWord extend extend float }
{ cgUWord extend extend float }
{ cgLong discard discard discard discard float }
{ cgULong discard discard discard discard float }
{ cgReal trunc trunc trunc trunc trunc trunc }
{ }
{ The meaning of the operationd shown in the table is: }
{ }
{ (blank) No action is taken, but the instruction is }
{ accepted by the code generator. }
{ extend The value is sign extended to the proper length.}
{ padd The value is padded on the left with zero bits }
{ to extend it to the proper length. }
{ discard Extra bits are discarded to reach the proper }
{ length, starting with the most significant bit. }
{ float An integer value is converted to a real value. }
{ trunc A real value is converted to the largest }
{ integer value that is less than or equal to the }
{ real value. }
{ }
{ }
{ pc_cpo - copy to a global variable }
{ }
{ Gen1tName (pc_cpo, disp, type, name) }
{ }
{ Saves the value on the top of the evaluation stack to the }
{ global label NAME. DISP is a fixed displacement past the }
{ names label to load from. (Used for records.) TYPE is }
{ the type of the value being loaded. }
{ }
{ }
{ pc_dec - decrement }
{ }
{ Gen1t(pc_dec, val, type) }
{ }
{ The value on the top of the stack is removed, decremented by }
{ VAL and returned to the stack. Type may be cgByte, cgUByte, }
{ cgWord, cgUWord, cgLong or cgULong. In all cases, the }
{ amount to decrement by is a positive signed integer. }
{ }
{ }
{ pc_dif - set difference }
{ }
{ Gen0(pc_dif) }
{ }
{ Two sets are removed from the top of stack. All elements }
{ in the set at TOS are removed from the set at TOS-1, and the }
{ resulting set is pushed. }
{ }
{ }
{ pc_dvi - integer divide }
{ pc_udi - unsigned integer divide }
{ pc_dvl - long integer divide }
{ pc_udl - unsigned long divide }
{ pc_dvr - real divide }
{ }
{ Gen0(pc_dvi) cgByte,cgWord }
{ Gen0(pc_udi) cgUByte,cgUWord }
{ Gen0(pc_dvl) cgLong }
{ Gen0(pc_udl) cgULong }
{ Gen0(pc_dvr) cgReal,cgDouble,cgComp,cgExtended }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and divided. The result is placed back on the }
{ stack. The result type is the same as the argument type. }
{ }
{ }
{ pc_equ,pc_geq,pc_grt,pc_leq,pc_les,pc_neq - compares }
{ }
{ Gen0t(pc_equ, type) }
{ Gen2t(pc_equ, size1, size2, type) }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and compared. A boolean result is placed back on }
{ the stack. The second form is used to compare strings; the }
{ two parameters are the size of the Standard Pascal string }
{ array, or -1 for p-Strings. }
{ }
{ }
{ pc_exp - exponent }
{ }
{ Gen0 (pc_exp) }
{ }
{ Replace the top of stack with its exponent. }
{ }
{ }
{ pc_fix - fix a floating-point variable }
{ }
{ Gen1t(pc_fix, lab, type) }
{ }
{ Change a floating-point value (generally a passed parameter) }
{ from extended to either cgReal or cgDouble. }
{ }
{ }
{ pc_inc - increment }
{ }
{ Gen1t(pc_inc, val, type) }
{ }
{ The value on the top of the stack is removed, incremented by }
{ VAL and returned to the stack. Type may be cgByte, cgUByte, }
{ cgWord, cgUWord, cgLong or cgULong. In all cases, the }
{ amount to increment by is a positive signed integer. }
{ }
{ }
{ pc_ind - load indirect }
{ }
{ Gen1t (pc_ind, disp, type) }
{ Gen2t (pc_ind, disp, size, type) }
{ }
{ A value of type TYPE is loaded from DISP bytes past the }
{ address that is on the evaluation stack. The address is }
{ removed from the stack and replaced with the value. }
{ }
{ Gen2t is used for sets, where SIZE is the size of the set. }
{ }
{ }
{ pc_inn - set inclusion }
{ }
{ Gen0 (pc_inn) }
{ }
{ The top of stack is a set, and the next value on the stack }
{ is a word. The values are pulled. TRUE is pushed if the }
{ word value is in the set; FALSE is pushed if not. }
{ }
{ }
{ pc_int - set intersection }
{ }
{ Gen0(pc_int) }
{ }
{ Two sets are removed from the top of stack. The }
{ intersection of the two sets is pushed. }
{ }
{ }
{ pc_ior - logical or }
{ pc_lor - long logical or }
{ }
{ Gen0(pc_ior) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_lor) cgLong,cgULong }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and ored. The result is placed back on the stack. }
{ Zero is treated as false, and any other value as true. The }
{ or is a logical or. See pc_bor for a bitwise or. }
{ }
{ }
{ pc_ixa - integer indexed address }
{ }
{ Gen0t(pc_ixa, type) }
{ }
{ TOS is an integer, which is added to TOS-1, which is a long }
{ integer. This instruction is generally used for computing }
{ short array indexes. }
{ }
{ TYPE can be cgWord or cgUWord; the type indicates whether }
{ the addition is signed or unsigned. }
{ }
{ }
{ pc_lad - load the address of a subroutine }
{ }
{ Gen0Name(pc_lad, name); }
{ }
{ Loads the address of the subroutine NAME. }
{ }
{ }
{ pc_lao - load a global address }
{ }
{ Gen1Name(pc_lao, disp, name); }
{ }
{ Loads the address of DISP bytes past the global variable }
{ NAME onto the stack. }
{ }
{ }
{ pc_lca - load a string constant address }
{ }
{ GenPS(pc_lca, str) }
{ }
{ Loads the address of a string onto the stack. Str is a }
{ pointer to a string constant. }
{ }
{ }
{ pc_lda - load a local address }
{ }
{ Gen3(pc_lda, label, level, disp) }
{ }
{ Loads the address of DISP bytes past the local label LABEL. }
{ LEVEL is the number of stack frames to traverse. }
{ }
{ }
{ pc_ldc - load a constant }
{ }
{ Gen1t(pc_ldc, val, type) }
{ GenLdcLong(val) }
{ GenLdcReal(val) }
{ }
{ Loads a constant value. Special calls for long and real }
{ values are provided due to the unique parameter requirements.}
{ }
{ }
{ pc_ldo - load from a global variable }
{ }
{ Gen1tName (pc_ldo, disp, type, name) }
{ Gen2tName (pc_ldo, disp, size, type, name) }
{ }
{ Loads a value from the global label NAME and places it on }
{ the evaluation stack. DISP is a fixed displacement past the }
{ names label to load from. (Used for records.) TYPE is }
{ the type of the value being loaded. }
{ }
{ Gen2tName is used for sets, where SIZE is the size of the }
{ set. }
{ }
{ }
{ pc_lla - load the address of a local label }
{ }
{ Gen1(pc_lda, label) }
{ }
{ Loads the address LABEL. This is generally used to load the }
{ address of a procedure. }
{ }
{ }
{ pc_lsl - load static link }
{ }
{ Gen1(pc_lsl, level) }
{ }
{ Loads the address of the stack frame LEVEL static links }
{ back. }
{ }
{ }
{ pc_lod - load from a local variable }
{ }
{ Gen3t(pc_lod, label, disp, level, type) }
{ Gen4t(pc_lod, label, disp, level, size, type) }
{ }
{ Loads a value from DISP bytes past the local label LABEL and }
{ places it on the evaluation stack. TYPE is the type is the }
{ value being loaded. LEVEL is the number of stack frames to }
{ skip; it is 0 for the local stack frame. }
{ }
{ Gen4t is used for sets, where SIZE is the size of the set. }
{ }
{ }
{ pc_log - logarithm }
{ }
{ Gen0 (pc_log) }
{ }
{ Replace the top of stack with its log. }
{ }
{ }
{ pc_mod - integer modulus }
{ pc_uim - unsigned integer modulus }
{ pc_mdl - long modulus }
{ pc_ulm - unsigned long modulus }
{ }
{ Gen0(pc_mod) cgByte,cgWord }
{ Gen0(pc_uim) cgUByte,cgUWord }
{ Gen0(pc_mdl) cgLong }
{ Gen0(pc_ulm) cgULong }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and a molulus operation is performed. The result is }
{ placed back on the stack. The result, like the arguments, }
{ is an integer. }
{ }
{ }
{ pc_mpi - integer multiply }
{ pc_umi - unsigned integer multiply }
{ pc_mpl - long integer multiply }
{ pc_uml - unsigned long multiply }
{ pc_mpr - real multiply }
{ }
{ Gen0(pc_mpi) cgByte,cgWord }
{ Gen0(pc_umi) cgUByte,cgUWord }
{ Gen0(pc_mpl) cgLong }
{ Gen0(pc_uml) cgULong }
{ Gen0(pc_mpr) cgReal,cgDouble,cgComp,cgExtended }
{ }
{ The two values on the top of the evaluation stack are }
{ removed and multiplied. The result is placed back on the }
{ stack. The result type is the same as the argument type. }
{ }
{ }
{ pc_ngi - integer negation }
{ pc_ngl - long negation }
{ pc_ngr - real negation }
{ }
{ Gen0(pc_ngi) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_ngl) cgLong,cgULong }
{ Gen0(pc_ngr) cgReal,cgDouble,cgComp,cgExtended }
{ }
{ The value on the top of the evaluation stack is removed, }
{ subtracted from 0, and replaced. (Two's compliment.) }
{ }
{ }
{ Gen0(pc_nop) }
{ }
{ This operand is a leaf node. It does nothing. It is used }
{ to create a null expression tree for functions and }
{ procedures that have no parameters. }
{ }
{ }
{ pc_not - logical negation }
{ }
{ Gen0(pc_not) }
{ }
{ The value on the top of the evaluation stack is removed, }
{ logically negated, and replaced. }
{ }
{ }
{ pc_odd - is an integer odd? }
{ pc_odl - is a long integer odd? }
{ }
{ Gen0 (pc_odd) }
{ Gen0 (pc_odl) }
{ }
{ The top of stack is an integer. It is removed, and replaced }
{ with a boolean TRUE if the integer is odd, or FALSE if the }
{ integer is even. }
{ }
{ }
{ pc_pop - pop a value from the stack }
{ }
{ Gen0t(pc_pop, type) }
{ }
{ The value on the top of the evaluation stack is removed. }
{ }
{ }
{ pc_rnd - round }
{ pc_rn4 - round }
{ }
{ Gen0 (pc_rnd) returns cgWord }
{ Gen0 (pc_rn4) returns cgLong }
{ }
{ TOP is a real value; it is removed and replaced with the }
{ closest integer value. }
{ }
{ }
{ pc_sbi - integer subtraction }
{ pc_sbl - long subtraction }
{ pc_sbr - real subtraction }
{ }
{ Gen0(pc_sbi) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_sbl) cgLong,cgULong }
{ Gen0(pc_sbr) cgReal,cgDouble,cgComp,cgExtended }
{ }
{ The two values on the top of the evaluation stack are }
{ removed. TOS-1 - TOS is placed back on the stack. }
{ }
{ }
{ pc_sgs - singleton set }
{ }
{ Gen0(pc_sgs) }
{ }
{ Two integer values on the top of stack for a subrange of }
{ TOS-1..TOS. The integers are removed, and a set with the }
{ equivalent elements is pushed. }
{ }
{ }
{ pc_shl - shift left }
{ pc_sll - shift left long }
{ }
{ Gen0(pc_shl) cgByte,cgUByte,cgWord,cgUWord }
{ Gen0(pc_sll) cgLong,cgULong }
{ }
{ The value at tos-1 is shifted left by the number of bits }
{ specified by tos. The result is an integer, which replaces }
{ the operands on the stack. The right bit positions are }
{ filled with zeros. }
{ }
{ }
{ pc_shr - shift right }
{ pc_usr - unsigned shift right }
{ pc_slr - long shift right }
{ pc_vsr - unsigned long shift right }
{ }
{ Gen0(pc_shr) cgByte,cgWord }
{ Gen0(pc_usr) cgUByte,cgUWord }
{ Gen0(pc_slr) cgLong }
{ Gen0(pc_vsr) cgULong }
{ }
{ The value at tos-1 is shifted right by the number of bits }
{ specified by tos. The result is an integer, which replaces }
{ the operands on the stack. This is a signed shift: the }
{ leftmost bit position is filled in with a copy of the }
{ orignial leftmost bit. }
{ }
{ Pc_usr is the unsigned form. The operation is the same, }
{ except that the leftmost bit is replaced with a zero. }
{ Pc_vsr is used for unsigned long operations. }
{ }
{ }
{ pc_sin - sine }
{ }
{ Gen0 (pc_sin) }
{ }
{ Replace the top of stack with its sine. }
{ }
{ }
{ pc_siz - set the size of a set }
{ }
{ Gen1(pc_siz, size) }
{ }
{ The top of stack is a set; it is forces to the specified }
{ size. }
{ }
{ }
{ pc_stk - stack an operand }
{ }
{ Gen0t(pc_stk, type) }
{ }
{ The value on top of the evaluation stack is to be left there }
{ as a parameter to a subsequent procedure or function call. }
{ This p-code "caps" the expression tree, giving the code }
{ generator something to do with the expression result. }
{ }
{ }
{ pc_sro - store to a global variable }
{ }
{ Gen1tName (pc_sro, disp, type, name) }
{ Gen2tName (pc_sro, disp, size, type, name) }
{ }
{ Saves the value from the top of the evaluation stack to the }
{ global label NAME. DISP is a fixed displacement past the }
{ names label to load from. (Used for records.) TYPE is }
{ the type of the value being loaded. }
{ }
{ Gen2tName is used for sets, where SIZE is the size of the }
{ set. }
{ }
{ }
{ pc_sto - store indirect }
{ }
{ Gen0t(pc_sto, type) }
{ Gen1t(pc_sto, size, type) }
{ }
{ Two values are removed from the evaluation stack. TOS is of }
{ type TYPE, while TOS-1 is a pointer. The value is stored at }
{ the location pointed to by the pointer. }
{ }
{ Gen1t is used for sets, where SIZE is the size of the set. }
{ }
{ }
{ pc_str - store to a local variable }
{ }
{ Gen3t(pc_str, label, disp, level, type) }
{ Gen4t(pc_str, label, disp, level, size, type) }
{ }
{ Saves the value on the top of the evaluation stack to DISP }
{ bytes past the local label LABEL. TYPE is the type of the }
{ value being saved. }
{ }
{ Gen4t is used for sets, where SIZE is the size of the set. }
{ }
{ }
{ pc_sqr - square a real number }
{ pc_sqi - square an integer }
{ pc_sql - square a long integer }
{ }
{ Gen0 (pc_sqr) }
{ Gen0 (pc_sqi) }
{ Gen0 (pc_sql) }
{ }
{ Replace the top of stack with its square. }
{ }
{ }
{ pc_sqt - square root of a real number }
{ }
{ Gen0 (pc_sqt) }
{ }
{ Replace the top of stack with its square root. }
{ }
{ }
{ pc_tan - tangent }
{ }
{ Gen0 (pc_tan) }
{ }
{ Replace the top of stack with its tangent. }
{ }
{ }
{ pc_uni - set union }
{ }
{ Gen0(pc_uni) }
{ }
{ Two sets are removed from the top of stack. The union of }
{ the two sets is pushed. }
{ }
{-- Flow of control --------------------------------------------}
{ }
{ dc_lab - define a label }
{ }
{ Gen1(pc_lab, lab) }
{ }
{ Defines label number lab at the current location. }
{ }
{ }
{ pc_add - address }
{ }
{ Gen1(pc_add, lab) }
{ }
{ Generates a two-byte address that points to the label lab. }
{ This is used to create branch tables for pc_xjp }
{ instructions. }
{ }
{ }
{ pc_fjp - jump if false }
{ }
{ Gen1(pc_fjp, lab) }
{ }
{ A boolean value is removed from the top of the evaluation }
{ stack. If the value is false, execution continues with the }
{ instruction after the label lab; otherwise execution }
{ continues with the instruction after this one. }
{ }
{ }
{ pc_tjp - jump if true }
{ }
{ Gen1(pc_tjp, lab) }
{ }
{ A boolean value is removed from the top of the evaluation }
{ stack. If the value is true, execution continues with the }
{ instruction after the label lab; otherwise execution }
{ continues with the instruction after this one. }
{ }
{ }
{ pc_prs - pop return stack }
{ }
{ Gen0(pc_prs) }
{ }
{ Pop one static frame (and any intervening dynamic frames) }
{ from the return stack. This is used for pc_ujp instructions }
{ that branch outside the current subroutine. }
{ }
{ }
{ pc_pwr - raise a number to a power. }
{ }
{ Gen0 (pc_pwr) }
{ }
{ Replace the top of stack with TOS-1 raised to the TOS power. }
{ }
{ }
{ pc_ujp - jump }
{ }
{ Gen1(pc_ujp, lab) }
{ Gen0Name(pc_ujp, lab) }
{ }
{ Execution continues with the instruction after the label }
{ LAB. This can be a numbered, local label (Gen1) or a named, }
{ global label (Gen0Name). }
{ }
{ }
{ pc_xjp - indexed jump }
{ }
{ Gen1(pc_xjp, val) }
{ }
{ The top of stack contains an integer, which is removed. If }
{ it is less than zero or greater than VAL, it is replaced by }
{ VAL. The result is then used to index into a jump table, }
{ formed using pc_add instructions, which follows immediately }
{ after the pc_xjp instruction. }
{ }
{-- Pcodes involved with calling and defining procedures -------}
{ }
{ dc_str - start a segment }
{ }
{ Gen2Name(dc_str, p1, p2, name) }
{ }
{ Starts a new object segment with the name name^. P1 is the }
{ segment kind, while p2 is the length code (1 for data, 0 for }
{ code segments). }
{ }
{ }
{ dc_pin - procedure entry point }
{ }
{ Gen0(dc_pin) }
{ }
{ A code segment does not have to be entered at the first byte }
{ when called. This directive is used one time in each code }
{ segment to indicate the actual entry point. }
{ }
{ }
{ dc_enp - end a segment }
{ }
{ Gen0(dc_enp) }
{ }
{ This directive closes the current segment. }
{ }
{ }
{ pc_ent - enter a subroutine }
{ }
{ Gen0(pc_ent) }
{ }
{ This pcode is used at the beginning of every subroutine. It }
{ marks the beginning of a new stack frame definition. }
{ Subsequent dc_loc and dc_prm cause space to be allocated }
{ from this stack frame. }
{ }
{ }
{ pc_ret - return from a subroutine }
{ }
{ Gen0t(pc_ret, type) }
{ }
{ This pcode is used to return from a function or a procedure. }
{ The type is the type of the function, and is used to tell }
{ the code generator what type of value to return. The value }
{ to return is assumed to be stored defaultStackSize bytes }
{ into the stack frame. }
{ }
{ }
{ pc_cui - call user procedure, indirect }
{ }
{ Gen0t(pc_cui, ftype) }
{ }
{ TOS-1 is the address of a procedure or function to call. }
{ TOS is the static level for the procedure. These values are }
{ removed from the stack, and the procedure is called. }
{ }
{ }
{ pc_cum - call user method }
{ }
{ GenL1t(pc_cum, disp, ftype) }
{ }
{ A series of parameters is on the stack; the first is the }
{ SELF parameter. DISP is a displacement into the object }
{ where the address of the method to call can be found. }
{ }
{ }
{ pc_cup - call user procedure }
{ }
{ Gen1tName(pc_cup, level, ftype, name) }
{ Gen2t(pc_cup, label, level, ftype) }
{ }
{ Calls a user procedure or function. FTYPE is the return }
{ type. NAME is the name of a global procedure; LABEL is used }
{ for local procedures. LEVEL is the ??? }
{ }
{ }
{ pc_csp - call standard procedure }
{ }
{ Gen1(pc_csp, proc) }
{ }
{ Calls a standard procedure or function. PROC is the }
{ procedure or function name. }
{ }
{ }
{ dc_loc - define local label }
{ }
{ Gen2(dc_loc, label, size) }
{ }
{ Defines a local label using the label parameter as a label }
{ number. Size bytes are reserved on the stack frame. Label }
{ numbers should be assigned by the compiler, starting with }
{ number 1. Label 0 is reserved for refering to the return }
{ value of a function (if any). }
{ }
{ }
{ dc_prm - define parameter }
{ }
{ Gen3(dc_prm, label, size, disp) }
{ }
{ Defines a label used to refer to a parameter. See dc_loc }
{ for a discussion of the label and size parameters. The disp }
{ parameter is the number of bytes of parameter that will be }
{ pushed after this one; i.e., the disp from the return addr }
{ to this parameter. }
{ }
{ }
{ dc_fun - define function variable }
{ }
{ Gen2(dc_fun, label, size) }
{ }
{ Defines a label used to refer to the function return value. }
{ This works like dc_loc, but requires special tracking so the }
{ pc_ret statement can find the value. }
{ }
{ }
{ pc_pds - call ProDOS }
{ }
{ Gen1(pc_pds, callNum) }
{ }
{ Calls ProDOS. CALLNUM is the ProDOS call number. The }
{ address of the parameter block is on the stack. }
{ }
{ }
{ pc_tl1 - call a tool }
{ pc_tl2 - call a tool }
{ }
{ Gen2t(pc_tl1, toolNum, callNum, type) }
{ }
{ Calls a tool. The tool number is TOOLNUM; the tool call }
{ is CALLNUM. TYPE is the return type, which must be one of }
{ the integer types or cgVoid. pc_tl1 calls the system entry }
{ point, while pc_tl2 calls the user tool entry point. }
{ }
{ }
{ pc_vct - call a tool through a vector }
{ }
{ Gen1L1t(pc_vct, call, vector, type) }
{ }
{ Generates a call using toolbox conventions. TOS contains }
{ the parameters. Space for the returned value of type TYPE }
{ is pushed on the stack, CALL is loaded into the X register, }
{ and a JSL VECTOR is performed. On return, A is saved at }
{ ~TOOLERROR and any function value is loaded into the }
{ registers. }
{ }
{ }
{ dc_sym - generate a symbol table }
{ }
{ Gen1Name(dc_sym, doGLobals, pointer(table) }
{ }
{ Generates a symbol table for the debugger. TABLE is the }
{ address of the sybol table, which will be passed back to a }
{ subroutine called GenSymbols, which must be supplied by the }
{ compiler. DOGLOBALS is a flag the compiler can set for its }
{ own purposes. C uses the flag to note that the symbol }
{ table being created is for main, so global symbols should be }
{ included. }
{ }