Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.:...

99
Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 Ausgabe /Issue: 3 Überarbtg./ Rev.: Datum/ Date : 2003–03–04 Datum/ Date: 2005–12–01 Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34 Dokument Typ: STANDARD Document Type: Titel: UCL Virtual Stack Machine and I–Code Reference Manual Title: Lieferbedingungs–Nr.: Klassifikations Nr.: DRL/DRD No.: Classification No.: Produktgruppe: Konfigurationsteil–Nr.: Product Group: Configuration Item No.: Schlagwörter: I–Code Porduktklassifizierungs–Nr.: Headings: Virtual Stack Machine Classifying Product Code: Interpreter Parameter Encoding Symbol Table Debug Table Freigabe Ordnungs–Nr.: Release Orde No.: Vorherige Dok.–Nr.: Previous Doc. No.: Bearbeitet: Franz Kruse Org. Einh.: TE 55 Unternehmen: EADS ST Bremen Prepared by: Orgin. Unit: Company: Geprüft: Stephan Marz Org. Einh.: TE 55 Unternehmen: EADS ST Bremen Agreed by: Orgin. Unit: Company: Genehmigt: Jürgen Frank Org. Einh.: TE 55 Unternehmen: EADS ST Bremen Approved by: Orgin. Unit: Company: Genehmigt: Org. Einh.: Unternehmen: Approved by: Orgin. Unit: Company:

Transcript of Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.:...

Page 1: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: CGS–RIBRE–STD–0003Ausgabe /Issue: 3Überarbtg./ Rev.: –

Datum/Date : 2003–03–04

Datum/Date: 2005–12–01

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Dokument Typ: STANDARDDocument Type:

Titel: UCL Virtual Stack Machine and I–Code Reference ManualTitle:

Lieferbedingungs–Nr.: Klassifikations Nr.:

DRL/DRD No.: Classification No.:

Produktgruppe: Konfigurationsteil–Nr.:

Product Group: Configuration Item No.:

Schlagwörter: I–Code Porduktklassifizierungs–Nr.:

Headings: Virtual Stack Machine Classifying Product Code:

InterpreterParameter EncodingSymbol TableDebug Table

Freigabe Ordnungs–Nr.:

Release Orde No.:

Vorherige Dok.–Nr.:

Previous Doc. No.:

Bearbeitet: Franz Kruse Org. Einh.: TE 55 Unternehmen: EADS ST BremenPrepared by: Orgin. Unit: Company:

Geprüft: Stephan Marz Org. Einh.: TE 55 Unternehmen: EADS ST BremenAgreed by: Orgin. Unit: Company:

Genehmigt: Jürgen Frank Org. Einh.: TE 55 Unternehmen: EADS ST BremenApproved by: Orgin. Unit: Company:

Genehmigt: Org. Einh.: Unternehmen:

Approved by: Orgin. Unit: Company:

Page 2: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

DOCUMENT CHANGE RECORD

ISSUE/REV. DATE Affected Paragraph/Page DESCRIPTION OF CHANGE

Dok.-Nr/ Doc. No.:

Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: I

Datum/ Date : Datum/ Date: von/ of III

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

1/– 2002–02–01 First version

1/A 2002–06–03 STR + VAL instructions changed for string conversion

1/B 2003–03–04 STR instruction changed: push address + sizr

1/C 2003–03–26 5.1 Version table defined (previously conversion table)

2/– 2004–05–24 6 Runtime errors

7 Extended parameter encoding

8 Symbol table + debug table

9 Ada interface

2/A 2004–09–01 8 Extended/modified symbol table

3/– 2005–12–01 5.2.3, 5.2.4.16 I–Code instructions changed:–deleted: INC_I, INC_U, DEC_I, DEC_U– separated: TRUNC_I, TRUNC_U, REAL_I, REAL_U– new: ROUND_I, ROUND_U

9 Ada interface: package specification listings removed

Page 3: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.:

Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: II

Datum/ Date : Datum/ Date: von/ of III

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Table of Contents

1 Introduction 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Identification and Scope 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Purpose 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 Applicable and reference documents 2. . . . . . . . . . . . . . . . . . . . . . . 2.1 Applicable Documents 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Reference Documents 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 Virtual Stack Machine 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 UCL Type Representation in Memory 6. . . . . . . . . . . . . . . . . . . . . . . .

5 I–Code definition 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 I–Code Record Layout 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 I–Code Instructions 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.2.1 Instruction Format 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Conventions 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 Instruction Short Reference 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4 I–Code Instruction Description 21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.2.4.1 Instructions with implied parameter 21. . . . . . . . . . . . . . . . . . . . . . . 5.2.4.2 Load Instructions 24. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.3 Load Address Instructions 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.4 Store Instructions 28. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.5 MOVE and CAT Instructions 30. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.6 Stack Instructions 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.7 Numerical Instructions 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.8 Comparison Instructions 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.9 BOOLEAN negation 46. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.10 Allocation Instructions 46. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.11 Jump Instructions 47. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.12 Special Jump Instructions 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.13 Iterative Instructions 49. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.14 Switch Instructions 50. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.15 Procedure/Function Call Instructions 52. . . . . . . . . . . . . . . . . . . . 5.2.4.16 Conversion Instructions 54. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.17 System Instructions 58. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4.18 No–operation Instruction 60. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.3 Sample AP and Corresponding I–Code 61. . . . . . . . . . . . . . . . . . . . . . . . . .

6 Runtime Errors 65. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7 Parameter Encoding 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 Minimal and Extended Parameter Encoding 66. . . . . . . . . . . . . . . . . . . . . . 7.2 Type References 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3 Minimal Encoding Part 68. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 4: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.:

Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: III

Datum/ Date : Datum/ Date: von/ of III

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.3.1 Parameter Modes and Type Classes 68. . . . . . . . . . . . . . . . . . . . . . . . . . 7.3.2 Value Encoding Part 69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.3.2.1 External Scheme 69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3.2.2 Internal Scheme 70. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.4 Extension Parts 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.1 String Encoding 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.2 Parameter Definition Part 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4.3 Type Definition Part 72. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.5 Example (call of a libr. procedure, minimal external scheme) 74. . . . . . 7.6 Stack Machine Representation of AP Parameters 75. . . . . . . . . . . . . . . . .

8 Symbol Table and Debug Table 76. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 Functional Description 76. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Structure of the Symbol / Debug Table 77. . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Layout 78. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4 Table Framework 79. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5 Objects 80. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6 Types 85. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.7 Type References 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.8 Units of Measure 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.9 Names, Values 91. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.10 Example 93. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9 Ada Programming Interface 95. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 5: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 1

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

1 Introduction

1.1 Identification and Scope

This is Document No.: CGS–RIBRE–STD–0003.

1.2 Purpose

This document provides the definition of the UCL Virtual Stack Machine and I–Code. It is intended bothas a basis for compiler development and for the design and development of I–Code interpreters in differentruntime environments.

Page 6: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 2

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

2 Applicable and reference documents

2.1 Applicable Documents

The following documents form a part of this specificaiton to the extent specified here. In case of conflictthis specification shall be superseding. The exact actual status of the documents listed below is to beobtained from the contractual baseline status list.

2.1.1 User Control Language (UCL) Reference Manual

CGS–RIBRE–STD–0001, Issue 3/–, 2005–12–01

2.2 Reference Documents

None

Page 7: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 3

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

3 Virtual Stack Machine

The Virtual Stack Machine is a non–physical machine, implemented by interpreters, with a strongly stackoriented architecture. It consists of the following components:

Module Base Table

A table of all modules (AP + libraries) linked together to an executable unit. Each entry points to therelative address 0 in the data frame of the corresponding module in memory. Entry 0 points to the dataframe of the main program (the AP), entries 1 – n point to the data frames of user libraries. Note that systemlibraries have no data frame in memory. In all instructions that reference user libraries, the library numbercorresponds to an entry in the Module Base Table.

Code Buffer

A byte structured data area that contains the I–Code of the program to be executed. The main procedureand each imported (user) library have a separate frame in the Code Buffer, with the main procedure asframe 0 and the library frames numbered by the order of imports. The Module Base Table contains apointer to each global data frame, which contains a pointer to the corresponding frame in the Code Buffer.Each frame is headed by an Entry Table whose 2–byte entries contain the relative start addresses of theprocedures and functions of that frame, with the main program as procedure 0.

Memory (Data Stack)

The memory of the Stack Machine that stores all data processed by the machine. The memory is wordstructured, data contained in the memory is represented as stated in chapter 4.

The memory is organized as a Data Stack holding “frames” of data.

• A global data frame for the main procedure (frame 0).

• A global data frame for each imported library (frames 1 .. n, numbered by the order of imports).

• A procedure frame for each active procedure/function. Each procedure call pushes a procedureframe on the Data Stack, and each return from a procedure pops its frame from the stack.

The Module Base Table contains a pointer to each of the global data frames.

Expression Stack

A word structured stack that contains operands of I–Code operations. All arithmetic is performed on theExpression Stack: operands are popped from the stack, and the result is pushed on the stack again.

The expression stack is organized in 32–bit words. Values on the stack are represented as described inchapter 4.

• For one–word scalar values the value itself is pushed on the stack, occupying one word.

• For two–word scalar values the value itself is pushed on the stack, occupying two words.

• For fixed structured values an address pointing to the start of the value in memory is pushed on thestack, occupying one word.

• For open array parameters and open string parameters first an address pointing to the data inmemory and then the upper bound are pushed on the stack, each occupying one word.

Page 8: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 4

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Registers

The registers contain pointers to locations in the above–mentioned data areas. They are implicitlymanipulated by I–Code instructions.

SP “Stack Pointer” –> Expression Stackpoints to the value on top of the stack.

MP “Memory Pointer” –> Data Stack (Memory)points to the first free position in the Data Stack.

GP “Global Data Pointer” –> Data Stack (Memory)points to the start of the current global data frame.

FP “Frame pointer” –> Data Stack (Memory)points to the procedure frame of the currently executed procedure/function.

CP “Code pointer” –> Code Bufferpoints to the start of the current code frame.

PC “Program Counter” –> Code Bufferpoints to the I–Code instruction currently executed.

Page 9: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 5

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

MEMORY

Global data frame 0

Global data frame 1

Global data structures

Procedure frame

Procedure frame

CODE

Code frame 0

Code frame 1

Entry list:

Procedure 1

Procedure 2

...

Procedure n

Procedure 0 (global code)

BASE

Module 0: Main procedure

Module 1: library 1

Module 2: library 2

Initialization flag

Pointer to code frame

Pointer to constant area

AP parameters(1 or 2 words per parameter)

Global variables(1 or 2 words for each variable)

Constant area(Contents addressed via pointer

to constant area)

Scalar: the valueStructured: the address

Scalar: the valueStructured: a pointer to

the allocated data structure

Offsets to start of procedures

(referenced by pointersin the global data frames)

Global link(missing for local calls)

Dynamic link

Return address

Parameters(1 or 2 words per parameter)

Scalar: value or addr. (VAR parameter)Structured: always the address

Local variables(1 or 2 words for each variable)

Scalar: the valueStructured: a pointer to

the allocated data structure

Allocated data structures(referenced by pointers

in the current procedure frame)

Temporarily allocated data

free memory

GP

FP

MP

CP

PC

–3

–2

–1

0

–3

–2

–1

0

n

0

n

Global data frame 2 Code frame 2

Pointer to global data frame

LEGEND:

FP

General itemsare marked grey

Detailed viewsare outlined

Stack Machineregisters are shownusing inverse boxes

In a row of items of the samekind, the last item is alwaysshown in detailed view

Figure 3–1. Stack Machine Runtime Layout

Page 10: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 6

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

4 UCL Type Representation in MemoryAll scalar types are represented as one or two 4–byte data words, resp., independently of the range ofvalues covered by the type. Structured types are represented by a sequence of as many data words as neededto cover the complete structure. Any UCL object is allocated as a multiple of full data words, even if itoccupies only part of the last data word. All values are stored in network format (i. e. big endian).

Here is a description of the type classes in detail:

INTEGER1–word scalar type. Values are represented as signed numbers in 2’s complement.

UNSIGNED_INTEGER1–word scalar type. Values are represented as unsigned integers.

enumeration types1–word scalar type. Values are represented as contiguous unsigned integers in the order of theirdeclaration, the first enumeration value starting at 0.

BOOLEAN1–word scalar type, represented as an enumeration type: FALSE = 0, TRUE = 1.

COMPLETION_CODE1–word scalar type, represented as an enumeration type: SUCCESS = 0, FAILURE = 1.

CHARACTER1–word scalar type. Values are represented by unsigned integers in the range 0 .. 255, where the subrange0 .. 127 is the ASCII character set. Within strings, 4 characters are packed in one 32–bit word.

REAL1–word scalar type. Values are represented in IEEE single floating point format.

LONG_REAL2–word sclar type. Values are represented in IEEE double floating point format.

DURATION2–word scalar type, represented like LONG_REAL.

TIME2–word scalar type. Values are internally represented using two 32–bit words. They contain the followingtime components in packed format in this order: year – 1900 (8–bit integer), month (4–bit integer), day(5–bit integer), seconds since midnight (47–bit fixed point value with 17 bits before and 30 bits after thedecimal point).

Times without a date are represented with the year, month and day fields = 0. The constant

~:~ (no time) is represented with all bits in both words set to 1.

statecode types2–word scalar types. A statecode value is represented by two 32–bit words containing the correspondingstatecode literal as an ASCII character sequence (up to 8 characters) in all upper–case, left–justified andpadded with spaces. The literal $$ is represented as 8 spaces.

Page 11: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 7

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

pathname types

Pathname types fall in two classes:

• Non–parameterized pathnames are 1–word scalar values represented by the SID of thecorresponding database item. It is represented in UNSIGNED_INTEGER format. The constant \\(no pathname) is represented by SID 0.

• Parameterized pathnames are structured values. Their representation is defined by the internalencoding scheme described in chapter 7.3.2.2.

subitem pathname types

Subitem pathname values are represented as two 32–bit words: the first contains the short identifier (SID)of the database item, the second the subitem identifier, both as unsigned integers.

set types

Structured types. A set is represented by a number of bits packed in one or more 32–bit words, one bit foreach possible member of the set. A member is present in the set, if its bit is set, it is absent otherwise. Thefirst member is expressed by bit 0, the last member by bit n–1. Bits in a word are numbered 0 .. 31 withbit 0 as the first bit. The bit number represents the significance when the word is read as an unsignedinteger, e. g. { 0, 1, 2 } corresponds to the integer 7 (= 20 + 21 + 22).

BITSET

1–word scalar type. A bitset is represented like a set with elements 0 – 31 in one 32–bit word.

string types

Structured types. A string is represented as one word holding the actual length of the string as an unsignedinteger, followed by zero or more words holding a byte array with 4 bytes or characters packed in one word.The number of bytes covers the maximum length of the string, filled up to a multiple of four.

array types

Structured types. An array is represented as a sequence of its elements in their respective representation.Arrays with more than one dimension store their elements in an order that for all index positions i and i+1indices on position i+1 vary faster than on position i.

