summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc194.txt
blob: 9a39e31ab8b73199971aeafec6b638f58e4c026e (plain) (blame)
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
                                      Vint Cerf - UCLA

                                      Eric Harslem - Rand

RFC 194                               John Heafner - Rand
NIC 7139
Category: D.4                         Bob Metcalfe - MIT
Updates: None
Obsoletes: None                       Jim White - UCSB


                  THE DATA RECONFIGURATION SERVICE --

               COMPILER/INTERPRETER IMPLEMENTATION NOTES


                    I.  NEW FEATURES OF THE LANGUAGE

1.   The meaning of S(#,E,,l) is only find an arbitrary
     number  (<=256) of EBCDIC characters and store them in
     identifier S.  This descriptor is terminated only by
     an invalid EBCDIC or by exceeding maximum permissible
     character count (256).
2.   The assignment (S .<=. T) causes all attributes of
     identifier T to be given to S, i.e., length, type,
     and contents.
3.   (S .<=. T || X) concatenates X onto the right-hand
     side of T and stores the result in S.  If T and X
     are binary the resulting value has a length equal
     to the sum L(T) + L(X).
4.   T(X) joins L(X) and V(X) as a built-in identifier
     function.
     T(X) = type of identifier X.
     L(X) = length of contents of X.
     V(X) = contents of X converted to binary
            (decimal - binary is presently the only
            transformation).
5.   New types ED and AD are EBCDIC and ASCII encoded
     decimal, respectively.  These have been added to
     complement the V(X) function.
6.   New type SB has been added as signed binary.  Type B
     is a logical binary string.
7.   The syntactic notation for return-from-a-form has
     been changed.  See new syntax.







                                                                [Page 1]
^L
Data Reconfiguration Service                                     RFC 194


II.  NEW SYNTAX

form              :: = rule | form
rule              :: = label  inputstream outputstream;
label             :: = INTEGER | NULL
inputstream       :: = terms | NULL
terms             :: = term | terms, term
outputstream      :: = :terms | NULL
term              :: = identifier | identifier descriptor |
                       descriptor | comparator
identifier        :: = <alpha followed by 0-3 alphanumerics>
descriptor        :: = (replicationexpr, datatype, valueexpr,
                       lengthexpr control)
comparator        :: = (concatexpr connective concatexpr control) |
                       (identifier .<=. concatexpr control)
replicationexpr   :: = # | arithmetricexpr | NULL
datatype          :: = B | O | X | E | A | ED | AD | SB | T (identifier)
valueexpr         :: = concatexpr | NULL
lengthexpr        :: = arithmeticexpr | NULL
connective        :: = .LE. | .LT. | .GT. | .GE. | .EQ. | .NE.
concatexpr        :: = value | concatexpr    value
value             :: = literal | arithmeticexpr
arithmeticexpr    :: = primary | arithmeticexpr operator primary
primary           :: = identifier | L(identifier) | V(identifier) |
                         INTEGER
operator          :: = + | - | * | /
literal           :: = literaltype "string"

literaltype       :: = B | 0 | X | E | A | ED | AD | SB
string            :: = <from 0 to 256 chars>
control           :: = :options | NULL
options           :: = SFUR (arithmeticexpr) | SFUR (arithmeticexpr),
                       SFUR (arithmeticexpr)
SFUR              :: = S | F | U | SR | FR | UR

















                                                                [Page 2]
^L
Data Reconfiguration Service                                     RFC 194


III.  THE FORM INTERPRETER

Interpreter Overview

     The interpreter is a simple minded machine having the virtue of
helping the compiler writer by providing a rather powerful instruction
set for hard-to-compile operations.  Figure 1 shows the machine
configuration:


  +-------------+                        +--------------+
  | inputstream |                        | outputstream |
  +-------------+                        +--------------+
             /\                           /
              \                          /
               \                        /
                \                     \/
                +-----------------------+
                |         CPU           |
                +-----------------------+
                       |        /\
                       |         |
                       |         |
                       \/        |
                +-----------------------+
    Storage:    | Instruction           |
                | Sequence              |
                +-----------------------+
                | Label Table           |
                +-----------------------+
                | Literal/Identifier    |
                | Pool                  |
                +-----------------------+
                | Variable length       |
                | string area           |
                +-----------------------+


                Fig. 1. Form Interpreter












                                                                [Page 3]
^L
Data Reconfiguration Service                                     RFC 194


    The CPU is a box full of miscellaneous parts, the most important
being the Arithmetic Logic Unit and the instruction decoding unit.  The
CPU also maintains a collection of state registers to keep track of what
it is doing.  Figure 2 shows the rough layout.


   +-----------------+                +---------------+
   | Instruction     |                | Instruction   |
   | Counter         |                | Register      |
   +-----------------+                +---------------+
                                           |
                                           |
                                           V
                                    +----------------+
                                    | Operation Code |
                                    | Decoding       |
     Run Time Stack                 +----------------+
   +------------------+                 /     |    \
   |   Operands       |                /      |     \
   +------------------+              \/       V     \/
   |                  |               +-----------------+
   +------------------+              /   Instruction     \
   |                  |              |   Interpreter     |
   +------------------+              |   Routines        |
   |                  |               \                 /
   +------------------+                +---------------+
   |                  |                    |      /\
   +------------------+                    |       |
   |                  |                    |       |
   +------------------+                    V       |
   |                  |                +---------------+
   +------------------+ <------------- | Arithmetic    |
   |                  | -------------> | Logic Unit    |
   +------------------+                +---------------+
   |                  |
   +------------------+
   |                  |
   +------------------+


   +------------------+                +------------------+
   |Initial Input Ptr.|                | Output pointer   |
   +------------------+                +------------------+

   +------------------+                +------------------+
   |Current Input Ptr.|                | True/False Flag  |
   +------------------+                +------------------+




                                                                [Page 4]
^L
Data Reconfiguration Service                                     RFC 194


Fig.  2.  The Central Processor

     The CPU is a stack machine driven by a Polish postfix instruction
sequence.  Operands placed on the Run Time Stack are used for arithmetic
expression evaluation and for parameter passing between the interpreter
and the built-in functions.
     The Current Input Pointer and the Output Pointer keep track of the
two data streams.  Two input pointers are needed because of the backup
requirement in the event of rule failure.  All of these pointers are bit
pointers into the two streams.
     Various implementations of the Run Time Stack are independent of
the interpretation of the DRS machine's instruction set.  It is
suggested that the stack will contain instruction operands from the
instruction stream.
     The format of a compiled instruction sequence for a form is shown
in Fig. 3.

                        16 bits
                 +--------/\---------+
                /                     \

                +---------------------+
                |  length n in bytes  |
           +--  +---------------------+
           |    |                     |
           |    |     compiled        |
           |    |     16-bit          |
        n <     |     instructions    |
           |    |                     |
           |    |                     |
           |    |                     |
           +--  +---------------------+


       Fig. 3.  Compiled Instruction Sequence Format
















                                                                [Page 5]
^L
Data Reconfiguration Service                                     RFC 194


   The format of the compiled Label Table is shown in Fig. 4.

                                       16 bits
                                  +-----/\-------+
                                 /                \

                                 +-----------------+
                                 |  length n       |
                                 |  in bytes       |
        +--   +------------------+-----------------+
        |     | numeric value of |  byte offset    |
        |     | statement number |  in inst. seq.  |
        |     +------------------+-----------------+
        |     |        :                :          |
     n <      |        :                :          |
        |     |        :                :          |
        |     |                                    |
        |     |                                    |
        |     |                                    |
        +--   +------------------------------------+

              \_________________ _________________/
                                V
                              32 bits


                    Fig. 4.  Compiled Label Table
























                                                                [Page 6]
^L
Data Reconfiguration Service                                     RFC 194


   Literals and Identifiers are compiled as shown in fig. 5.

                                   2              2
                              +----/\----+   +----/\----+
                             /            \ /            \

                             +-------------+--------------+
            1         1      | length n    |    length n  |
         ___/\____ ___/\____ | in bytes    |    in bytes  |
        +---------+----------+-------------+--------------+
     /  |         |//////////|             |              |
     |  | Type    |//////////| bit length  |  byte offset |
     |  |         |//////////|             |              |
     |  +---------+----------+-------------+--------------+
5*n <   |                           :                     |
     |  |                           :                     |
     |  |                           :                     | Identifiers
     |  |                                                 |
     \  |                                                 |
        +-------------------------------------------------+
     /  |                                                 |
     |  |            literals are                         |
     |  |            byte-aligned                         | Literals
  m <   |                                                 |
     |  |                                                 |
     |  |                                                 |
     \  +-------------------------------------------------+

     Legend:

     Type 0 = undefined
          1 = B (binary)
          2 = 0 (octal)
          3 = X (hexadecimal)
          4 = E (EBCDIC)
          5 = A (ASCII)
          6 = ED (EBCDIC encoded decimal)
          7 = AD (ASCII encoded decimal)
          8 = SB (signed binary, two's complement)


             Fig. 5.  Compiled Literals and Identifiers









                                                                [Page 7]
^L
Data Reconfiguration Service                                     RFC 194


   Types B, 0, X, AD, ED, and SB point to 32-bit word- aligned data
   shown below.

 +---+---+-----+-------+       +-------------------+    word-aligned,
 | T |///|  L  |    ---+-----> |                   |    32-bit right-
 +---+---+-----+-------+       +-------------------+    justified


      Types E and A point to byte-aligned symbol streams
as shown below.

                                 byte-aligned, L <= 256
 +---+---+-----+-------+       +------------------------+
 | T |///|  L  |    ---+-----> |                        |
 +---+---+-----+-------+       +------------------------+




































                                                                [Page 8]
^L
Data Reconfiguration Service                                     RFC 194


Instruction Format

     Since literals and identifiers will be stored in the same data
area, more than 256 literals plus identifiers might be encountered so
more than 8 bits are needed to reference literal/id pool.  Furthermore,
such references must be distinguished from operators in the instruction
stream, so a 16-bit instruction will be used, as shown below.

     +--------+------------------------+
     |    4   |          12            |
     +--------+------------------------+
         |
        /
       /
      /
     |
     V
     LD = 0  literal or identifier reference (12-bit positive integer)
     IC = 1  12-bit two's complement integer constant
     OP = 2  operator
     AD = 3  address (12-bit positive integer)
    ARB = 4  indefinite replication factor
   NULL = 5  missing attribute of term

     The operation code decoder picks up types 0, 1, 3, 4,
and 5 and deposits them on top of the stack (TOS).  LD is an
index into the literal/identifier table, and AD is an index
into the instruction sequence.

     The decoder examines OP elements further:


         4        4            8
     +--------+--------+----------------+
     |  0010  |        |////////////////|
     +--------+--------+----------------+
        OP        |
                  +----------> 0 = binary operator
                               1 = unary operator
                               2 = special operator











                                                                [Page 9]
^L
Data Reconfiguration Service                                     RFC 194


Binary Operators (*)

     Let the TOS contain y and the next level, x.  The binary operators
compute x  <bop> y, popping both x, y from stack, and put the result
back on top of the stack.

                     +---+ <-- TOS  +-----+ <-- TOS
                     | y |          | x-y |
     e.g.     x-y => +---+     ===> +-----+
                     | x |          |/////|
                     +---+          +-----+


Binary Operator Encoding

                     4        4        4        4
                +--------+--------+--------+--------+
                |  0010  |  0000  |        |////////|
                +--------+--------+--------+--------+
                                       |
            +--------------------------+
            |
            V
     0 = integer +
     1 = integer -
     2 = integer x
     3 = integer : (or /), no remainder
     4 = concatenate ||

     All binary operations except concatenate expect the top
two elements on the stack to describe type B, 0, X, or SB.  The
result is always a 32-bit type B element.  The concatenate
operator fails unless both types are identical.  For example:


-------
     (*) As suggested above, the stack really contains instruction
operands that describe data; for convenience in illustrations
the data rather than their descriptors are shown on the stack.












                                                               [Page 10]
^L
Data Reconfiguration Service                                     RFC 194


        type     L    value             T       L     V
       +------+------+------+        +------+------+------+
TOS -> |  B   |  32  |  4   |        |  B   |  32  |  12  | <- TOS
       +------+------+------+   ==>  +------+------+------+
       |  B   |  8   |  16  |        |//////|//////|//////|
       +------+------+------+        +------+------+------+
       Before-operation                after-operation



       +------+------+------+        +------+------+------+
TOS -> |  A   |  2   |  DE  |        |  A   |  5   |ABCDE | <- TOS
       +------+------+------+   ==>  +------+------+------+
       |  A   |  3   | ABC  |        |//////|//////|//////|
       +------+------+------+        +------+------+------+
       Before || operation             after || operation


No binary operator has any effect on the TRUE/FALSE flag.


Unary Operators

         4        4        4        4
     +--------+--------+--------+--------+
     |  0010  |  0001  |        |        |
     +--------+--------+--------+--------+
                          |         |
           +--------------+         |
           |                        |
           V                        |
    0 = integer minus               V
    1 = load identifier          0 = evaluated contents
                                     (after dec - binary
                                      conversion)
                                 1 = length field
                                 2 = type field
    2 = Label Table Reference













                                                               [Page 11]
^L
Data Reconfiguration Service                                     RFC 194


     For the unary minus operator the data described by the top of the
stack is replaced with its 2's complement.  The form fails if the TOS
type is not SB, B, 0, or X.
     The Load identifier expects the TOS to describe an index into the
literal/identifier pool (that is, an LD instruction) .  The TOS
described data is replaced by 32-bit type B values.  The operation fails
if the contents cannot be converted from encoded decimal to binary.  B,
0, and X types are treated as unsigned integers, SB is treated as 2's
complement.
     The Label Table Reference operator expects a 32-bit type B value
described by TOS and searches for this label in the label Table.  If
found, the TOS described data is replaced by the relative address in the
instruction sequence of the label (in the form of an AD instruction).
If not found, the form fails.  No Unary operator has any effect on the
TRUE/FALSE flag.


Special Operators

                4        4        4        4
            +--------+--------+--------+--------+
            |  0010  |  0010  |        |        |
            +--------+--------+--------+--------+
                                 |         |
         +-----------------------+        /
         |                               /
         V                              /
   0 = store TOS                        |
   1 = return                           V
   2 = branch               0 = true, 1 = false, 2 = unconditional

   3 = compare              0 = .EQ.  2 = .LE.   4 = .GE.
                            1 = .NE.  3 = .LT.   5 = .GT.

   4 = move input ptr       0 = store current into initial
                            1 = store initial into current

   5 = input call           0 = no compare
                            1 = compare

   6 = output call










                                                               [Page 12]
^L
Data Reconfiguration Service                                     RFC 194


Store TOS

    The TOS describes an index into the ID table and the next lower
element in the stack describes a value to be stored.  After execution,
both elements are popped off the stack.

Return

     The TOS describes a value to be returned to the routine which
initiated the FORM MACHINE.  The actual mechanism will be implementation
dependent, but the FORM MACHINE will relin- quish control after this
instruction completes execution.

Branch

     The TOS describes an index into the instruction sequence to be used
as the new instruction counter (IC) if the branch conditions are
satisfied.  The branch instruction checks the state of the TRUE/FALSE
flag register and either increments the IC by 1 or replaces it with the
TOS described element.  In any case, the TOS is popped.

Compare

     The compare operator takes the two elements described by the two
top stack entries and compares them (.EQ.,.LT.,etc.).  If n is at the
top of the stack, and m is just below, then m.xx.n is performed, and the
TRUE/False flag is set accordingly.  For .xx. = .EQ. or .NE. we must
have identical type, length, and content for equality to hold.
     The other boolean comparators will not be attempted if types are
different (i.e., form fails), but for same types, B, 0, X cause binary-
justified compares, and A, E, AD, ED cause left-justified string
compares with the shorter string padded with blanks.

Move Input Pointer

     This operator (no operands) replaces the Current Input Pointer with
the Initial Input Pointer (back-up), or the Initial Input Pointer with
the current one (entry to rule).

Input Call

    This is the most complex operator thus far encountered.  It requires
four operands from the run-time stack:








                                                               [Page 13]
^L
Data Reconfiguration Service                                     RFC 194


TOS  +----------------------------+
     | binary or null             |  length to find
     +----------------------------+
     | LD to literal or null      |  value (literal)
     +----------------------------+
     | binary code                |  input data type
     +----------------------------+
     | binary, arbitrary, or null |  replication count
     +----------------------------+

     The input call operator can be invoked with the "no compare" flag
set, in which case the value expression parameter is ignored and only
the input type and length expressions are used.  In this case, the input
routine tries to find in the input stream as many characters of the
required type (bits, digits, etc.) as needed to fill the length
expression requirement.  If successful, the TRUE/FALSE flag is set TRUE,
the stack is popped to remove the input parameters, and the string
obtained is described by the TOS.  If the input stream cannot be matched
then the parameters are popped off the stack, and the TRUE/FALSE flag is
set FALSE.

     If the "compare" flag is set, the input stream must be searched for
the value expression.  However, we must take some care here to be sure
we know what to look for.  There are several cases:

a)  The length expression parameter is greater than the
    length of the value expression but the type of input de-
    sired is the same as the value expression type.  For B, 0
    and X types, right-justify value expression in length-
    expression field, sign bit is extended left if type BS.
    If type A, E, AD, or ED pad on the right with blanks.  b)  Same as
