• Has anyone ever come across a M2 compiler where LONGINT isn't 32-bit?

    From trijezdci@21:1/5 to All on Tue Oct 13 09:33:49 2020
    I am working on a project, the nature of which requires that it is portable across dialects, compilers, targets and memory models.

    Having examined some 16 or 17 classic Modula-2 compilers (PIM and ISO), I concluded that there are three different memory models:

    (1) 16-bit CARDINAL, 32-bit LONGINT
    (2) 32-bit CARDINAL, 32-bit LONGINT
    (3) 32-bit CARDINAL, 64-bit LONGINT

    In other words, it would seem that no matter which compiler, target and memory model, type LONGINT is always at least 32-bit wide.

    Nevertheless, I would be interested to learn of any exceptions where this is not the case. So, if you have come across a compiler providing a memory model different than the above mentioned three cases, please post a reply to let me know which compiler/
    target and the bit widths for CARDINAL and LONGINT.

    Thank you in advance.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From trijezdci@21:1/5 to trijezdci on Tue Oct 13 09:58:33 2020
    On Wednesday, 14 October 2020 at 01:33:50 UTC+9, trijezdci wrote:
    I am working on a project, the nature of which requires that it is portable across dialects, compilers, targets and memory models.

    Having examined some 16 or 17 classic Modula-2 compilers (PIM and ISO), I concluded that there are three different memory models:

    (1) 16-bit CARDINAL, 32-bit LONGINT
    (2) 32-bit CARDINAL, 32-bit LONGINT
    (3) 32-bit CARDINAL, 64-bit LONGINT

    In other words, it would seem that no matter which compiler, target and memory model, type LONGINT is always at least 32-bit wide.

    Nevertheless, I would be interested to learn of any exceptions where this is not the case. So, if you have come across a compiler providing a memory model different than the above mentioned three cases, please post a reply to let me know which compiler/
    target and the bit widths for CARDINAL and LONGINT.

    Thank you in advance.

    Here is the source code to a simple self-contained utility that prints out the bit widths of CARDINAL and LONGINT:

    PIM version: https://github.com/m2sf/m2pp/blob/master/cfg/utils/CheckMemModel.pim.mod

    ISO version: https://github.com/m2sf/m2pp/blob/master/cfg/utils/CheckMemModel.iso.mod

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Burrows@21:1/5 to trijezdci on Thu Oct 29 16:57:16 2020
    On Wednesday, October 14, 2020 at 3:28:38 AM UTC+10:30, trijezdci wrote:

    Having examined some 16 or 17 classic Modula-2 compilers (PIM and ISO), I concluded that there are three different memory models:

    (1) 16-bit CARDINAL, 32-bit LONGINT
    (2) 32-bit CARDINAL, 32-bit LONGINT
    (3) 32-bit CARDINAL, 64-bit LONGINT

    In other words, it would seem that no matter which compiler, target and memory model, type LONGINT is always at least 32-bit wide.

    Nevertheless, I would be interested to learn of any exceptions where this is not the case. So, if you have come across a compiler providing a memory model different than the above mentioned three cases, please post a reply to let me know which
    compiler/target and the bit widths for CARDINAL and LONGINT.

    Note that LONGINT was not introduced until the 3rd Edition of PIM so it was not implemented in early compilers e.g. Volition Systems.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)