⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc194.txt

📁 RFC技术文档 从0000-05
💻 TXT
📖 第 1 页 / 共 3 页
字号:
Store TOS    The TOS describes an index into the ID table and the next lowerelement 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 whichinitiated the FORM MACHINE.  The actual mechanism will be implementationdependent, but the FORM MACHINE will relin- quish control after thisinstruction completes execution.Branch     The TOS describes an index into the instruction sequence to be usedas the new instruction counter (IC) if the branch conditions aresatisfied.  The branch instruction checks the state of the TRUE/FALSEflag register and either increments the IC by 1 or replaces it with theTOS described element.  In any case, the TOS is popped.Compare     The compare operator takes the two elements described by the twotop stack entries and compares them (.EQ.,.LT.,etc.).  If n is at thetop of the stack, and m is just below, then m.xx.n is performed, and theTRUE/False flag is set accordingly.  For .xx. = .EQ. or .NE. we musthave identical type, length, and content for equality to hold.     The other boolean comparators will not be attempted if types aredifferent (i.e., form fails), but for same types, B, 0, X cause binary-justified compares, and A, E, AD, ED cause left-justified stringcompares with the shorter string padded with blanks.Move Input Pointer     This operator (no operands) replaces the Current Input Pointer withthe Initial Input Pointer (back-up), or the Initial Input Pointer withthe current one (entry to rule).Input Call    This is the most complex operator thus far encountered.  It requiresfour operands from the run-time stack:                                                               [Page 13]Data Reconfiguration Service                                     RFC 194TOS  +----------------------------+     | 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" flagset, in which case the value expression parameter is ignored and onlythe input type and length expressions are used.  In this case, the inputroutine tries to find in the input stream as many characters of therequired type (bits, digits, etc.) as needed to fill the lengthexpression requirement.  If successful, the TRUE/FALSE flag is set TRUE,the stack is popped to remove the input parameters, and the stringobtained is described by the TOS.  If the input stream cannot be matchedthen the parameters are popped off the stack, and the TRUE/FALSE flag isset FALSE.     If the "compare" flag is set, the input stream must be searched forthe value expression.  However, we must take some care here to be surewe 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 asa) 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 typeparameter    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 isdescribed by the TOS.  Otherwise, the FALSE flag is set and theparameters are popped.     When a successful match is found the input subroutine alwaysadvances the Current Input Pointer by the appropriate amount.  Since weare dealing at the bit level this pointer must be maintained as a bitpointer!                                                               [Page 14]Data Reconfiguration Service                                     RFC 194Output Call     This routine utilizes the same parameters as the input call, butoperates on the output stream.  The TRUE/FALSE flag is not distributedby this operator.  As for input, there are four parameters on top of thestack, the length expression value, the value expression value, thedesired output type, and the replication expression value.  When thereis a mis- match between the output type and the value expression type, aconversion must take place.  The value expression is trans- formed intothe desired output type and fitted into the field length specified bythe length expression.Truncation and Padding Rulesa)  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 -> characterconversion 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 unaryoperators, a numeric bit-string is treated as unsigned, except SB whichis 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, itadvances the Output Stream Pointer, and pops all parameters from therun-time stack.                                                               [Page 15]Data Reconfiguration Service                                     RFC 194V.  INSTRUCTION SETit/id ref           LD <num>                 Literal or identifier                                             reference -> TOSint const           IC <num>                 small 2's comp. integer                                             constant -> TOSaddress             AD <num>                 Address -> TOSnull parameter      NULL                     missing term attributeadd                 ADD                      TOS = x,y     x + y -> TOSsubtract            SUB                      TOS = x,y     x - y -> TOSmultiply            MUL                      TOS = x,y     x * y -> TOSdivide              DIV                      TOS = x,y     x/y -> TOSconcatenate         CON                      TOS = x,y     x||y -> TOSunary minus         UNIN                     TOS = x       -x -> TOSload id value       LIV                      TOS = LD x    V(LD x) -> TOSload id length      LIL                      TOS = LD x    V(LD x) -> TOSload id type        LIT                      TOS = LD x    V(LD x) -> TOSlook up label       LVL                      TOS = x       AD x -> TOSsto                 STO                      TOS = x,y     y -> xreturn              RET                      TOS = x       return to                                                           caller with xbranch true         BT                       TOS = AD x    AD x -> Instr.                                                                   counterbranch false        BF                       TOS = AD x    AD x -> Instr.                                                                   counterbranch              BU                       TOS = AD x    AD x -> Instr.                                                                   countercompare equal       CEQ                      TOS = x,y     (y.EQ.x) ->                                                                   TRUE/FALSE                                                                   flagcompare not equal   CNE                      TOS = x,y     (y.NE.x) -> T/FFcompare <=          CLE                      TOS = x,y     (y.LE.x) -> T/FFcall output         OUT                      TOS = r,t,v,l (r,t,v,l) -> outputcall 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]Data Reconfiguration Service                                     RFC 194VI.  EXAMPLE COMPILATIONFORM 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 POSTLUDE1 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 CCLINE(,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]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]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -