W
Greetings!
I need to correspond with someone about 1131-3 IL. I am writing an IL compiler, and there are some things which are not clear to me from reading
the spec. For example, reference is made in section 2.4.1.2 to method of subscripting for IL:
"The form of subscripts in the IL language defined in subclause 3.2, and the graphic languages defined in clause 4, is restricted to single-element variables or integer literals." But I don't really see a good explanation
of this; the only reference I see for IL is hierarchical I/O addressing, which in my mind is not the same as an array. Besides, the hierarchical method doesn't seem to allow the use of variables in the notation.
Another point which doesn't seem obvious to me: is there an assumed "accumulator" in the processor model for each variable type? Or is there one "accumulator" for boolean, and one 64 bit "accumulator" that is used for the rest of the variable types? I'm wondering if execution of this code results in destruction of intermediate results for the INT value:
VAR I1,I2,I3: INT; END_VAR
VAR S1,S2,S3: SINT; END_VAR
LD I1
ADD I2
LD S1
SUB S2
ST I3
ST S3
I know that it is unlikely that anyone would want to write code with interspersed variable types, but I want my compiler to function according
to the spec. I'm hoping that someone out there knows enough about IL to comment. I have some other questions, but this will get me through some of the conceptual problems I'm having. Thanks in advance.
Cheers,
Willy Smith
Numatico, S. A.
Apartado 676-4005
San Antonio de Belén
Costa Rica
Tel +506.293.9943
Fax +1.413.332.0065
[email protected]
www.numatico.com
I need to correspond with someone about 1131-3 IL. I am writing an IL compiler, and there are some things which are not clear to me from reading
the spec. For example, reference is made in section 2.4.1.2 to method of subscripting for IL:
"The form of subscripts in the IL language defined in subclause 3.2, and the graphic languages defined in clause 4, is restricted to single-element variables or integer literals." But I don't really see a good explanation
of this; the only reference I see for IL is hierarchical I/O addressing, which in my mind is not the same as an array. Besides, the hierarchical method doesn't seem to allow the use of variables in the notation.
Another point which doesn't seem obvious to me: is there an assumed "accumulator" in the processor model for each variable type? Or is there one "accumulator" for boolean, and one 64 bit "accumulator" that is used for the rest of the variable types? I'm wondering if execution of this code results in destruction of intermediate results for the INT value:
VAR I1,I2,I3: INT; END_VAR
VAR S1,S2,S3: SINT; END_VAR
LD I1
ADD I2
LD S1
SUB S2
ST I3
ST S3
I know that it is unlikely that anyone would want to write code with interspersed variable types, but I want my compiler to function according
to the spec. I'm hoping that someone out there knows enough about IL to comment. I have some other questions, but this will get me through some of the conceptual problems I'm having. Thanks in advance.
Cheers,
Willy Smith
Numatico, S. A.
Apartado 676-4005
San Antonio de Belén
Costa Rica
Tel +506.293.9943
Fax +1.413.332.0065
[email protected]
www.numatico.com