record types

Structured types. A record is represented as the sequence of its fields in their respective representation.All variants of the same variant part are mapped to the same location in memory. The size of a variant partis determined by its longest variant.

BYTE

1–word scalar type, represented as one 32–bit word without any interpretation of the bits. Values arerestricted to the range 0 – 255. Within strings, four byte values are packed in one 32 bit word.

WORD

1–word scalar type, represented as one 32–bit word without any interpretation of the bits.

LONG_WORD

2–word scalar type, represented as two consecutive 32–bit words without any interpretation of the bits.

Page 12: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 8

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5 I–Code definitionI–Code (for “Intermediate Code”) is the object code produced by the UCL compiler. It has binary formatand is directly executable by the I–Code interpreters, on–board (in DMS) as well as on ground (in VICOSand CSS). The I–Code has identical format and is interchangeable between ground and on–board.

Each I–Code instruction is an unsigned byte, possibly followed by one or two instruction specificparameters. I–Code can be regarded as the instruction set of a Virtual Stack Machine which is implementedby the I–Code interpreters. A stack machine is characterized by the fact that instructions do not addresstheir operands directly but access them via the Expression Stack. Prior to instruction execution, alloperands needed must be explicitly loaded from their memory locations onto the stack. Each instructionpops its input operands from the stack and pushes its result operands back onto the stack where they areavailable as input to subsequent instructions. Dedicated Load and Store instructions move data items frommemory onto the stack and from the stack into memory, respectively.

The architecture of the stack machine and the I–Code instructions with their parameters and semantics aredescribed in detail in the following sections. The Ada package I_Code_Definition (given in chapter 9)defines the I–Code in terms of Ada types. The I–Code is essentially given as an enumeration type, togetherwith functions converting between the enmeration values and their textual and machine representation.This package shall be used by all software operating on I–Code.

Page 13: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 9

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.1 I–Code Record Layout

Import list size

Code size

Global data size

Constant area size

Relocation table size

Import list

Code

Constant area

Relocation table

WORD

WORD

WORD

WORD

WORD

WORDS

BYTES

WORDS

WORDS

Version table WORDS

Version table size WORD

Source ref. table size WORD

Source reference table WORDS

Figure 5–1. I–Code Record

The I–Code record is generated by the UCL compiler and kept in the database. On the other hand, small(pseudo–)APs may be generated by the HLCL interpreters in the HCI and directly sent via message overthe network.

The I–Code record, when retrieved from the database or received via message, is decomposed by theinterpreter into global data and code parts. Actual parameters delivered with an activation request arecopied into the first few global data words before start of the I–Code interpretation.

The I–Code record format shown above is mapped into a byte array. The size indications in the header,however, count actual items, i.e. bytes in the code part, words in the other parts.

Page 14: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 10

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Header

The header consists of the following 7 items. Each item is stored in one word (4 bytes). The header sizeis thus 7 words:

• The size of the import list in words

• The size of the code in bytes

• The size of the global data area in words

• The size of the constant area in words

• The size of the relocation table in words

• The size of the version table in words

• The size of the source reference table in words

Import list

The import list lists the SIDs of all imported user libraries. The user library with the external referencenumber 1 (i.e. the first library in the source module’s import list) is the first entry in this import list, thelibrary 2 the second, and so on. Each library SID occupies one word of storage.

Code

The code area is a byte–oriented stream of the I–code. It is copied into the stack machine’s code bufferat program load time (see also code buffer description later in this document). After copying the code areainto the code buffer, all external library calls have to be relocated.

Constant area

The constant area holds long constants referenced in the I–code, e.g. strings or state codes. It may alsocontain integer or real values, e.g. to reduce the storage required by often used values. Each constant willbe word–aligned.

Relocation table

The relocation table is used to relocate the references to external (i.e. imported) libraries. Each instructionreferencing user libraries references the called library using a number, the library’s SID is then found viathe import list. Different modules may use different numbers in referencing the same library, dependingon the order (and/or number) of imported libraries. The relocation step assigns then the same number forthe same library to each “external” instruction. Each entry in the relocation table is one word long andpoints into the code buffer, giving the address of the library number to be relocated.

Version table

The version table contains I–Code version information. Each entry is a 32–bit word whose four bytes areread as characters in the form

nn/x

where nn is the version number (the first n possibly being a space character), and x is either a hyphen (’–’)for the first issue, or a capital letter A, B , C , ... for later issues. The first version table entry refers to anissue of this Reference Manual. It identifies an I–Code version. Further entries are TBD.

Source reference table

The source reference table maps code positions (PCs) on source line numbers. It is a list of pairs (PC, linenumber), where the PC defines the start of the source line. The end of the source line is given by the PCof the next pair minus one, or by the end of the list, respectively.

Page 15: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 11

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2 I–Code Instructions

5.2.1 Instruction Format

Each I–Code instruction is one byte, possibly followed by one or two parameters. The instruction currentlyexecuted is pointed to by the program counter register (PC). Each instruction moves the PC to theinstruction that is to be executed next, this is normally the following instruction, unless the control flowis to be explicitly altered (jumps, procedure calls etc.).

All instructions access their input and output operands (if any) via the expression stack: operands read bythe instruction are popped off the stack, results produced by the instruction are pushed on the stack.

For some very frequent Load, Store and Call instructions with a parameter in the range 0 .. 15 additionalshort forms have been introduced to avoid the explicit parameter and thus to obtain more compact code:e.g. the 1–byte (parameterless) instructions LOAD_C.0, LOAD_C.1, LOAD_C.2 etc. have the samemeaning as the 2–byte (parameterized) instructions LOAD_C.b 0, LOAD_C.b 1, LOAD_C.b 2 etc.

The following table contains a detailed description of all I–Code instructions. For each instruction thefollowing details are given:

• the binary code: a value in the range 00 .. FF.

• the mnemonic: a suggestive symbolic name indicating the function performed by the instruction.Variations of a function are denoted by different suffixes to the basic name, separated by anunderscore. If different instructions perform the same function with a difference only in the in thesize of the operands, their names consist of the basic name plus a suffix separated by a dot (”.b” forbyte operands, ”.h” for halfword operands and ”.w” for word operands). The suffix will be, byconvention, written in lower case. For instructions with implied operands, the suffix denotes theimplied value, e.g. ”.0”, ”.1”, etc.

• the parameters of the instruction. Parameters may be one to four bytes long, the length is indicatedwith each parameter. The parameters are interpreted signed or unsigned, depending on theinstruction.

• the modes in which the instruction might be executed. The Stack Machine distinguishes betweenthree instruction modes:

“normal” This is the normal mode of the Stack Machine. After each instruction the Stack Machineis reset into this mode.

“double” This mode is used to switch from single word to double word operation of the Stack Ma-chine. Double word I–code operations are currently supported only for 64 bit reals.TheStack Machine is switched into this mode by prefixing the next I–code instruction witha DOUBLE instruction.

“multi” This mode is used for multiple word operations. The Stack Machine is switched into thismode by prefixing the next I–code instruction with a MULTI instruction.

• If an instruction is not allowed to be executed in a particular mode, then no explanation is given inthe following instruction table, as a result the instruction causes a run–time trap.

• the instruction title (a short informal description).

Page 16: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 12

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

• the effect on the expression stack (given in brackets after the title): the “=>” sign separates inputitems popped off the stack (left) and output items pushed onto the stack (right):

[ x, y => z ]

states that the instruction pops x and y from the stack and, as a result, pushes z on the stack. Optionalitems are enclosed in parentheses.

• a semantics specification given as a piece of Ada–like pseudo–code. These pieces of pseudo–codeare not to be understood as optimized algorithms, but rather as an easy–to–understand semanticsdescription. Note that a different semantic is associated with each instruction mode.

Page 17: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 13

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.2 Conventions

The following conventions are applied in the I–Code description:

• Data representation of UCL runtime values is according to the conventions stated in chapter 4.

• The term “halfword” and “word” denote 2–byte and 4–byte values, respectively.The term “double word” denotes an 8–byte value.

• The parameters are interpreted signed or unsigned, depending on the instruction.

• The PC is assumed to point to the code byte of the instruction currently executed. It is not explicitlyshown that each instruction implicitly advances the PC to the next instruction (PC := PC + 1 +parameter length), if it does not explicitly alter the control flow.

• Distances used to calculate a new PC value are offsets to the current PC.

• The registers of the stack machine (SP, MP, FP, GP, PC) are used as variables.

• Auxiliary variables are used in a suggestive manner:A denotes an address,B denotes a boolean value,D denotes a duration,T denotes a time,I, L, N stand for integer numbers,X, Y denote arithmetic operands of the type imposed by the instruction, sets are regarded as

boolean arrays of 32 bits packed in a word

• The Module Base Table is regarded as an array of words, named BASE, pointing to the start of theglobal data frame of a module.

• The Code Buffer is regarded as an array of bytes, named CODE.

• The Memory is regarded as an array of words, named MEMORY.

• The expression stack is regarded as an array of words, named STACK, where the SP points to theelement on top of the stack. Stack manipulations are indicated with calls to the procedures PUSHand POP for words and PUSHD and POPD for double words defined as:

PUSH (X) => SP := SP + 1; STACK(SP) := X;

PUSHD (X) => SP := SP + 2; STACK(SP–1 .. SP) := X;

POP (X) => X := STACK(SP); SP := SP – 1;

POPD (X) => X := STACK(SP–1 .. SP); SP := SP – 2;

Page 18: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 14

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

• The following functions are used to obtain control information from the Memory and the CodeBuffer:

CONST_ADR (A) address of constant at offset A in constant area of current globaldata frame=> return MEMORY(GP–1) + A;

PROC (N) entry point of procedure N in current code frame=> return CP + VALUE (CODE(CP+N*2 .. CP+N*2 + 1));

SIZE (SID) size (in words) of data value associated with database object desig-nated by SID.

• The following procedures and functions are used to denote Stack Machine system services:

SET_BYTE (i, W, X) set i–th byte in word W to value X

BYTE (i, W) extract i–th byte from word W

VALUE (bytes) compute numerical value from byte array

STRING (A) return the string stored under address A

SYSTEM (L, P) call system service P in system library L

READ (SID, TYPE, X) read end item value for SID of SW type TYPE into variable X

READD (SID, TYPE, X) read end item value for SID of SW type TYPE into double wordvariable X, if TYPE = STATECODE_TYPE: convert to uppercase

READM (SID, TYPE, A) read multiple–word value for SID of SW type TYPE to address A,if TYPE = STATECODE_TYPE: convert components to uppercase

WRITE (SID, TYPE, X) write end item value for SID of SW type TYPE from variable X

WRITED (SID, TYPE, X) write end item value for SID of SW type TYPE from double wordvariable X

WRITEM (SID, TYPE, A) write multiple–word value for SID of SW type TYPE from ad-dress A

ERROR (E) abort with runtime error E

TRAP (T) abort with runtime error trap T

HALT (S) stop execution and return success code S (0 = success, 1 = failure)

Page 19: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 15

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

IMAGE (X, TYPE, WIDTH, AFT, EXP)return the textual representation of value X of SW type TYPE.

IMAGED (X, TYPE, WIDTH, AFT, EXP)return the textual representation of double–word value X of SWtype TYPE.

IMAGEM (A, TYPE, WIDTH, AFT, EXP)return the textual representation of structured value at address A ofSW type TYPE.for all IMAGE functions: WIDTH = minimum text width AFT = number of digits after the decimal point (real + time types) EXP = min. width of exponent, 0 = no exponent (real types) WIDTH = AFT = EXP = 0 means standard UCL/HLCL format.

VALID (S, TYPE) Return TRUE if string S is a valid textual representation for a valueof SW type TYPE, FALSE otherwise.

VALUE (S, TYPE) return the value of SW type TYPE whose textual representation isin string S.

VALUED (S, TYPE) return the double–word value of SW type TYPE whose textualrepresentation is in string S.

VALUEM (S, TYPE) return the structured value of SW type TYPE whose textual repre-sentation is in string S.

• Integer/real conversion functions (actual source and target types depend on context):

TRUNC (R) return the truncated (unsigned) integer value of real value R.

ROUND (R) return the rounded (unsigned) integer value of real value R.

FLOAT (I) return the real value of (unsigned) integer value I.

LONG (R) return the long real value for real value R.

SHORT (R) return the real value for long real value R.

Page 20: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 16

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.3 Instruction Short Reference

This table lists all I–Code instructions in alphabetical order. For a detailed description see the next chapter.

The columns have the following meaning: code (hex), additional supported formats (D = double, M =multi), instruction with parameters, meaning, stack operation (items left of => are popped off the stack,items right of => are pushed on the stack).

A7 ABS_I Absolute integer value [ val => val ]

B4 D ABS_R Absolute real value [ val => val ]

B5 ADD_D Add time and duration [ val, val => val ]

A0 ADD_I Add integers [ val, val => val ]

AE D ADD_R Add reals [ val, val => val ]

B8 M ADD_S Set union [ set, set => set ]M: [ adr, adr, size => adr ]

A8 ADD_U Add unsigned [ val, val => val ]

D8 ALLOC Allocate space in memory [ size => adr ]

71...7F

CALL.1...CALL.15

Call procedure/function 1 – 15 [ ]

E5 CALL.b proc Call procedure/function [ ]

E6 CALL_E lib, proc Call external procedure/function[ ]

9C CAT String concatenation [ adr, adr, size => adr ]

FA CHECK_0 Check range 0 .. m [ val, max => val ]

F9 CHECK_I Check integer range n .. m [ val, min, max => val ]

FC D CHECK_R Check real range n .. m [ val, min, max => val ]

FB CHECK_U Check unsigned range n .. m [ val, min, max => val ]

9D D COPY Copy top of stack [ val => val, val ]

A3 DIV_I Divide integers [ val, val => val ]

AB DIV_U Divide unsigned [ val, val => val ]

B1 D DIV_R Divide reals [ val, val => val ]

BB M DIV_S Symmetric set difference [ set, set => set ]M: [ adr, adr, size => adr ]

F5 DOUBLE Next instruction is double [ ]

E8 ENTER par, dat Enter procedure/funct. [ val, ..., val => ]

BE D M EQU Test equal [ val, val => bool ]M: [ adr, adr, size => bool ]

FD ERROR err Runtime error trap [ ]

BD EXCL Exclude element from set [ adr, num => ]

A4 EXP_I Exponentiate integer [ val, val => val ]

B2 D EXP_R Exponentiate real [ val, val => val ]

AC EXP_U Exponentiate unsigned [ val, val => val ]

D9 FREE Free allocated space in memory[ size => ]

D6 GEQ_A Test great/equ. (ASCII) [ adr, adr => bool ]

C3 GEQ_I Test greater/equ. (int) [ val, val => bool ]

Page 21: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 17

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

CB D GEQ_R Test great./equ. (real) [ val, val => bool ]

D1 M GEQ_S Test set inclusion [ set, set => bool ]M: [ adr, adr, size => bool ]