a) but length is too small.  B, 0, and X type strings
    are truncated on the left.  A, E, AD and ED are truncated
    on the right.  c)  The type of the value expression and the type
parameter
    differ.  This case is deferred for discussion and pre-
    sently is considered an error causing form failure.

     If the input string matches, then the TRUE/FALSE flag is set true,
the parameters are popped from the stack, and the resulting string is
described by the TOS.  Otherwise, the FALSE flag is set and the
parameters are popped.

     When a successful match is found the input subroutine always
advances the Current Input Pointer by the appropriate amount.  Since we
are dealing at the bit level this pointer must be maintained as a bit
pointer!




                                                               [Page 14]
^L
Data Reconfiguration Service                                     RFC 194


Output Call

     This routine utilizes the same parameters as the input call, but
operates on the output stream.  The TRUE/FALSE flag is not distributed
by this operator.  As for input, there are four parameters on top of the
stack, the length expression value, the value expression value, the
desired output type, and the replication expression value.  When there
is a mis- match between the output type and the value expression type, a
conversion must take place.  The value expression is trans- formed into
the desired output type and fitted into the field length specified by
the length expression.

Truncation and Padding Rules

a)  Character -> character (A,E,AD,ED -> A,E,AD,ED) conversion
    is left-justified and truncated or padded with blanks
    on the right.  b)  Character -> numeric and numeric -> character
