Reputation: 1
I want to declare a 32-bit integer variable that increments/decrements and goes back to 0 after reaching maximum value. But I am not sure about to write in the Syntax field. What should I write?
Upvotes: 0
Views: 20
Reputation: 2060
Please note that ASN.1 is a language for describing information independent of programming language or machine architecture, so there is no guarantee that all ASN.1 compilers will use a particular language representation for a particular ASN.1 definition.
Having said that, you can define an INTEGER that will in some tools be represented as an unsigned 32-bit integer as follows:
A ::= INTEGER (0..4294967295)
Note also that ASN.1 does not have any notion of incrementing a value. It would be the ASN.1 Tool, the local machine architecture and programming language that would determine whether this ASN.1 definition is represented as an unsigned 32-bit integer, and whether incrementing it from its maximum value would not trigger an integer overflow rather than cycling around to zero.
Upvotes: 1