CF GEQ_T Test grt./equ. (time) [ val, val => bool ]

C7 GEQ_U Test grt./equ. (unsig) [ val, val => bool ]

D4 GRT_A Test greater (ASCII) [ adr, adr => bool ]

C1 GRT_I Test greater (int) [ val, val => bool ]

C9 D GRT_R Test greater (real) [ val, val => bool ]

CD GRT_T Test greater (time) [ val, val => bool ]

C5 GRT_U Test greater (unsig) [ val, val => bool ]

FE HALT Stop program and return [ code => ]

BC INCL Include element in set [ adr, num => ]

E7 INIT Enter library initialization part [ ]

E0 ITER dist Iterative loop prolog [ adr, first, last, step => (adr, first,last, step, label) ]

DA JUMP.b dist Jump (short distance) [ ]

DB JUMP.h dist Jump (long distance) [ ]

DC JUMP_C.b dist Conditional jump (short dist.) [ bool => ]

DD JUMP_C.h dist Conditional jump (long distance)[ bool => ]

DF JUMP_F.b dist Jump if false (AND) [ bool => (bool) ]

DE JUMP_T.b dist Jump if true (OR) [ bool => (bool) ]

E4 LEAVE Exit from SWITCH [ label => ]

D5 LEQ_A Test less/equal (ASCII) [ adr, adr => bool ]

C2 LEQ_I Test less/equal (int) [ val, val => bool ]

CA D LEQ_R Test less/equal (real) [ val, val => bool ]

D0 M LEQ_S Test set inclusion [ set, set => bool ]M: [ adr, adr, size => bool ]

CE LEQ_T Test less/equal (time) [ val, val => bool ]

C6 LEQ_U Test less/equal (unsig) [ val, val => bool ]

D3 LES_A Test less (ASCII) [ adr, adr => bool ]

C0 LES_I Test less (int) [ val, val => bool ]

C8 D LES_R Test less (real) [ val, val => bool ]

CC LES_T Test less (time) [ val, val => bool ]

C4 LES_U Test less (unsig) [ val, val => bool ]

91 LOAD_A_E lib, adr Load external address [ => adr ]

8F LOAD_A_F.b offs Load offsetted address [ adr => adr ]

90 LOAD_A_F.h offs Load offsetted address [ adr => adr ]

8E LOAD_A_G.b adr Load global address [ => adr ]

8D LOAD_A_L.b adr Load local address [ => adr ]

92 LOAD_A_T.b offs Load address of constant in [ => adr ]

93 LOAD_A_T.h offs Load address of constant in [ => adr ]

Page 22: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 18

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

00...0F

D LOAD_C.0...LOAD_C.15

Load constant 0 – 15 [ => val ]

82 D LOAD_C.b val Load byte constant [ => val ]

83 D LOAD_C.h val Load halfword (2–byte) constant[ => val ]

84 D LOAD_C.w val Load word (4–byte) constant [ => val ]

89 D LOAD_E lib, adr Load external variable [ => val ]

30...3F

D LOAD_F.0...LOAD_F.15

Load offsetted variablefrom address 0 – 15

[ adr => val ]

87 D LOAD_F.b offs Load offsetted variable [ adr => val ]

88 D LOAD_F.h offs Load offsetted variable [ adr => val ]

20...2F

D LOAD_G.0...LOAD_G.15

Load global variablefrom address 0 – 15

[ => val ]

86 D LOAD_G.b adr Load global variable [ => val ]

10...1F

D LOAD_L.0...LOAD_L.15

Load local variablefrom address 0 – 15

[ => val ]

85 D LOAD_L.b adr Load local variable [ => val ]

80 D LOAD_T.b offs Load constant from table [ => val ]

81 D LOAD_T.h offs Load constant with halfword [ => val ]

8A LOAD_X_C Load indexed character [ adr, inx => val ]

8B D LOAD_X_V Load indexed variable [ adr, inx => val ]

F1 LONG_R Convert real to long real [ val => val ]

A5 MOD_I Modulus [ val, val => val ]

AD MOD_U Unsigned modulus [ val, val => val ]

9B MOVE Move block of data [ adr, adr, len ]

A2 MUL_I Multiply integers [ val, val => val ]

B0 D MUL_R Multiply reals [ val, val => val ]

BA M MUL_S Set intersection [ set, set => set ]M: [ adr, adr, size => adr ]

AA MUL_U Multiply unsigned [ val, val => val ]

F6 MULTI Next instruction is multiple [ ]

D7 NEG Boolean NOT [ bool => bool ]

A6 NEG_I Negate integer [ val => val ]

B3 D NEG_R Negate real [ val => val ]

BF D M NEQ Test not equal [ val, val => bool ]M: [ adr, adr, size => bool ]

E1 NEXT Iterative loop epilog [ adr, first, last, step, label =>(adr, first, last, step, label) ]

FF D M NOP No operation [ ]

9E D POP n Remove items from top of stack [ val (,...) => ]

Page 23: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 19

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

F7 D M READ type Read DB end item value [ sid => val ]M: [ sid, size => adr ]

EE D REAL_I Convert integer to real [ val => val ]

EF D REAL_U Convert unsigned integer to real[ val => val ]

EC D ROUND_I Round real to integer [ val => val ]

ED D ROUND_U Round real to unsigned integer [ val => val ]

E9 RTN Return from procedure/function [ ]

F0 SHORT_R Convert long real to real [ val => val ]

98 D STOR_E lib, adr Store external variable [ val => ]

60...6F

D STOR_F.0...STOR_F.15

Store offsetted variableat address 0 – 15

[ adr, val => ]

96 D STOR_F.b offs Store offsetted variable [ adr, val => ]

97 D STOR_F.h offs Store offsetted variable [ adr, val => ]

50...5F

D STOR_G.0...STOR_G.15

Store global variableat address 0 – 15

[ val => ]

95 D STOR_G.b adr Store global variable [ val => ]

40...4F

D STOR_L.0...STOR_L.15

Store local variableat address 0 – 15

[ val => ]

94 D STOR_L.b adr Store local variable [ val => ]

99 STOR_X_C Store indexed character [ adr, inx, val => ]

9A D STOR_X_V Store indexed variable [ adr, inx, val => ]

F2 STR type Convert value to string [ val, width, aft, exp=> adr, size ]M: [ adr, width, aft, exp=> adr, size ]

B6 SUB_D Subtract duration [ val, val => val ]

A1 SUB_I Subtract integers [ val, val => val ]

AF D SUB_R Subtract reals [ val, val => val ]

B9 M SUB_S Set difference [ set, set => set ]M: [ adr, adr, size => adr ]

B7 SUB_T Subtract times [ val, val => val ]

A9 SUB_U Subtract unsigned [ val, val => val ]

9F D SWAP Swap data on top of stack [ val, val => val, val ]

E2 SWITCH n Switch to CASE branch [ val => label ]

E3 SWITCH_X n Switch to CASE branch [ val => label ]

F4 SYS lib, proc System call [ ]

D2 M TEST Test set membership [ num, set => bool ]M: [ num, adr, len => bool ]

EA D TRUNC_I Truncate real to integer [ val => val ]

EB D TRUNC_U Truncate real to unsigned integer[ val => val ]

Page 24: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 20

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

F3 VAL type Convert string to value N: [ adr, check => val]D: [ adr => val ]M: [ adr => adr ]

F8 D M WRITE type Write DB end item value [ sid, val => ]M: [ sid, adr, size => ]

Page 25: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 21

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4 I–Code Instruction Description

This table lists all I–Code instructions, ordered by their code, together with a detailed description.

5.2.4.1 Instructions with implied parameter

These instructions are special cases of the corresponding instructions with explicit parameter. They havebeen introduced for optimization, since these instructions (particularly with small range parameters) covera great percentage of every program.

Hex Mnemonic Param. Semantics

000102

LOAD_C.0LOAD_C.1LOAD C 2

Load constant 0 .. 15 [ => val ]

0203040506070809

LOAD_C.2LOAD_C.3LOAD_C.4LOAD_C.5LOAD_C.6LOAD_C.7LOAD_C.8LOAD C 9

Nor

mal PUSH (n); –– n = 0 .. 15

090A0B0C0D0E0F

LOAD_C.9LOAD_C.10LOAD_C.11LOAD_C.12LOAD_C.13LOAD_C.14LOAD_C.15

Dou

ble PUSHD (n); –– n = 0 .. 15

101112

LOAD_L.0LOAD_L.1LOAD L 2

Load local variable from address 0 .. 15 [ => val ]

1213141516171819

LOAD_L.2LOAD_L.3LOAD_L.4LOAD_L.5LOAD_L.6LOAD_L.7LOAD_L.8LOAD L 9

Nor

mal PUSH (MEMORY(FP + n));

191A1B1C1D1E1F

LOAD_L.9LOAD_L.10LOAD_L.11LOAD_L.12LOAD_L.13LOAD_L.14LOAD_L.15

Dou

ble PUSHD (MEMORY(FP + n .. FP + n + 1));

Page 26: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 22

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

202122

LOAD_G.0LOAD_G.1LOAD G 2

Load global variable from address 0 .. 15 [ => val ]

2223242526272829

LOAD_G.2LOAD_G.3LOAD_G.4LOAD_G.5LOAD_G.6LOAD_G.7LOAD_G.8LOAD G 9

Nor

mal PUSH (MEMORY(GP + n));

292A2B2C2D2E2F

LOAD_G.9LOAD_G.10LOAD_G.11LOAD_G.12LOAD_G.13LOAD_G.14LOAD_G.15

Dou

ble PUSHD (MEMORY(GP + n .. GP + n + 1));

303132

LOAD_F.0LOAD_F.1LOAD F 2

Load offsetted variable from address 0 .. 15 [ adr => val ]

3233343536373839

LOAD_F.2LOAD_F.3LOAD_F.4LOAD_F.5LOAD_F.6LOAD_F.7LOAD_F.8LOAD F 9

Nor

mal POP (A);

PUSH (MEMORY(A + n));

393A3B3C3D3E3F

LOAD_F.9LOAD_F.10LOAD_F.11LOAD_F.12LOAD_F.13LOAD_F.14LOAD_F.15

Dou

ble POP (A);

PUSHD (MEMORY(A + n .. A + n + 1));

404142

STOR_L.0STOR_L.1STOR L 2

Store local variable at address 0 .. 15 [ val => ]

4243444546474849

STOR_L.2STOR_L.3STOR_L.4STOR_L.5STOR_L.6STOR_L.7STOR_L.8STOR L 9

Nor

mal POP (X);

MEMORY(FP + n) := X;

494A4B4C4D4E4F

STOR_L.9STOR_L.10STOR_L.11STOR_L.12STOR_L.13STOR_L.14STOR_L.15

Dou

ble POPD (X);

MEMORY(FP + n .. FP + n + 1) := X;

Page 27: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 23

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

505152

STOR_G.0STOR_G.1STOR G 2

Store global variable at address 0 .. 15 [ val => ]

5253545556575859

STOR_G.2STOR_G.3STOR_G.4STOR_G.5STOR_G.6STOR_G.7STOR_G.8STOR G 9

Nor

mal POP (X);

MEMORY(GP + n) := X;

595A5B5C5D5E5F

STOR_G.9STOR_G.10STOR_G.11STOR_G.12STOR_G.13STOR_G.14STOR_G.15

Dou

ble POPD (X);

MEMORY(GP + n .. GP + n + 1) := X;

606162

STOR_F.0STOR_F.1STOR_F.2

Store offsetted variable [ adr, val => ]at address 0 .. 15

6263646566676869

STOR_F.2STOR_F.3STOR_F.4STOR_F.5STOR_F.6STOR_F.7STOR_F.8STOR_F.9

Nor

mal POP (X);

POP (A);MEMORY(A + n) := X;

696A6B6C6D6E6F

STOR_F.9STOR_F.10STOR_F.11STOR_F.12STOR_F.13STOR_F.14STOR_F.15

Dou

ble POPD (X);

POP (A);MEMORY(A + n .. A + n + 1) := X;

7071

––– CALL.1

Call procedure/function 1 .. 15 [ ]7172737475767778797A7B7C7D7E7F

CALL .1CALL.2CALL.3CALL.4CALL.5CALL.6CALL.7CALL.8CALL.9CALL.10CALL.11CALL.12CALL.13CALL.14CALL.15

Nor

mal

MEMORY (MP) := FP; –– save dynamic linkMEMORY (MP+1) := PC+1; –– save return addr.

MP := MP + 2;FP := MP; –– mark stack framePC := PROC (n); –– jump –– n = 1 .. 15

Note:There is no CALL.0 instruction. A main program cannot call itself.

Page 28: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 24

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.2 Load Instructions

These instructions push data from the Memory onto the Expression Stack.

Hex Mnemonic Param. Semantics

80 LOAD_T.b offs 1unsigned

Load constant from table [ => val ]unsigned

Nor

mal

PUSH (MEMORY(CONST_ADR(offs)));

Dou

ble PUSHD (MEMORY(CONST_ADR(offs) ..

CONST_ADR(offs) + 1));

81 LOAD_T.h offs 2 unsigned

Load constant with halfword offset from table [ => val ]unsigned

Nor

mal

PUSH (MEMORY(CONST_ADR(offs)));

Dou

ble PUSHD (MEMORY(CONST_ADR(offs) ..

CONST_ADR(offs) + 1));

82 LOAD_C.b val 1 signed

Load byte constant [ => val ]signed

Nor

mal

PUSH (val);

Dou

ble

PUSHD (val);

83 LOAD_C.h val 2 signed

Load halfword (2–byte) constant [ => val ]signed

Nor

mal

PUSH (val);

Dou

ble

PUSHD (val);

84 LOAD_C.w val 4signed

Load word (4–byte) constant [ => val ]signed

Nor

mal

PUSH (val);

Dou

ble

PUSHD (val);

Page 29: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 25

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

85 LOAD_L.b adr 1unsigned

Load local variable [ => val ]unsigned

Nor

mal

PUSH (MEMORY(FP + adr));

Dou

ble

PUSHD (MEMORY(FP + adr .. FP + adr + 1));

86 LOAD_G.b adr 1 unsigned

Load global variable [ => val ]unsigned

Nor

mal

PUSH (MEMORY(GP + adr));

Dou

ble

PUSHD (MEMORY(GP + adr .. GP + adr + 1));

87 LOAD_F.b offs 1unsigned

Load offsetted variable [ adr => val ]unsigned

Nor

mal POP (A);

PUSH (MEMORY(A + offs));

Dou

ble POP (A);

PUSHD (MEMORY(A + offs .. A + offs + 1));

88 LOAD_F.h offs 2unsigned

Load offsetted variable with halfword offset [ adr => val ]unsigned

Nor

mal POP (A);

PUSH (MEMORY(A + offs));

Dou

ble POP (A);

PUSHD (MEMORY(A + offs .. A + offs + 1));

89 LOAD_E lib 1unsigned

Load external variable [ => val ]unsigned

adr 1unsigned

Nor

mal

PUSH (MEMORY(BASE(lib) + adr));

Dou