conversion is
    right-justified and truncated or padded on the left with
    zeros.  Beware!  Two's complement numbers may be bollixed
    by this.  c)  Numeric -> character conversion is right-justified and
    left padded with blanks or left-truncated.  As for the unary
operators, a numeric bit-string is treated as unsigned, except SB which
is treated as two's complement.  Thus we have:

                (1,ED,X"FF",3) = E'255'
               (1,ED,X"100",3) = E'256'
     but (1,ED,SB"10000000",4) = E'-256'

     If the output routine is able to perform the desired action, it
advances the Output Stream Pointer, and pops all parameters from the
run-time stack.



















                                                               [Page 15]
^L
Data Reconfiguration Service                                     RFC 194


V.  INSTRUCTION SET

it/id ref           LD <num>                 Literal or identifier
                                             reference -> TOS
int const           IC <num>                 small 2's comp. integer
                                             constant -> TOS
address             AD <num>                 Address -> TOS
null parameter      NULL                     missing term attribute
add                 ADD                      TOS = x,y     x + y -> TOS
subtract            SUB                      TOS = x,y     x - y -> TOS
multiply            MUL                      TOS = x,y     x * y -> TOS
divide              DIV                      TOS = x,y     x/y -> TOS
concatenate         CON                      TOS = x,y     x||y -> TOS
unary minus         UNIN                     TOS = x       -x -> TOS
load id value       LIV                      TOS = LD x    V(LD x) -> TOS
load id length      LIL                      TOS = LD x    V(LD x) -> TOS
load id type        LIT                      TOS = LD x    V(LD x) -> TOS
look up label       LVL                      TOS = x       AD x -> TOS
sto                 STO                      TOS = x,y     y -> x
return              RET                      TOS = x       return to
                                                           caller with x
branch true         BT                       TOS = AD x    AD x -> Instr.
                                                                   counter
branch false        BF                       TOS = AD x    AD x -> Instr.
                                                                   counter
branch              BU                       TOS = AD x    AD x -> Instr.
                                                                   counter
compare equal       CEQ                      TOS = x,y     (y.EQ.x) ->
                                                                   TRUE/FALSE
                                                                   flag
compare not equal   CNE                      TOS = x,y     (y.NE.x) -> T/FF
compare <=          CLE                      TOS = x,y     (y.LE.x) -> T/FF
call output         OUT                      TOS = r,t,v,l (r,t,v,l) -> output
call input          IN ( INC = compare       TOS = r,t,v,l (r,t,v,l) -> TOS
                         INN = no compare )
current -> initial  SCIP                     CIP -> IIP    (store current input
                                                            ptr - initial IP)
initial -> current  SICP                     IIP -> CIP    (store initial input
                                                            ptr - CIP)












                                                               [Page 16]
^L
Data Reconfiguration Service                                     RFC 194


VI.  EXAMPLE COMPILATION

FORM SOURCE               GENERATED POLISH INSTRUCTION SEQUENCE

                     ADDR. INSTR.     COMMENTS
(NUMB.<=.1);         0     SICP     RULE PRELUDE
                     1     IC   1
                     2     LD   0   REFERENCE TO NUMB
                     3     STO      STORE IN NUMB
                     4     SCIP     RULE POSTLUDE
