Code Monkey home page Code Monkey logo

Comments (1)

ttsiodras avatar ttsiodras commented on July 17, 2024

Hi Iulian.

Unfortunately it's not as easy as it seems. The run-time library (RTL) code has been implemented using this as a basis - that integers are mapped in a "large enough" form for pretty much all actions. If we had chosen to be more optimal in mapping INTEGER declarations to the "smallest C integer type that can accommodate them", then the interaction between RTL functions would be more complex - especially in light of code that is safety critical and must pass through compilations and static analysis tools without any warnings (encoding functions like those in asn1crt.c would have to be declared for each target "zone" - and the proper ones selected during code generation, etc). This is all the more important for SPARK/Ada outputs, where the interaction between different "bit-width" values would make things even more complex.

In the end, as with all things, this is a balancing act - the decision to use a common representation makes things much simpler to reason about. And for the uses targeted by ASN1SCC, what matters is the result of encoding (that ends up transmitted across communication lines) - where indeed, ranges are taken very much into account: an INTEGER(0..15) will only need 4 bits "on the wire" in UPER encodings, etc.

from asn1scc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.