ble PUSHD (MEMORY(BASE(lib) + adr ..

BASE(lib) + adr + 1));

Page 30: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 26

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

8A LOAD_X_C Load indexed character [ adr, inx => val ]

Nor

mal

POP (I);POP (A);I := I – 1;

if I < 0 or I >= MEMORY(A) then TRAP (range_error);else PUSH (BYTE(I mod 4, MEMORY(A + 1 + I/4)));end if;

8B LOAD_X_V Load indexed variable [ adr, inx => val ]

Nor

mal POP (I);

POP (A);PUSH (MEMORY(A + I));

Dou

ble POP (I);

POP (A);PUSHD (MEMORY(A + I * 2) .. MEMORY(A + I * 2 + 1));

8C ––––

Page 31: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 27

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.3 Load Address Instructions

These instructions push the Memory address of data on the Expression Stack.

Hex Mnemonic Param. Semantics

8D LOAD_A_L.b adr 1unsigned

Load local address [ => adr ]unsigned

Nor

mal

PUSH (FP + adr);

8E LOAD_A_G.b adr 1 unsigned

Load global address [ => adr ]unsigned

Nor

mal

PUSH (GP + adr);

8F LOAD_A_F.b offs 1 unsigned

Load offsetted address [ adr => adr ]unsigned

Nor

mal POP (A);

PUSH (A + offs);

90 LOAD_A_F.h offs 2unsigned

Load offsetted address with halfword offset [ adr => adr ]unsigned

Nor

mal POP (A);

PUSH (A + offs);

91 LOAD_A_E lib 1unsigned

Load external address [ => adr ]unsigned

adr 1 unsigned

Nor

mal

PUSH (BASE(lib) + adr);

92 LOAD_A_T.b offs 1unsigned

Load address of constant in constant table [ => adr ]unsigned

Nor

mal

PUSH (CONST_ADR(offs));

93 LOAD_A_T.h offs 2unsigned

Load address of constant in constant table [ => adr ]with halfword offset

Nor

mal

PUSH (CONST_ADR(offs));

Page 32: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 28

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.4 Store Instructions

Theses instructions pop data from the Expression Stack into the Memory.

Hex Mnemonic Param. Semantics

94 STOR_L.b adr 1unsigned

Store local variable [ val => ]unsigned

Nor

mal POP (X);

MEMORY(FP + adr) := X;

Dou

ble POPD (X);

MEMORY(FP + adr .. FP + adr + 1) := X;

95 STOR_G.b adr 1unsigned

Store global variable [ val => ]unsigned

Nor

mal POP (X);

MEMORY(GP + adr) := X;

Dou

ble POPD (X);

MEMORY(GP + adr .. GP + adr + 1) := X;

96 STOR_F.b offs 1 unsigned

Store offsetted variable [ adr, val => ]unsigned

Nor

mal POP (X);

POP (A);MEMORY(A + offs) := X;

Dou

ble POPD (X);

POP (A);MEMORY(A + offs .. A + offs + 1) := X;

97 STOR_F.h offs 2unsigned

Store offsetted variable with halfword offset [ adr, val => ]unsigned

Nor

mal POP (X);

POP (A);MEMORY(A + offs) := X;

Dou

ble POPD (X);

POP (A);MEMORY(A + offs .. A + offs + 1) := X;

Page 33: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 29

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

98 STOR_E lib 1unsigned

Store external variable [ val => ]unsigned

adr 1unsigned

Nor

mal POP (X);

MEMORY(BASE(lib) + adr) := X;

Dou

ble POPD (X);

MEMORY(BASE(lib) + adr .. BASE(lib) + adr + 1) := X;

99 STOR_X_C Store indexed character [ adr, inx, val => ]

Nor

mal

POP (X);POP (I);POP (A);I := I – 1;

if I < 0 or I >= MEMORY(A) then TRAP (range_error);else SET_BYTE (I mod 4, MEMORY(A + 1 + I/4), X);end if;

9A STOR_X_V Store indexed variable [ adr, inx, val => ]

Nor

mal POP (X);

POP (I);POP (A);MEMORY(A + I) := X;

Dou

ble POPD (X);

POP (I);POP (A);MEMORY(A + I * 2 .. A + I * 2 + 1) := X;

Page 34: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 30

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.5 MOVE and CAT Instructions

The MOVE instruction copies multiple–word data between Memory locations.

Hex Mnemonic Param. Semantics

9B MOVE Move block of data [ adr, adr, len => ]

Nor

mal POP (L);

POP (A2);POP (A1);MEMORY(A1 .. A1+L–1) := MEMORY(A2 .. A2+L–1);

The CAT instruction concatenates two strings.

Hex Mnemonic Param. Semantics

9C CAT String concatenation [ adr, adr, size => adr ]

Nor

mal

POP (L);POP (A2); POP (A1);PUSH (MP);

L1 := MEMORY(A1); –– length of first stringL2 := MEMORY(A2); –– length of second stringMEMORY (MP) := L1 + L2; –– resultant length

MEMORY (MP + 1 .. MP + L – 1) := STRING (A1) & STRING (A2); –– concatenation

MP := MP + L;

–– This instruction implicitly allocates–– space in memory

Page 35: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 31

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.6 Stack Instructions

These instructions manipulate the Expression Stack only.

Hex Mnemonic Param. Semantics

9D COPY Copy top of stack [ val => val, val ]

Nor

mal

POP (X); PUSH (X); PUSH (X);D

oubl

e

POPD (X); PUSHD (X); PUSHD (X);

9E POP n 1unsigned

Remove n items from top of stack [ val (,...) => ]unsigned

Nor

mal

SP := SP – n;

Dou

ble

SP := SP – 2 * n;

9F SWAP Swap data on top of stack [ val, val => val, val ]

Nor

mal POP (X);

POP (Y);PUSH (X);PUSH (Y);

Dou

ble POPD (X);

POPD (Y);PUSHD (X);PUSHD (Y);

Page 36: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 32

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.7 Numerical Instructions

These instructions perform different numerical operations, they usually pop their operands from theExpression Stack and push their result back on the Expression Stack.

a) INTEGER operations

Hex Mnemonic Param. Semantics

A0 ADD_I Add integers [ val, val => val ]N

orm

al POP (Y);POP (X);PUSH (X + Y);

A1 SUB_I Subtract integers [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X – Y);

A2 MUL_I Multiply integers [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X / Y);

A3 DIV_I Divide integers [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X ** Y);

A4 EXP_I Exponentiate integer [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X ** Y);

A5 MOD_I Modulus integer [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X mod Y);

A6 NEG_I Negate integer [ val => val ]

Nor

mal POP (X);

PUSH (–X);

Page 37: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 33

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

A7 ABS_I Absolute integer value [ val => val ]

Nor

mal POP (X);

PUSH (abs X);

Page 38: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 34

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

b) UNSIGNED_INTEGER operations

Hex Mnemonic Param. Semantics

A8 ADD_U Add unsigned [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X + Y);

A9 SUB_U Subtract unsigned [ val, val => val ]N

orm

al POP (Y);POP (X);PUSH (X * Y);

AA MUL_U Multiply unsigned [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X * Y);

AB DIV_U Divide unsigned [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X / Y);

AC EXP_U Exponentiate unsigned [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X ** Y);

AD MOD_U Modulus unsigned [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X mod Y);

Page 39: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 35

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

c) REAL operations

Hex Mnemonic Param. Semantics

AE ADD_R Add reals [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X + Y);

Dou

ble POPD (Y);

POPD (X);PUSHD (X + Y);

AF SUB_R Subtract reals [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X – Y);

Dou

ble POPD (Y);

POPD (X);PUSHD (X – Y)

B0 MUL_R Multiply reals [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X * Y);

Dou

ble POPD (Y);

POPD (X);PUSHD (X * Y);

B1 DIV_R Divide reals [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X / Y);

Dou

ble POPD (Y);

POPD (X);PUSHD (X / Y)

B2 EXP_R Exponentiate real [ val, val => val ]

Nor

mal POP (Y);

POP (X);PUSH (X ** Y);

Dou

ble POP (Y);

POPD (X);PUSHD (X ** Y);

Page 40: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 36

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

B3 NEG_R Negate real [ val => val ]

Nor

mal POP (X);

PUSH (–X);

Dou

ble POPD (X);

PUSHD (–X);

B4 ABS_R Absolute real value [ val => val ]

Nor

mal POP (X);

PUSH (abs X);

Dou

ble POPD (X);

PUSHD (abs X);

d) TIME and DURATION operations

Hex Mnemonic Param. Semantics

B5 ADD_D Add time and duration [ val, val => val ]

Nor

mal POP (D);

POPD (T);PUSHD (T + D);

B6 SUB_D Subtract duration from time [ val, val => val ]

Nor

mal POP (D);

POPD (T);PUSHD (T – D);

B7 SUB_T Subtract times [ val, val => val ]

Nor

mal POPD (T2);

POPD (T1);PUSH (T1 – T2);

Page 41: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 37

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

e) SET operations

These instructions perform operations on sets. A set is regarded as a packed array of bits (BOOLEAN).A distinction is made between 1–word and multiple–word sets: For 1–word sets the set value is directlymanipulated via the Expression Stack like any numeric value. Multiple–word sets are manipulated viatheir addresses on the Expression Stack. Note that instructions that generate a multiple–word stack resultimplicitly allocate memory for the result and push the address of the result on the Expression Stack.

Hex Mnemonic Param. Semantics

B8 ADD_S Set unionN

orm

al [ set, set => set ]POP (Y);POP (X);PUSH (X or Y);

Mul

ti

[ adr, adr, size => adr ]POP (L);POP (A2);POP (A1);PUSH (MP);MEMORY (MP..MP+L–1) := MEMORY(A1..A1+L–1) or MEMORY(A2..A2+L–1);MP := MP + L;

–– This instruction implicitly allocates–– space in memory

B9 SUB_S Set difference

Nor

mal [ set, set => set ]

POP (Y);POP (X);PUSH (X and not Y);

Mul

ti

[ adr, adr, size => adr ]POP (L);POP (A2);POP (A1);PUSH (MP);MEMORY (MP..MP+L–1) := MEMORY(A1..A1+L–1) and not MEMORY(A2..A2+L–1);MP := MP + L;

–– This instruction implicitly allocates–– space in memory

Page 42: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 38

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

BA MUL_S Set intersection

Nor

mal [ set, set => set ]

POP (Y);POP (Y);PUSH (X and Y);

Mul

ti[ adr, adr, size => adr ]

POP (L);POP (A2);POP (A1);PUSH (MP);MEMORY (MP..MP+L–1) := MEMORY(A1..A1+L–1) and MEMORY(A2..A2+L–1);MP := MP + L;

–– This instruction implicitly allocates–– space in memory

BB DIV_S Symmetric set difference

Nor

mal [ set, set => set ]

POP (Y);POP (X);PUSH (X xor Y);

Mul

ti

[ adr, adr, size => adr ]POP (L);POP (A2);POP (A1);PUSH (MP);MEMORY (MP..MP+L–1) := MEMORY(A1..A1+L–1) xor MEMORY(A2..A2+L–1);MP := MP + L;

–– This instruction implicitly allocates–– space in memory

BC INCL Include element in set [ adr, num => ]

Nor

mal POP (N);

POP (A);MEMORY(A + N/32)(N mod 32) := TRUE;

BD EXCL Exclude element from set [ adr, num => ]

Nor

mal POP (N);

POP (A);MEMORY(A + N/32)(N mod 32) := FALSE;

Page 43: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 39

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.8 Comparison Instructions

These instructions perform comparisons on operands on the Expression Stack. They push a boolean valueas a result back on the Expression Stack. The multiple–word comparison instructions operate on data inthe Memory pointed by addresses on the Expression Stack.

a) general comparisons

Hex Mnemonic Param. Semantics

BE EQU Test equalN

orm

al [ val, val => bool ]POP (Y);POP (X);PUSH (X = Y);

Dou

ble [ val, val => bool ]

POPD (Y);POPD (Y);PUSH (X = Y);

Mul

ti

[ adr, adr, size => bool ]POP (L);POP (A2);POP (A1);PUSH (MEMORY(A1..A1+L–1) = MEMORY(A2..A2+L–1));

BF NEQ Test not equal

Nor

mal [ val, val => bool ]

POP (Y);POP (X);PUSH (X /= Y);

Dou

ble [ val, val => bool ]

POPD (Y);POPD (X);PUSH (X /= Y);

Mul

ti

[ adr, adr, size => bool ]POP (L);POP (A2);POP (A1);PUSH (MEMORY(A1..A1+L–1) /= MEMORY(A2..A2+L–1));

Page 44: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 40

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

b) INTEGER comparisons

Hex Mnemonic Param. Semantics

C0 LES_I Test less (integer) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X < Y);

C1 GRT_I Test greater (integer) [ val, val => bool ]N

orm

al POP (Y);POP (X);PUSH (X > Y);

C2 LEQ_I Test less/equal (integer) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X <= Y);

C3 GEQ_I Test greater/equal (integer) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X >= Y);

Page 45: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 41

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

c) UNSIGNED_INTEGER comparisons

Hex Mnemonic Param. Semantics

C4 LES_U Test less (unsigned) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X < Y);

C5 GRT_U Test greater (unsigned) [ val, val => bool ]N

orm

al POP (Y);POP (X);PUSH (X <= Y);

C6 LEQ_U Test less/equal (unsigned) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X <= Y);

C7 GEQ_U Test greater/equal (unsigned) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X >= Y);

Page 46: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 42

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

d) REAL comparisons

Hex Mnemonic Param. Semantics

C8 LES_R Test less (real) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X < Y);

Dou

ble POPD (Y);

POPD (X);PUSH (X < Y);

C9 GRT_R Test greater (real) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X > Y);

Dou

ble POPD (Y);

POPD (X);PUSH (X > Y);

CA LEQ_R Test less/equal (real) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X <= Y);

Dou

ble POPD (Y);

POPD (X);PUSH (X <= Y);

CB GEQ_R Test great./equ. (real) [ val, val => bool ]

Nor

mal POP (Y);

POP (X);PUSH (X >= Y);

Dou

ble POPD (Y);

POPD (X);PUSH (X >= Y);

Page 47: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 43

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

e) TIME comparisons

Hex Mnemonic Param. Semantics

CC LES_T Test less (time) [ val, val => bool ]

Nor

mal POPD (T2);

POPD (T1);PUSH (T1 < T2);

CD GRT_T Test greater (time) [ val, val => bool ]N

orm

al POPD (T2);POPD (T1);PUSH (T1 > T2);

CE LEQ_T Test less/equal (time) [ val, val => bool ]

Nor

mal POPD (T2);

POPD (T1);PUSH (T1 <= T2);

CF GEQ_T Test greater/equal (time) [ val, val => bool ]

Nor

mal POPD (T2);

POPD (T1);PUSH (T1 >= T2);

Page 48: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 44

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

f) SET comparisons

These instructions perform comparisons on sets. 1–Word sets are manipulated directly via the Expressionstack, multiple–word sets are manipulated indirectly via addresses on the Expression Stack.