1 CC(,E,,1:FR(99)),  5     SICP     RULE PRELUDE
                     6     NULL     NO REPLICATION EXPRESSION
                     7     IC   4   TYPE EBCDIC
                     8     NULL     NO VALUE EXPRESSION
                     9     IC   1   LENGTH
                     10    INN      INPUT CALL WITH NO COMPARE
                     11    AD   15
                     12    BT       SKIP RETURN IF INN SUCCEEDS
                     13    IC   99  RETURN CODE
                     14    RET      RETURN TO CALLER IF FAILED
                     15    LD   1   REFERENCE TO CC
                     16    STO      STORE INPUT DATA IN CC
LINE(,E,,121:        17    NULL     NO REPLICATION EXPRESSION
         FR(99)),    18    IC   4   TYPE IS EBCDIC
                     19    NULL     NO VALUE EXPRESSION
                     20    IC   121 LENGTH
                     21    INN      INPUT WITH NO COMPARE
                     22    AD   26
                     23    BT       SKIP RETURN IF OK
                     24    IC   98  RETURN CODE
                     25    RET      RETURN TO CALLER IF FAILED
                     26    LD   2   REFERENCE TO LINE
                     27    STO      STORE INPUT IN LINE
:CC,                 28    SCIP     SUCCESSFUL INPUT
                     29    NULL     NO REPLICATION FACTOR
                     30    LD   1   REFERENCE TO CC
                     31    LIT      TYPE OF CC
                     32    LD   1   REFERENCE TO VALUE OF CC
                     33    LD   1   CC AGAIN
                     34    LIL      LENGTH OF CC
                     35    OUT      OUTPUT CC