Hex Mnemonic Param. Semantics

D0 LEQ_S Test set inclusion (left in right)

Nor

mal [ set, set => bool ]

POP (Y);POP (X);PUSH ((X and not Y) = (others => FALSE));

Mul

ti

[ adr, adr, size => bool ]POP (L);POP (A2);POP (A1); PUSH ((MEMORY(A1..A1+L–1) and not MEMORY(A2..A2+L–1)) = (others => FALSE));

D1 GEQ_S Test set inclusion (right in left)

Nor

mal [ set, set => bool ]

POP (Y);POP (X);PUSH ((Y and not X) = (others => FALSE));

Mul

ti

[ adr, adr, size => bool ]POP (L);POP (X);PUSH ((MEMORY(A2..A2+L–1) and not MEMORY(A1..A1+L–1)) = (others => FALSE));

D2 TEST Test set membership

Nor

mal

[ num, set => bool ]POP (S);POP (N);

if N < 0 or N >= 32 then PUSH (FALSE);else PUSH (S(N));end if;

Mul

ti

[ num, adr, len => bool ]POP (L);POP (A);POP (N);

if N < 0 or N >= L * 32 then PUSH (FALSE);else PUSH (MEMORY(A + N/32)(N mod 32));end if;

Page 49: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 45

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

g) STRING comparisons

Hex Mnemonic Param. Semantics

D3 LES_A Test less (ASCII) [ adr, adr => bool ]

Nor

mal POP (A2);

POP (A1);PUSH (STRING(A1) < STRING(A2));

D4 GRT_A Test greater (ASCII) [ adr, adr => bool ]N

orm

al POP (A2);POP (A1);PUSH (STRING(A1) > STRING(A2));

D5 LEQ_A Test less/equal (ASCII) [ adr, adr => bool ]

Nor

mal POP (A2);

POP (A1);PUSH (STRING(A1) <= STRING(A2));

D6 GEQ_A Test greater/equal (ASCII) [ adr, adr => bool ]

Nor

mal POP (A2);

POP (A1);PUSH (STRING(A1) >= STRING(A2));

Page 50: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 46

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.9 BOOLEAN negation

Hex Mnemonic Param. Semantics

D7 NEG Boolean NOT [ bool => bool ]

Nor

mal POP (B);

PUSH (not B);

5.2.4.10 Allocation Instructions

These instructions allocate space in memory and free allocated space. Note that allocation and deallocationfollow strict stack semantics.

Hex Mnemonic Param. Semantics

D8 ALLOC Allocate space in memory [ size => adr ]

Nor

mal POP (L);

PUSH (MP);MP := MP + L;

D9 FREE Free allocated space in memory [ size => ]

Nor

mal POP (L);

MP := MP – L;

Page 51: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 47

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.11 Jump Instructions

These instructions perform jumps to locations in the code frame. The target location is indicated relativelyas a distance from the current PC. Conditional jumps test a condition (a boolean value) on the ExpressionStack, the jump is performed if the condition is FALSE.

Hex Mnemonic Param. Semantics

DA JUMP.b dist 1signed

Jump (short distance) [ ]signed

Nor

mal

PC := PC + dist;

DB JUMP.h dist 2 signed

Jump (long distance) [ ]signed

Nor

mal

PC := PC + dist;

DC JUMP_C.b dist 1signed

Conditional jump (short distance) [ bool => ]signed

Nor

mal

POP (B);

if not B then PC := PC + dist;else PC := PC + 2;end if;

DD JUMP_C.h dist 2signed

Conditional jump (long distance) [ bool => ]signed

Nor

mal

POP (B);

if not B then PC := PC + dist;else PC := PC + 3;end if;

Page 52: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 48

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.12 Special Jump Instructions

These instructions implement the UCL short–circuit OR (”|”) and AND (”&”) operations.

Hex Mnemonic Param. Semantics

DE JUMP_T.b dist 1unsigned

Jump if true (OR) [ bool => (bool) ]unsigned

Nor

mal

POP (B);

if B then PUSH (B); PC := PC + dist;else PC := PC + 2;end if;

DF JUMP_F.b dist 1 unsigned

Jump if false (AND) [ bool => (bool) ]unsigned

Nor

mal

POP (B);

if not B then PUSH (B); PC := PC + dist;else PC := PC + 2;end if;

Page 53: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 49

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.13 Iterative Instructions

These instructions implement the UCL FOR loop. A FOR loop is bracketed by an ITER/NEXT instructionpair that communicate via the Expression Stack.

Hex Mnemonic Param. Semantics

E0 ITER dist 2unsigned

Iterative loop prolog [ adr, first, last, step => (adr, first, last, step, label) ]

Nor

mal

S := STACK(SP); –– stepL := STACK(SP–1); –– last loop valueF := STACK(SP–2); –– first loop valueA := STACK(SP–3); –– addr. of loop variable

if (S > 0 and then F > L) or (S < 0 and then F < L) then SP := SP – 4; –– pop 4 stack items PC := PC + dist; –– exit from loopelse MEMORY(A) := F; –– init. loop variable PC := PC + 3; PUSH (PC); –– loop entry labelend if;

E1 NEXT Iterative loop epilog[ adr, first, last, step, label => (adr, first, last, step, label) ]

Nor

mal

S := STACK(SP–1); –– stepL := STACK(SP–2); –– last loop valueA := STACK(SP–4); –– addr. of loop variable

MEMORY(A) := MEMORY(A) + S; –– inc. loop var

if (S > 0 and MEMORY(A) > L) or (S < 0 and MEMORY(A) < L) then SP := SP – 5; –– pop 5 stack items PC := PC + 1; –– leave loopelse PC := STACK(SP); –– next loop cycleend if;

Page 54: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 50

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.14 Switch Instructions

These instructions implement the UCL CASE statement. Two alternative instructions perform the jumpto the according case branch via a jump table and a search table, respectively.

Hex Mnemonic Param. Semantics

E2 SWITCH n 2 unsigned

Switch to CASE branch via jump table [ val => label ]unsigned

Nor

mal

Z := VALUE (CODE(PC+3..PC+4));–– exit labelE := VALUE (CODE(PC+5..PC+6));–– ELSE branchT := PC + 7; –– Pointer to jump table

POP (X); –– case selector PUSH (PC + Z); –– push exit label

if X < 0 or X > n then PC := PC + E; –– jump to ELSE else I := T + 2*X; –– jump tab. index PC := PC + VALUE (CODE(I..I+1)); –– jumpend if;

–– SWITCH is followed by a jump table:–––– halfword 1: distance to end of case–– halfword 2: distance to ELSE part–– –– halfwords 3 .. 3+n: distances to the branches

E3 SWITCH_X n 2 unsigned

Switch to CASE branch via search table [ val => label ]unsigned

Nor

mal

Z := VALUE (CODE(PC+3..PC+4));–– exit labelE := VALUE (CODE(PC+5..PC+6));–– ELSE branch

POP (X); –– case selector PUSH (PC + Z); –– push exit label

D := {distance to branch searched in table}

if D = 0 then –– not found PC := PC + E; –– jump to ELSE else PC := PC + D; –– jump to branch end if;