(,ED,NUMB,2),        36    NULL     NO REPLICATION
                     37    IC   6   TYPE IS ED
                     38    LD   0   REFERENCE TO VALUE OF NUMB
                     39    IC   2   LENGTH OF OUTPUT FIELD
                     40    OUT      OUTPUT NUMB AS EBCDIC DEC.
(,E,E".",1),         41    NULL     NO REPLICATION
                     42    IC   4   TYPE IS EBCDIC



                                                               [Page 17]
^L
Data Reconfiguration Service                                     RFC 194


                     43    LD   3   REFERENCE TO E"."
                     44    IC   1   LENGTH TO OUTPUT
                     45    OUT      OUTPUT THE PERIOD
(,E,LINE,117),       46    NULL     NO REPLICATION
                     47    IC   4   TYPE IS EBCDIC
                     48    LD   2   REFERENCE TO LINE
                     49    IC   117 LENGTH TO OUTPUT
                     50    OUT      PUT OUT CONTENTS OF LINE
(NUMB.<=.NUMB+1:     51    LD   0   REFERENCE TO NUMB
         U(1));      52    IC   1   AMOUNT TO ADD
                     53    ADD      ADD TO NUMB
                     54    LD   0   REFERENCE TO NUMB
                     55    STO      STORE BACK INTO NUMB
                     56    AD   5   PLACE TO GO
                     57    B        UNCONDITIONAL BRANCH BACK


                LITERAL/IDENTIFIER TABLE

                     0     NUMB
                     1     CC
                     2     LINE
                     3     E"."


                     LABEL TABLE

                  LABEL     OFFSET
                    1         5


       [ This RFC was put into machine readable form for entry ]
         [ into the online RFC archives by Simone Demmel 6/97 ]


















                                                               [Page 18]
^L