–– SWITCH_X is followed by a search table:–– –– halfword: distance to end of case–– halfword: distance to ELSE part –––– range 1 .. range n–––– (Each ”range” consists of:–– o lower bound of the range (word)–– o upper bound of the range (word)–– o distance to branch (halfword)

Page 55: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 51

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

E4 LEAVE Exit from SWITCH [ label => ]

Nor

mal

POP (PC); –– jump to end of case statement

Page 56: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 52

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.15 Procedure/Function Call Instructions

These instructions perform procedure/function calls, entry and return operations. Note that the ENTERinstruction unstacks the actual parameters and moves them to locations in the Memory.

Hex Mnemonic Param. Semantics

E5 CALL.b proc 1unsigned

Call procedure/function [ ]unsigned

Nor

mal

MEMORY (MP) := FP; –– save dynamic linkMEMORY (MP+1) := PC+2; –– save return addr.MP := MP + 2;FP := MP; –– mark stack framePC := PROC (proc); –– jump

E6 CALL_E lib 1unsigned

Call external procedure/function [ ]unsigned

proc 1 unsigned

Nor

mal

MEMORY(MP) := GP; –– save global linkMEMORY(MP+1) := FP; –– save dynamic linkMEMORY(MP+2) := –(PC+3);–– save return addr.MP := MP + 3;FP := MP; –– mark stack frameGP := BASE (lib); –– new global frameCP := MEMORY(GP–2); –– new code framePC := PROC (proc); –– jump

E7 INIT Enter library initialization part [ ]

Nor

mal

if not MEMORY(GP–3) then –– if not yet init. MEMORY(GP–3) := TRUE; –– mark as init.else PC := – MEMORY (FP–1); –– return from MP := FP – 3; –– external call GP := MEMORY (MP); FP := MEMORY (MP+1); CP := MEMORY (GP–2);end if;

E8 ENTER par 1unsigned

Enter procedure/function [ val, ..., val => ]unsigned

dat 1unsigned

Nor

mal

–– unstack parameters:MEMORY(MP..MP+par–1) := STACK(SP–par+1..SP);SP := SP – par;

–– allocate space for local data:MP := MP + par + dat;

Page 57: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 53

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

E9 RTN Return from procedure/function [ ]

Nor

mal

PC := MEMORY (FP–1);

if PC > 0 THEN –– local call MP := FP – 2; FP := MEMORY(MP);else –– external call MP := FP – 3; GP := MEMORY(MP); FP := MEMORY(MP+1); CP := MEMORY(GP–2); PC := –PC;end if;

Page 58: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 54

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.16 Conversion Instructions

Hex Mnemonic Param. Semantics

EA TRUNC_I Truncate real to integer [ val => val ]

Nor

mal POP (X);

PUSH (TRUNC(X));

Dou

ble POPD (X);

PUSH (TRUNC(X));

EB TRUNC_U Truncate real to unsigned integer [ val => val ]

Nor

mal POP (X);

PUSH (TRUNC(X));

Dou

ble POPD (X);

PUSH (TRUNC(X));

EC ROUND_I Round real to integer [ val => val ]

Nor

mal POP (X);

PUSH (ROUND(X));

Dou

ble POPD (X);

PUSH (ROUND(X));

ED ROUND_U Round real to unsigned integer [ val => val ]

Nor

mal POP (X);

PUSH (ROUND(X));

Dou

ble POPD (X);

PUSH (ROUND(X));

Page 59: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 55

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

EE REAL_I Convert integer to real [ val => val ]

Nor

mal POP (X);

PUSH (FLOAT(X));

Dou

ble POP (X);

PUSHD (FLOAT(X));

EF REAL_U Convert unsigend integer to real [ val => val ]

Nor

mal POP (X);

PUSH (FLOAT(X));

Dou

ble POP (X);

PUSHD (FLOAT(X));

F0 SHORT_R Convert long real to real [ val => val ]

Nor

mal POPD (X);

PUSH (SHORT(X));

F1 LONG_R Convert real to long real [ val => val ]

Nor

mal POP (X);

PUSHD (LONG(X));

Page 60: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 56

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

F2 STR type 1unsigned

Convert value to stringunsigned

Nor

mal

[ val, width, aft, exp => adr, size ]POP (EXP);POP (AFT);POP (WIDTH);POP (X);

declare S : constant STRING := IMAGE (X, type, WIDTH, AFT, EXP); L : constant NATURAL := (S’LENGTH + 3) / 4;begin PUSH (MP); MEMORY (MP) := S’LENGTH; MEMORY (MP+1 .. MP+L) := S; MP := MP + 1 + L; PUSH (L + 1);end;

Dou

ble

[ val, width, aft, exp => adr, size ]POP (EXP);POP (AFT);POP (WIDTH);POPD (X);

declare S : constant STRING := IMAGED (X, type, WIDTH, AFT, EXP); L : constant NATURAL := (S’LENGTH + 3) / 4;begin PUSH (MP); MEMORY (MP) := S’LENGTH; MEMORY (MP+1 .. MP+L) := S; MP := MP + 1 + L; PUSH (L + 1);end;

Mul

ti

[ adr, width, aft, exp => adr, size ]POP (EXP);POP (AFT);POP (WIDTH);POP (A);

declare S : constant STRING := IMAGEM (A, type, WIDTH, AFT, EXP); L : constant NATURAL := (S’LENGTH + 3) / 4;begin PUSH (MP); MEMORY (MP) := S’LENGTH; MEMORY (MP+1 .. MP+L) := S; MP := MP + 1 + L; PUSH (L + 1);end;

Note: This instruction implicitly allocates space in memory.

Page 61: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 57

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

F3 VAL type 1unsigned

Convert string to value, or check string against typeunsigned

Nor

mal

[ adr, check => val ]POP (C);POP (A);

if C then PUSH (VALID (STRING (A), type));else PUSH (VALUE (STRING (A), type));end if;

Dou

ble [ adr => val ]

POP (A);PUSHD (VALUED (STRING (A), type));

Mul

ti

[ adr => adr ]POP (A);

declare V : constant WORD_ARRAY := VALUEM (STRING (A), type);begin PUSH (MP); MEMORY (MP) := S’LENGTH; MEMORY (MP+1 .. MP+V’LENGTH) := V; MP := MP + V’LENGTH;end;

–– This instruction implicitly allocates–– space in memory.

Page 62: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 58

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.17 System Instructions

These instructions perform different system specific operations.

Hex Mnemonic Param. Semantics

F4 SYS lib 1 unsigned

System call [ ]unsigned

proc 1unsigned

Nor

mal

SYSTEM (lib, proc);

F5 DOUBLE Interpret next instruction as double word instruction [ ]

F6 MULTI Interpret next instruction as multiple word instruction [ ]

F7 READ type 1unsigned

Read DB end item valueunsigned

Nor

mal [ sid => val ]

POP (SID);READ (SID, type, X);PUSH (X);

Dou

ble [ sid => val ]

POP (SID);READD (SID, type, X);PUSHD (X);

Mul

ti

[ sid, size => adr ]POP (L)POP (SID);PUSH (MP);READM (SID, type, MP);MP := MP + L;

–– This instruction implicitly allocates–– space in memory

F8 WRITE type 1unsigned

Write DB end item valueunsigned

Nor

mal [ sid, val => ]

POP (X);POP (SID);WRITE (SID, type, X);

Dou

ble [ sid, val => ]

POPD (X);POP (SID);WRITED (SID, type, X);

Mul

ti

[ sid, adr, size => ]POP (L);POP (A);POP (SID);WRITEM (SID, type, A);

Page 63: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 59

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

SemanticsParam.MnemonicHex

F9 CHECK_I Check integer range n .. m [ val, min, max => val ]

Nor

mal

POP (Y);POP (X);

if STACK(SP) < X or STACK(SP) > Y then TRAP (range_error);end if;

FA CHECK_0 Check range 0 .. m [ val, max => val ]N

orm

al

POP (X);

if STACK(SP) < 0 or STACK(SP) > X then TRAP (range_error);end if;

FB CHECK_U Check unsigned range n .. m [ val, min, max => val ]

Nor

mal

POP (Y);POP (X);

if STACK(SP) < X or STACK(SP) > Y then TRAP (range_error);end if;

FC CHECK_R Check real range n .. m [ val, min, max => val ]

Nor

mal

POP (Y);POP (X);

if STACK(SP) < X or STACK(SP) > Y then TRAP (range_error);end if;

Dou

ble

POPD (Y);POPD (X);

if STACK(SP–1..SP) < X or STACK(SP–1..SP) > Y then TRAP (range_error);end if;

FD ERROR err 1 unsigned

Runtime error trap [ ]unsigned

Nor

mal

ERROR (err);

FE HALT Stop program and return completion code [ code => ]

Nor

mal POP (X);

HALT (X);

Page 64: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 60

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.2.4.18 No–operation Instruction

This instruction does not perform any operation.

Hex Mnemonic Param. Semantics

FF NOP No operation

all m

odes

–– no operation

Page 65: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 61

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

5.3 Sample AP and Corresponding I–Code

This example shows the translation of the following AP into I–code. For an example of the generatedDebug Table, see 8.

Source code:

1 procedure Example; 2 3 import \SYSTEM\IO_Library; –– system library (Get/Put procedures) 4 5 variable Sum: INTEGER; –– global address 0 6 variable N: INTEGER; –– global address 1 7 8 9 procedure Add (X: INTEGER); –– subprogram 1 10 begin 11 Sum := Sum + X; 12 INC (N); 13 end Add; 14 15 16 function Mean: INTEGER; –– subprogram 2 17 begin 18 if N = 0 then 19 return 0; 20 else 21 return Sum / N; 22 end if ; 23 end Mean; 24 25 26 begin 27 Sum := 0; –– initialize counters 28 N := 0; 29 30 for I := 1 to 10 do –– I implicitly on global address 2 31 Add (I); –– local procedure call 32 end for ; 33 34 Put_String (”Mean value = ”); –– subprogram 6 from system library 35 Put_Integer (Mean); –– subprogram 7 from system library 36 New_Line; –– subprogram 9 from system library 37 end Example;

Page 66: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 62

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

I–code in assembly language:

This is the generated I–Code in symbolic (assembly) form. The binary code is given as comments inhexadecimal form (on the right side after the semicolon).

.PROCEDURE EXAMPLE

.IMPORT ; Size: 0

.DATA 6

.CODE ; Size: 65 ; PC Code dump

.ENTRY P1 ; 6

.LINE 10 ENTER 1, 3 ; 6: E8 01 03.LINE 11 LOAD_G.0 ; 9: 20 LOAD_L.0 ; 10: 10 ADD_I ; 11: A0 STOR_G.0 ; 12: 50.LINE 12 LOAD_G.1 ; 13: 21 LOAD_C.1 ; 14: 01 ADD_I ; 15: A0 STOR_G.1 ; 16: 51.LINE 13 RTN ; 17: E9

.ENTRY P2 ; 18

.LINE 17 ENTER 0, 2 ; 18: E8 00 02.LINE 18 LOAD_G.1 ; 21: 21 LOAD_C.0 ; 22: 00 EQU ; 23: BE JUMP_C.h L1 ; 5 ; 24: DD 00 05.LINE 19 LOAD_C.0 ; 27: 00 RTN ; 28: E9L1:.LINE 21 LOAD_G.0 ; 29: 20 LOAD_G.1 ; 30: 21 DIV_I ; 31: A3 RTN ; 32: E9

Page 67: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 63

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

.MAIN ; 33

.LINE 27 LOAD_C.0 ; 33: 00 STOR_G.0 ; 34: 50.LINE 28 LOAD_C.0 ; 35: 00 STOR_G.1 ; 36: 51.LINE 30 LOAD_A_G.b 2 ; 37: 8E 02 LOAD_C.1 ; 39: 01 LOAD_C.10 ; 40: 0A LOAD_C.1 ; 41: 01 ITER L2 ; 6 ; 42: E0 00 06.LINE 31 LOAD_G.2 ; 45: 22 CALL.1 ; 46: 71 NEXT ; 47: E1L2:.LINE 34 LOAD_A_T.b D1 ; 0 ; 48: 92 00 LOAD_C.13 ; 50: 0D LOAD_C.0 ; 51: 00 SYS 255, 6 ; 52: F4 FF 06.LINE 35 CALL.2 ; 55: 72 LOAD_C.1 ; 56: 01 SYS 255, 7 ; 57: F4 FF 07.LINE 36 SYS 255, 9 ; 60: F4 FF 09.LINE 37 LOAD_C.0 ; 63: 00 HALT ; 64: FE

.CONSTANT ; Size: 5

D1: 13, ; 0000000D |....| 1298489710, ; 4D65616E |Mean| 544629100, ; 2076616C | val| 1969561661, ; 7565203D |ue =| 538976288 ; 20202020 | |

; Library relocation list: Size: 0

.VERSION ; Size: 1 ” 3/–”

Page 68: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 64

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

; Source reference list: Size: 16; PC LINE; 6 10; 9 11; 13 12; 17 13; 18 17; 21 18; 27 19; 29 21; 33 27; 35 28; 37 30; 45 31; 48 34; 55 35; 60 36; 63 37

.END

Page 69: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 65

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

6 Runtime ErrorsThe runtime errors that may occur in an I–Code interpreter are defined by the Ada packageRuntime_Errors (see chapter 9) in terms of an Ada enumeration type, together with functions convertingbetween the enmeration values and their textual and machine representation. This package shall be usedby all software implementing I–Code runtime functionality.

Page 70: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 66

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7 Parameter Encoding

When parameter lists are to be transferred via the network (e.g. for activation of an AP, or remoteinvocation of a library procedure/function) they must be encoded in a serial stream of words. This isreferred to as external encoding.

When parameter lists of parameterized pathnames are kept in the memory of the stack machine, they areencoded in an analogous form. This is referred to as internal encoding.

Both external and internal encoding are based on the same encoding scheme.

Encoded parameter lists are in network (i. e. big endian) format.

7.1 Minimal and Extended Parameter Encoding

There are two forms of parameter encoding:

• Minimal encoding encodes the parameter values enhanced with rudimentary type classinformation. This is sufficient to decode the list and treat parameter values as uninterpreted wordstreams, e. g. in an I–Code interpreter. For the internal encoding scheme there is only a minimal form.

• Extended encoding adds name and type information to the encoded list and, in addition to minimalencoding, allows to extract parameter names and values in readable form. The extension part is anoptional addition to the minimal encoding part.

The two forms are depicted below. Each of the single parts is enclosed by a header word containing thenumber of following words and an end marker word containing 0. The header word is an offset to the endmarker.

encoded values + type class information for each parameterSizein words 0

values +Sizein words 0 name + typeSize

in words 0associationstype classestypeSize

in words 0definitions

Minimal encoding:

Extended encoding:

minimal encoding part extension parts

par. 1 par. 2 par. 3 par. n...

Figure 7.1–1. Minimal and extended encoding

Page 71: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

reserved

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 67

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.2 Type References

Whenever concrete UCL/HLCL types are referenced within an encoded parameter list, this reference isa number encoded in one word. Predefined types are numbered 1 – 31, as shown in the picture.User–defined types may be defined within the encoded parameter list, they are numbered starting at 32.

Type references to predefined types

0 undefined type1 string of Character

2 statecode

3 Integer

4 Real

5 Boolean

6 Bitset

7 Character

8 Word

9 pathname

10 Time

11 Duration

12 Completion_Code

13 pathname .* (subitem pathname, CSS specific type)14 Pulse (CSS specific type)15 Burst_Pulse (CSS specific type)16 Unsigned_Integer

17 Long_Real

18 Byte

19 Long_Word

20 string of Byte

21 22 23 24 25 26 27 28 29 30 31 pathname () (parameterized pathname)

Page 72: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 68

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.3 Minimal Encoding Part

7.3.1 Parameter Modes and Type Classes

Parameters are classified by mode and type. This classification is coded in the parameter class word, withthe mode in the upper halfword and the type in the lower halfword.

Mode

The parameter mode defines the passing and access mechanism.

0 type IN A value is passed into the called module.

1 type OUT A value is passed out of the called module.

2 type IN OUT A value is passed into and out of the called module.

Type class

Parameters may belong to the following type classes.

1mod

e 1–word scalar type (INTEGER, REAL, BOOLEAN, BITSET, WORD, ...)Item is exactly one 32–bit word. Sets that occupy one word or less are classified here, too.

2mod

e 2–word scalar type (LONG_REAL, TIME, STATECODE, ...)Item is exactly two 32–bit words.

3mod

e fixed–size string typeItem is one component consisting of one or more words representing a string.

4mod

e fixed–size structured type (array, record, set)Item is one component consisting of zero or more words representing an array, record or set.

5mod

e open string type (open string parameter)Item is one component consisting of 1 or more words representing a string.

6mod

e open structured type (open array parameter)Item is one component consisting of zero, one or more words representing an array.

7mod

e parameterized pathname (pathname( ))Item is a database end item with parameters (AP, stimulus, ...).

Page 73: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 69

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.3.2 Value Encoding Part

7.3.2.1 External Scheme

The following defines the external parameter encoding scheme. The parameter stream is prefixed with thesize of the stream in words, then follow the single parameters, each encoded as shown in the picture, anda null word terminating the stream.

The No. of words indication counts the number of data words only.

The Upper bound indication for open strings and structures is the upper bound according to the UCLview.

The Type indication is a reference to a predefined type (see 7.2).

. . .Parameter 1 Parameter 2 Parameter nSizein words

data wordsParameter type class

Word1

Word2

Word3

... Wordn

Word1

Word2

Word3

Wordn...

open structure

fixed string

Word1

2–word scalar Word2

Word1

1–word scalar

0

Word1

Word2

Word3

... Wordn

Word1

Word2

Word3

Wordn...

open string

fixed structure

No. ofwords

No. ofwords

No. ofwords

No. ofwords

Upperbound

Upperbound

Type

Type

Word1

Word2

Word3

... Wordn

parmeterized No. ofwords SIDpathname

Words 1 .. n are the parameterlist of the pathname, encodedaccording to these rules.

1mod

e

2mod

e

3mod

e

4mod

e

5mod

e

6mod

e

7mod

e

Figure 7.3.2.1–1. External Parameter Encoding Scheme

Page 74: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 70

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.3.2.2 Internal Scheme

The following defines the representation of a parameterized pathname item in the memory of the stackmachine, including its actual parameter list. On the expression stack a parameterized item is representedby an address pointing to the following data structure in memory.

The item is represented by its SID, the size of its actual parameter list, and the parameter list itself, whichis encoded in the internal encoding scheme. The internal encoding scheme is essentially identical to theexternal scheme, with the only difference that for non–scalar parameters the actual data words are replacedby an address pointing to the location in memory where the data words are stored.

Note that the Size of list in this case denotes the true size of the encoded parameter list with addresses tostructures instead of the actual structured values while the Size in words, nevertheless, counts the datawords (and not the addresses) for the size of its following list, like in the external encoding.

Size of list Encoded listpathname SID

. . .Parameter 1 Parameter 2 Parameter nSizein words

data wordsParameter type class

Ad–dress

open structure

fixed string

Word1

2–word scalar Word2

Word1

1–word scalar

0

open string

fixed structure

No. ofwords

No. ofwords

No. ofwords

No. ofwords

Upperbound

Upperbound

Type

Type

parmeterized No. ofwords SID

pathname

Address of datainstead of the data itself.

Ad–dress

Ad–dress

Ad–dress

Ad–dress

1mod

e

2mod

e

3mod

e

4mod

e

5mod

e

6mod

e

7mod

e

for IN parameters

Ad–dress

2–word scalar

Ad–dress

1–word scalar

Type

Type1mod

e

2mod

e

for OUT and IN OUT parameters

Figure 7.3.2.2–2. Internal Parameter Enoding Scheme

Page 75: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 71

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.4 Extension Parts

7.4.1 String Encoding

Whenever textual components (names, string constants etc.) are to be encoded, they take the form shownin the picture. The string is prefixed with its length (number of characters) and encodes 4 characters perword. It is padded with blanks to fill a full word, if the length is not a multiple of 4.

name, 4 characters per word,Name length

Word1

Word2

Word3

Wordn...Length

padded with blanks to full word

Figure 7.4.1–1. String encoding

7.4.2 Parameter Definition Part

This section associates each parameter with a name and a type and, in the case of parameterizedparameters, with a parameter list. The parameter stream is prefixed with the size of the stream in words,then for each parameter the type and name (and possibly the extension parts of its parameter list) are given,and a null word terminates the stream.

The type is a number that references either a UCL/HLCL predefined type (a number in the range 1 – 31,see 7.2) or a user–declared type defined in the type definition part (a number > 31, see 7.4.3).

The name is encoded as a string (see 7.4.1) in upper–case letters.

. . .Parameter 1 Parameter 2 Parameter nSizein words

name encoded as a string

0

Type Name

31 Name Parameter definition part Type definition partparameterizedpathname

simpleparameter

in upper–case letters

Figure 7.4.2–1. Parameter definition part

Page 76: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 72

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.4.3 Type Definition Part

This section defines user–declared types, in addition to the predefined UCL/HLCL types (see 7.2). Typesdefined here are numbered in the order of their definition, starting at 32.

. . .Type 32 Type 33 Type nSizein words 0

statecodeset type

enumerationtype

Min Maxdiscrete Basetype

Statecode list

No. ofwords

Statecodes are coded in two wordseach, with upper–case letters,

Literals are identifiers encoded as

Statecode 1 Statecode 2 ... Statecode n

padded with blanks to 8 characters.

List of literals

0Literal 1 Literal 2 ... Literal n

strings, with upper–case letters.

Base type is a discrete

record type Component list See details on next page

No. ofwords 0

1 7

1 2

1 8

set type 1–word scalar type

fixed Elementtype

Maxlength

open Elementtype

Upper

1 3

1 6open Element

type1 5string type

string type

fixed Elementtype Length1 4

array type

array type

bound

Upperbound

Upper bound is 0 .. n – 1

Upper bound is 1 .. n

Length is 1 .. n

Max length is 1 .. n

1 9

unitized type Basetype

The unit is encoded in its textualUnit text representation as a string,1 1 Unit name

together with its name, if any.

Figure 7.4.3–1. Type definition part, simple types

Note that the structure indicators in the picture consist of two parts, each encoded in a halfword.

Page 77: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 73

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Record type definitions

Min Max

Component 1 ...

recordComponent list

No. ofwords

A component is

0Component 2 Component n

Type Name

No. of

Tag field

words

Variants

0

Type

Variant 1 ...Variant 2 Variant n

Selector list Component list

Statecode

either a field ora variant part.

A selector is eithera range of values ora statecode, dependingon the tag field type.

Name

No. ofwords Selector 1 Selector 2 Selector n... 0

Component listlike above(recursive definition)

type

2 1

2 2

1 9

Figure 7.4.3–2. Type definition part, record type

Page 78: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 74

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.5 Example (call of a libr. procedure, minimal external scheme)

Declaration (UCL):procedure PROC (in NUMBER : INTEGER; -- 1–word scalar

in SWITCH : BOOLEAN; -- 1–word scalarout DOUBLE : LONG_REAL; -- 2–word scalarin STATE : statecode ; -- 2–word scalarin TEXT_1 : STRING_9; -- fix–size stringin TEXT_2 : string ; -- open stringin out ARRAY_1: REAL_ARRAY_4; -- fix–size arrayin ARRAY_2: array of REAL; -- open arrayin PATH_1 : pathname ; -- simple pathnamein PATH_2 : pathname () ); -- parameterized pathname

Call (HLCL): PROC NUMBER : 123, -- 1–word scalar

SWITCH : TRUE, -- 1–word scalarDOUBLE : some variable -- 2–word scalarSTATE : $MEDIUM, -- 2–word scalarTEXT_1 : ”ABCDEFGHI”, -- fix–size stringTEXT_2 : ”ABCDEFGHI”, -- open stringARRAY_1: some variable, -- fix–size arrayARRAY_2: (1.0, 2.0, 3.0, 4.0), -- open arrayPATH_1 : \some_path\X, -- simple pathnamePATH_2 : \some_path\Y (3.14) -- parameterized pathname

Encoded parameter list:

52

INTEGER

4

4 3

true

A B C D E F G H I

M E D I U M

size

NUMBER

TEXT_2

STATE

SWITCH

ARRAY_2

0DOUBLE

0

9

1.0 2.0 3.0 4.0

endof list

9

123

LONG_REAL

STATECODE

BOOLEAN

4 A B C D E F G H ITEXT_1 9

7 5PATH_2 4 1 3.14

PATHNAMEPATH_1 17535

17536 REAL 0

of list

4ARRAY_1 1.0 2.0 3.0 4.0

0

0

10

60

42

50

30

20

21

10

10

Figure 7.3.1–1. Encoded Parameter List

Page 79: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 75

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

7.6 Stack Machine Representation of AP Parameters

Within the memory of the Stack Machine the parameters are represented as shown in the picture:

1–word scalar value

fixed structure address

upper bound

addressopenstructure

...

...

contents offixed structure

0

3

4

5

AP global data frame

GP

MP

AP parameters are treatedas the first n global variables.This is analogous to localprocedure parameters.

Non–scalar parametersare allocated space inmemory and referenced

Addresses are obtainedby allocation of space inmemory for non–scalars.

2–wordscalar

1

2value

via their address.

...param. pathname address6

contents ofopen structure

contents ofparameterized pathname

These are the n data words

This is the SID, the No. of

These are the n data words

data words and the encodedparameter list like definedhere, but with addresses tostructured data, instead of thedata words themselves.

data parts ofparameterized pathname

Figure 7.3.1–1. Global Data Frame

Page 80: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 76

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8 Symbol Table and Debug Table

8.1 Functional Description

In order to support separate compilation and symbolic debugging, the UCL compiler generates two kindsof tables: a Symbol Table and a Debug Table. These tables are stored in the Mission Database under therespective Library or Automated Procedure entry. Both kinds of tables exhibit a common format andstructure (with some minor differences).

A Symbol Table is generated for each UCL unit that can be imported in other units, this comprisesAutomated Procedures (APs), library specification and any Parameterized Items. It contains the public(exported) declarations of the unit in an internal binary format. It basically enables the compiler to performtype checking across library boundaries. The Symbol Table is used by the compiler during compilationof the unit’s body or one of its clients (i.e. all APs and/or other units using that unit), in order to importthe declarations.

A Debug Table, on the other hand, is generated for each UCL main program (AP) or Library body. It isbasically identical to the Symbol Table, except that it additionally contains information required by theI–Code Interpreter/Debugger for symbolic debugging, e.g. references to source line numbers andprocedure/function scope information.

Page 81: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 77

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.2 Structure of the Symbol / Debug Table

A Symbol Table or a Debug Table consists of a header followed by a possibly empty list of imports andsections. It is terminated by a suffix.

A section describes the contents of a main program, subprogram (i.e. procedure or function) or library (thatis, a section corresponds to a visibility scope in UCL). A section contains objects, types and componentsand is terminated by a scope identification.

An object corresponds to a named declaration in UCL. Each type definition is represented by a type item.Some objects and types may also contain references to components (e.g. parameters or fields). This isdepicted in Fig. 8.2.

O = objectT = typeC = component

Legend

O1

O2C C C

C C

T T T

Figure 8.2 Elements of Symbol Table / Debug Table section

Items may reference (or point to) other items. Items generation is such that all references can be resolvedwithout ”forward references”; this means that the item being referenced must occur before all other itemsreferencing it. A referenced item may in turn reference another item. This may lead to multiply nestedreference chains.

Items which may be referenced are numbered sequentially, in order of creation. The generated referencenumber is then used by other items as ”reference pointer”.

Page 82: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 78

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.3 Layout

Internally, a Symbol Table or a Debug Table is a sequence of bytes. Groups of bytes build ”items”. Theitems appear according to the following syntax expressed using EBNF (Extended Backus–Naur Form)with the following extension: If the name of any syntactic category starts with an italicized part, it isequivalent to the category name without the italicized part. The italicized part is intended to convey somesemantic information. For example Line_Number and Address_Number are both equivalent to Numberalone.

An item is introduced by an identifier and followed by a sub–identifier, that determines the kind of the item.Identifiers and sub–identifiers are bytes. They are represented by a symbolic keyword in bold face in theEBNF. In the following table, their numerical values are given in hexadecimal:

TAB 02 A TAB (table) identifier introduces each table.SYMBOL 00DEBUG 01

CTL F0 CTL (control) identifiers are used to controlIMPORT 00 the reading of Symbol and Debug Tables.SCOPE 01 They are used to group sections that belongLOOP 02 together.END 03

TYP F1 TYP (type) identifiers are used to reflectENUM 00 type definitions in a Symbol or DebugPARAM 01 Table.IDENTITY 02RANGE 03UNIT 04SET 05STRING 06DYN_STRING 07ARRAY 08DYN_ARRAY 09RECORD 0ASTATECODE 0BPATHNAME 0CSUBITEM_PATHNAME 0DIMPORT 0EINHERITED 0FUNION 10

CMP F2 CMP (component) identifiers representIN_PAR 00 components of types and objects, e.g. recordOUT_PAR 01 fields, formal parameters and enumerationIN_OUT_PAR 02 constants.FIELD 03ENUM_CONST 04STATECODE 05DB_ITEM 06DB_SUBITEM 07TYPE 08

OBJ F3 OBJ (object) identifiers represent namedPAR 00 UCL declarations, like variables, constants,VAR 01 types etc.CONST 02TYPE 03PROC 04FUNC 05UNIT 06ALIAS 07

Page 83: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 79

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.4 Table Framework

Symbol_Table = TAB ( SYMBOL | DEBUG ) Version_String{ Import }{ Section }Suffix.

Symbol Tables and Debug Tables start with an appropriate header item, followedby lists of Import and Section items and terminated by a Suffix item.

Version_String4–character version string of the form “nn/x” where nn is the version number (thefirst n possibly being a space character), and x is either a hyphen (’–’) for the firstissue, or a capital letter A, B , C , ... for later issues. It refers to an issue of this Refer-ence Manual.

Import = CTL IMPORT Library_Name, SID_Word.

An Import item serves as reference to an imported UCL item, e. g. library.

Library_NameName of the imported item

SID_WordID of the imported item

Suffix = CTL END Datasize_Byte, Subprogram_Byte.

The Suffix item is written at the end of each Symbol or Debug Table.

Datasize_Bytethe highest address used in the global data of the generated I–Code

Subprogram_Bytethe highest subprogram number used in the generated I–Code

Section = { Object | Type } Scope.

A Section item describes the contents of a main program, subprogram (i.e. proce-dure or function) or library (that is, a section corresponds to a visibility scope inUCL). Each section is terminated by a scope identification.

Scope = General_Scope | Loop_Scope.

General_Scope = CTL SCOPE Subprogram_Byte.

A General_Scope item is written for each procedure, function and library. AllObject and Type items preceding this item belong to this scope.

Subprogram_Bytenumber of the subprogram, or 0 for the library body or AP body.

Loop_Scope = CTL LOOP Position_Word.

A Loop_Scope item is written for each for loop. The object item directly preced-ing this item is the loop counter variable.

Position_WordPC of the corresponding ITER instruction within the I–Code.

Page 84: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 80

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.5 Objects

Object = [ Unit_Object | Procedure_Object | Function_Object |Constant_Object | Type_Object | Variable_Object |Parameter_Object | Alias_Object ].

For each named declaration, an Object item is output in the Symbol or DebugTable.

Unit_Object = OBJ UNIT Object_Name, Unit.

For each unit declaration, a Unit_Object item is output.

Object_Namethe name of the new unit

Unitthe unit definition

Procedure_Object = { Parameter } OBJ PROC Object_Name,

Body_Byte,Line_Word, Column_Word,Body_Line_Word, Body_Column_Word,Subprogram_Byte, Guarded_Byte.

For each procedure, a Procedure_Object item is output. All Parameter itemspreceding this item belong to this procedure.

Object_Namethe name of the procedure

Body_Byte0 = the subprogram is defined in a library specification and implemented in the body1 = the subprogram is declared in the body only

Line_Wordline number of the subprogram declaration within the library specification

Column_Wordcolumn number of the subprogram declaration within the library specification

Body_Line_Wordline number of the subprogram declaration within the body

Body_Column_Wordcolumn number of the subprogram declaration within the body

Subprogram_Bytethe index number of the subprogram (starting at 1)

Guarded_Bytean indication whether the procedure is guarded (1) or not (0)

Page 85: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 81

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Function_Object = { Parameter } OBJ FUNC Object_Name,

Body_Byte,Line_Word, Column_Word,Body_Line_Word, Body_Column_Word,Type_Ref, Subprogram_Byte, Guarded_Byte.

For each function, a Function_Object item is output. All Parameter items pre-ceding this item belong to this function.

Object_Namethe name of the function

Body_Byte0 = the subprogram is defined in a library specification and implemented in the body1 = the subprogram is declared in the body only

Line_Wordline number of the subprogram declaration within the library specification

Column_Wordcolumn number of the subprogram declaration within the library specification

Body_Line_Wordline number of the subprogram declaration within the body

Body_Column_Wordcolumn number of the subprogram declaration within the body

Type_Refreference to the type of the value returned by the function

Subprogram_Bytethe index number of the subprogram (starting at 1)

Guarded_Bytean indication whether the function is guarded (1) or not (0)

Parameter = In_Parameter | Out_Parameter | In_Out_Parameter.

For each parameter of a procedure or function, a Parameter item is output. It isdifferent for each parameter mode (IN, OUT or IN OUT).

In_Parameter = CMP IN_PAR Parameter_Name, Type_Ref, Guarded_Byte,Default_Value.

For each IN parameter of a subprogram, an In_Parameter item is output.

Parameter_Namethe name of the parameter

Type_Refreference to the type of the parameter

Guarded_Bytean indication whether the parameter is guarded (1) or not (0)

Default_Valuethe default value, 0 if no default value given

Page 86: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 82

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Out_Parameter = CMP OUT_PAR Parameter_Name, Type_Ref, Guarded_Byte.

For each OUT parameter of a subprogram, an Out_Parameter item is output.

Parameter_Namethe name of the parameter

Type_Refreference to the type of the parameter

Guarded_Bytean indication whether the parameter is guarded (1) or not (0)

In_Out_Parameter = CMP IN_OUT_PAR Parameter_Name, Type_Ref, Guarded_Byte.

For each IN OUT parameter of a subprogram, an In_Out_Parameter item is out-put.

Parameter_Namethe name of the parameter

Type_Refreference to the type of the parameter

Guarded_Bytean indication whether the parameter is guarded (1) or not (0)

Constant_Object = OBJ CONST Object_Name,Body_Byte,Line_Word, Column_Word,Type_Ref, Value.

For each constant declaration, a Constant_Object item is output.

Object_Namethe name of the constant

Body_Bytelocation of the object declaration (0 = specification, 1 = body)

Line_Wordline number of the object declaration

Column_Wordcolumn number of the object declaration

Type_Refreference to the type of the constant

Valuethe value of the constant

Page 87: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 83

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Type_Object = OBJ TYPE Object_Name,Body_Byte,Line_Word, Column_Word,Type_Ref.

For each type declaration, a Type_Object item is output.

Object_Namethe name of the type

Body_Bytelocation of the object declaration (0 = specification, 1 = body)

Line_Wordline number of the object declaration

Column_Wordcolumn number of the object declaration

Type_Refreference to the type definition

Variable_Object = OBJ VAR Object_Name,Body_Byte,Line_Word, Column_Word,Type_Ref, Level_Byte, Address_Byte,Mode_Byte, Initial_Value.

For each variable declaration, a Variable_Object item is output.

Object_Namethe name of the variable

Body_Bytelocation of the object declaration (0 = specification, 1 = body)

Line_Wordline number of the object declaration

Column_Wordcolumn number of the object declaration

Type_Refreference to the type of the variable

Level_Bytethe level of the variable (0 = global, 1 = local)

Address_Bytethe address of the variable in its data frame

Mode_Bytethe variable mode (0 = simple variable, 4 = loop index variable)

Initial_Valuethe initial value of the value, 0 if no initial value

Page 88: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 84

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Parameter_Object = OBJ PAR Object_Name,Body_Byte,Line_Word, Column_Word,Type_Ref, Level_Byte, Address_Byte,Mode_Byte, Guarded_Byte.

For each formal parameter, a Parameter_Object item is output.

Object_Namethe name of the parameter

Body_Bytelocation of the object declaration (0 = specification, 1 = body)

Line_Wordline number of the object declaration

Column_Wordcolumn number of the object declaration

Type_Refreference to the type of the parameter

Level_Bytethe level of the parameter (0 = global, 1 = local)

Address_Bytethe address of the parameter in its data frame

Mode_Bytethe parameter mode (1 = in, 2 = out, 3 = in out)

Guarded_Bytean indication whether the parameter is guarded (1) or not (0)

Alias_Object = OBJ ALIAS Object_Name, Body_Byte,Line_Word, Column_Word,SID_Word, Selector_Name.

For each alias declaration, an Alias_Object item is output.

Object_Namethe name of the alias

Body_Bytelocation of the object declaration (0 = specification, 1 = body)

Line_Wordline number of the object declaration

Column_Wordcolumn number of the object declaration

SID_Wordthe SID associated with this alias

Selector_NameIf the alias denotes an item from a library, then Selector_Name is the name of thisitem, otherwise it is an empty string.

Page 89: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 85

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.6 Types

Type = [ Enumeration_Type | Identity_Type | Parameterized_Type |Range_Type | Unitized_Type | Set_Type | String_Type |Array_Type | Record_Type | Statecode_Type | Pathname_Type |Subitem_Pathname_Type | Imported_Type | Inherited_Type |Union_Type ].

A Type item is generated for each UCL type definition. For reference purposes,each generated Type item is assigned a reference number. Note that Type itemsare not generated for built–in (predefined) UCL types. The latter are referenced bytheir fixed, preassigned reference numbers (listed below under definition of Ref).

Enumeration_Type = { Enumeration_Constant }TYP ENUM Size_Number.

An Enumeration_Type item is output for each enumeration declaration. AllEnumeration_Constant items preceding this item belong to this enumerationtype.

Size_Numberthe size of objects of this type

Enumeration_Constant = CMP ENUM_CONST Constant_Name,Body_Byte,Line_Word, Column_Word.

An Enumeration_Constant item is output for each enumerated constant.

Constant_Namethe name of the constant (the enumeration literal)

Body_Bytelocation of the object declaration (0 = specification, 1 = body)

Line_Wordline number of the object declaration

Column_Wordcolumn number of the object declaration

Identity_Type = TYP IDENTITY Size_Number, Basetype_Ref.

An Identity_Type item is output for each identity type declaration.

Size_Numberthe size of objects of this type

Basetype_Refreference to the base type

Parameterized_Type = TYP PARAM Size_Number, Basetype_Ref.

A Parameterized_Type item is output for each parameterized type declaration.

Size_Numberthe size of objects of this type

Basetype_Refreference to the base type

Page 90: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 86

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Range_Type = TYP RANGE Size_Number, Basetype_Ref, { Data_Word }.

A Range_Type item is output for each subrange type declaration.

Size_Numberthe size of objects of this type

Basetype_Refreference to the base type

{ Data_Word }the MIN and MAX values of the range, respectively. If the base type is of a doubleword type class, e.g. LONG_REAL, then the bound are given by four Data_Wordsrepresenting two double word values, otherwise by two Data_Words.

Unitized_Type = TYP UNIT Size_Number, Basetype_Ref, Unit_Name.

A Unitized_Type item is output for each unitized type declaration.

Size_Numberthe size of objects of this type

Basetype_Refreference to the base type

Unit_Namestring representation of the unit. Unit_Name must have been previously defined byan OBJ UNIT item.

Set_Type = TYP SET Size_Number, Elementtype_Ref.

A Set_Type item is output for each set type declaration.

Size_Numberthe size of objects of this type

Elementtype_Refreference to the element type

String_Type = TYP STRING Size_Number, Elementtype_Ref, Indextype_Ref |TYP DYN_STRING Size_Number, Elementtype_Ref.

A String_Type item is output for each string type declaration.

Size_Numberthe size of objects of this type

Elementtype_Refreference to the element type (CHARACTER or BYTE)

Indextype_Refreference to the index type. For dynamic, i.e. open, strings, no index type is ex-plicitly given (it is INTEGER by definition).

Page 91: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 87

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Array_Type = TYP ARRAY Size_Number, Elementtype_Ref, Indextype_Ref |TYP DYN_ARRAY Size_Number, Elementtype_Ref.

An Array_Type item is output for each array type declaration.

Size_Numberthe size of objects of this type

Elementtype_Refreference to the element type

Indextype_Refreference to the index type. For dynamic, i.e. open, arrays, no index type is explicitlygiven (it is INTEGER by definition).

Record_Type = { Field }TYP RECORD Size_Number.

A Record_Type item is output for each record declaration. All Field items pre-ceding this item belong to this record.

Size_Numberthe size of objects of this type

Field = CMP FIELD Field_Class, Field_Name, Type_Ref, Offset_Number,Field_Selector_Byte, [ Labels ].

A Field item is output for each record field.

Field_Cassspecifies whether the item is a normal record field, a selector field or a field con-tained in a case variant (see definition below)

Field_Namethe name of the field

Type_Refreference to the type of the field

Offset_Numberthe offset in words of the record field to the start of the record

Field_Selector_Bytethe index of the case selector field (counting all record fields starting with 1) for theinnermost case variant containing the current field; it is zero for record fields outsidevariants

LabelsIf the Field_Selector_Byte is non–zero, it is followed by case Labels; otherwise,Labels are omitted entirely.

Field_Class = Byte.

Indicating classes of record fields:

0 NONE1 NORMAL_FIELD a normal record field2 SELECTOR_FIELD a case selector field3 CASE_FIELD a field inside a variant

Page 92: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 88

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

Labels = Count_Byte, { Start_Word, End_Word }.

This is the list of case labels used for the definition of a record field (for variantrecords.)

Count_Byte the length of the following list of start/end value pairs of case label ranges

Start_Wordthe first value of a label range

End_Wordthe last value of a label range (for a single value End_Word = Start_Word)

Statecode_Type = { Statecode_Constant }TYP STATECODE Size_Number.

A Statecode_Type item is output for each declaration of a statecode type. AllStatecode_Constant items preceding this item belong to this type.

Size_Numberthe size of objects of this type

Statecode_Constant = CMP STATECODE Statecode_Longword.

A Statecode_Constant item is output for each enumerated statecode name in astatecode declaration.

Statecode_Longwordthe name of the statecode constant, padded with spaces

Pathname_Type = { DB_Item }TYP PATHNAME Size_Number.

A Pathname_Type item is output for each declaration of a pathname type.AllDB_Item items preceding this item belong to this type.

Size_Numberthe size of objects of this type

DB_Item = CMP DB_ITEM Item_Type_Name.

A DB_Item item is output for each enumerated database item type name in a path-name declaration.

Item_Type_Namethe name of the database item type

Subitem_Pathname_Type = { DB_Subitem }TYP SUBITEM_PATHNAME Size_Number.

A Subitem_Pathname_Type item is output for each declaration of a subitempathname type. All DB_Subitem items preceding this item belong to this type.

Size_Numberthe size of objects of this type

Page 93: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 89

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

DB_Subitem = CMP DB_SUBITEM Subitem_Type_Name.

A DB_Subitem item is output for each enumerated database subitem type name ina subitem pathname declaration.

Subitem_Type_Namethe name of the database subitem type

Imported_Type = TYP IMPORT Library_Number, Type_Name.

An Imported_Type item is output for each type which is actually imported fromanother compilation unit.

Library_Numberthe index of the exporting library in the import list (sequence ofCTL IMPORT items)

Type_Namethe declared identifier for the imported type

Inherited_Type = TYP INHERITED Size_Number, Basetype_Ref, SID_Word.

An Inherited_Type is output for each type inherited from an item in the database,e. g. a measurement item, with the UCL type of construct.

Size_Numberthe size of objects of this type

Basetype_Refthe reference to the base type

SID_Wordthe SID of the library the type is inherited from

Union_Type = { Member_Type }TYP UNION.

A Union_Type item is output for an HLCL type union, i. e. for an overloading ofone or more types. All member type items preceding this item belong to the typeunion.

Member_Type = CMP TYPE Member_Type_Ref.

A Member_Type item is output for each member type of a type union.

Member_Type_Refthe reference to the member type

Page 94: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 90

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.7 Type References

Ref = Number.

A Ref item refers to the sequence numbers generated by the compiler to identifyspecific UCL types. They allow subsequent references to these items to be madeby other Symbol or Debug Table items.

The reference numbers of the standard (built–in) UCL types are predefined as fol-lows:

0: no specific type, all types allowed (HLCL only)1: Boolean2: Character3: Integer4: Unsigned_Integer5: Real6: Long_Real7: Bitset8: Time9: Duration

10: Word11: string of Character12: statecode13: pathname14: pathname .* (subitem pathname)15: Pulse16: Burst_Pulse17: Completion_Code18: Byte19: Long_Word20: string of Byte

The numbers 21 .. 31 are reserved for future built–in types. The reference numberof the first non–standard structure is 32.

8.8 Units of Measure

Unit = Absolute_Bytem_Signed_Byte, kg_Signed_Byte, s_Signed_Byte,A_Signed_Byte, K_Signed_Byte, mol_Signed_Byte,cd_Signed_Byte, Factor_Longword, [ Offset_Longword ].

A Unit item is output for each unit of measure.

Absolute_Signed_Byte1 = absolute unit, 0 = relative unitLength_Word

m_Signed_Byte, kg_Signed_Byte, ..., cd_Signed_Byteexponent to the corresponding SI base unit

Factor_Longwordthe factor of the unit

Offset_Longwordthe offset of the unit (for absolute units only)

Page 95: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 91

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.9 Names, Values

Name = String.

A Name item describes names in the Symbol or Debug Table. It is used for is usedfor UCL identifiers.

String = Length_Byte, { Data_Byte }.

A String item is used to describe text strings. It is simply a sequence of bytes, be-ginning with the length of the string as an unsigned byte value.

Value = Value_Class, { Data_Word }.

For each IN parameter, each constant and each variable declaration, a constant val-ue descriptor is output. A Value starts with a Value_Class, indicating the typeclass of the constant value. It is followed by a number of Data_Words, where thenumber depends on the Value_Class.

Class = Byte.

Each constant value in a Symbol or Debug Table starts with a Class, indicating thetype class of the constant. This is either

0 if there is no value. It is thus used if there is no default specified for thisparameter or no initialization value for this variable (and thus not used forplain constants). No data words follow.

1..30 followed by the simple constant value (Note that the data type classes areequally coded like the Ref Numbers). The number of data bytes is shownin the following table:

1: Boolean (1 word)2: Character (1 word)3: Integer (1 word)4: Unsigned_Integer (1 word)5: Real (1 word)6: Long_Real (2 words)7: Bitset (1 word)8: Time (2 words)9: Duration (2 word)

10: Word (1 word)11: string of Character (1 word length, n bytes data

padded to next word boundary)12: statecode (2 words)13: pathname (1 word)14: pathname .* (2 words)15: Pulse (1 word)16: Burst_Pulse (1 word)17: Completion_Code (1 word)18: Byte (1 word)19: Long_Word (2 words)20: string of Byte (1 word length, n bytes data

padded to next word boundary)

Page 96: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 92

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

31 followed by the structured value as a sequence of data words. This is sim-ply a sequence of words (where each value is encoded like a simpleconstant), beginning with the length of the value as a 4 byte integer num-ber.

Number = Word.

A Number item is a word containing an integer value.

Longword = Word, Word.

A Longword item contains a long real or any other value representable in a long-word, i.e. in two words. Byte ordering and internal data representation are accord-ing to the conventions stated in Appendix C.

Word = Byte, Byte, Byte, Byte.

A Word item contains an integer, real or any other value representable in a word.Byte ordering and internal data representation are according to the conventionsstated in Appendix C.

Byte = any value between 0 .. 255.

Signed_Byte = any value between –128 .. 127.

Page 97: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 93

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

8.10 Example

This example shows the Debug Table generated for the ”Example” AP shown in thechapter on I–Codegeneration. It is shown here both in a symbolic and in binary format (after the semicolon on the right side).

TAB DEBUG VERSION = ” 2/–” ; 1: 02 01 04 20 32 2F 2D

CTL IMPORT NAME = ”\LIB\IO_LIBRARY”, ; 8: F0 00 0F 5C 4C 49 42 5C ; 16: 49 4F 5F 4C 49 42 52 41 ; 24: 52 59 SID = 2003000 ; 26: 00 1E 90 38

OBJ PAR NAME = ”X”, ; 30: F3 00 01 58 TYPE = INTEGER, ; 34: 00 00 00 03 LEVEL = 1, ; 38: 01 ADDRESS = 0, ; 39: 00 MODE = 1, ; 40: 01 GUARDED = FALSE ; 41: 00

CTL SCOPE SUBPROGRAM = 1 ; 42: F0 01 01

CTL SCOPE SUBPROGRAM = 2 ; 45: F0 01 02

OBJ VAR NAME = ”SUM”, ; 48: F3 01 03 53 55 4D TYPE = INTEGER, ; 54: 00 00 00 03 LEVEL = 0, ; 58: 00 ADDRESS = 0, ; 59: 00 MODE = 0, ; 60: 00 VALUE = NONE ; 61: 00

OBJ VAR NAME = ”N”, ; 62: F3 01 01 4E TYPE = INTEGER, ; 66: 00 00 00 03 LEVEL = 0, ; 70: 00 ADDRESS = 1, ; 71: 01 MODE = 0, ; 72: 00 VALUE = NONE ; 73: 00

CMP IN_PAR NAME = ”X”, ; 74: F2 00 01 58 TYPE = INTEGER, ; 78: 00 00 00 03 GUARDED = FALSE, ; 82: 00 DEFAULT = NONE ; 83: 00

OBJ PROC NAME = ”ADD”, ; 84: F3 04 03 41 44 44 SUBPROGRAM = 1, ; 90: 01 GUARDED = FALSE ; 91: 00

OBJ FUNC NAME = ”MEAN”, ; 92: F3 05 04 4D 45 41 4E TYPE = INTEGER, ; 99: 00 00 00 03 SUBPROGRAM = 2, ; 103: 02 GUARDED = FALSE ; 104: 00

Page 98: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 94

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

OBJ VAR NAME = ”I”, ; 105: F3 01 01 49 TYPE = INTEGER, ; 109: 00 00 00 03 LEVEL = 0, ; 113: 00 ADDRESS = 2, ; 114: 02 MODE = 4, ; 115: 04 VALUE = NONE ; 116: 00

CTL LOOP POSITION = 41 ; 117: F0 02 00 00 00 29

CTL END ADDRESS = 6, ; 123: F0 03 06 SUBPROGRAM = 2 ; 126: 02

Page 99: Dok.-Nr/Doc. No.: CGS–RIBRE–STD–0003 · Dok.-Nr/Doc. No.: Ausgabe/Issue: Überarbtg./ Rev.: Seite/Page: 3 Datum/Date : Datum/Date: von/of 95

Dok.-Nr/ Doc. No.: Ausgabe /Issue: Überarbtg./ Rev.: Seite/Page: 95

Datum/ Date : Datum/ Date: von/ of 95

Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34

9 Ada Programming InterfaceThe following CLS Ada packages reflect stack machine memory architecture and I–Code definition. Theyshould be used for any implementation of the UCL Virtual Stack Machine, in order to make sure allimplementations are based on the same definitions.

Package CLS

This package defines some global constants, options and exceptions used by the other packages.

Package CLS_Types

This package defines the runtime representation of all UCL/HLCL datatypes with their operations.

Package CLS_Types.Network

This package provides functions to convert between platform specific representation and platformindependent standard network representation of types declared in CLS_Types. The standardnetwork representation is big endian.

Package I_Code_Definition

This package defines the I–Code instruction set. It contains the I–Code as an enumeration type, aswell as functions to convert between these enumeration values, code representation in memory andtextual Assembler representation.

Package Runtime_Errors

This package defines runtime errors that may occur in an I–Code interpreter. The runtime errors aredefined as an enumeration type, together with functions converting between the enumeration valuesand their textual and machine representation.

Package Parameter_Encoding

This package maintains parameter lists encoded according to the external encoding scheme.

Package Symbol_Table_Definition

This package contains definitions for the encoding of symbol tables and debug tables.2