Article View: comp.lang.modula2
Article #2889Re: 64-bit integer support in M2
From: Peter P. Eiserloh
Date: Tue, 10 Oct 1995 19:00
Date: Tue, 10 Oct 1995 19:00
46 lines
2885 bytes
2885 bytes
In article <45aanm$2s9@stork.qut.edu.au> John Gough, gough@dstc.qut.edu.au writes: >In essence we have a new type HUGEINT which is 64-bit and signed. You Why do we need a new type HUGEINT, when we could use LONGCARD, and LONGINT. That is what they are there for! With the current GPM compilers the CARDINAL/INTEGER are the same size as the LONGCARD/LONGINT, but there is no reason to maintain this, in fact there is every reason to honor the original intent of LONG types. This being support for higher precision types than supported by the machine word. The current GPM machine word is a 32-bit word (except for implementations on Alphas, and other future machines). The original GPM abitrarily decided to not support longer ordinal type. Another problem with HUGEINT, is that there is no support for HUGECARD (unsigned 64 bit word). You need to update the <Types> interface to include Card64, and Int64. We also need some portability interfaces. The <Types> module is a step in the right direction. You need some method of determining the machines endian order, and byte swapping routines. While you are adding things to the GPM interfaces consider adding FileLength() to <UxFiles>, or a real SEEK function where I can position the mark at the EOF and then get the file offset of the EOF that way. SetPos() does not suffice for this purpose. eofPos := FileLength(f); oldPos := Seek(f, fromEnd, 0); eofPos := Seek(f, fromStart, oldPos); One of the worst problems that I have with the GPM interfaces is that the low level modules do not provide an interface to the OS. I don't care how dirty the OS interface is, it is the OS. The high level library modules are supposed to hide the OS details from the casual programmer, but when you want access to the OS, now I have to implement a non-standard (not released with the compiler) interface module and link in the libc library. .................................................................... : Peter "Eyes" Eiserloh : None of the opinions expressed here are in any way related those : of my employer. : Keywords: Linux, Modula-2, Compilers, Esperanto, Physics
Technical Details
Message-ID:
<DG8y5B.G9K@avalon.chinalake.navy.mil>Path:
arc1-ca.pugleaf.net!rugeyes.chinalake.navy.mil!Peter_Eyes_EiserlohReferences:
<45aanm$2s9@stork.qut.edu.au>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2 Path: arc1-ca.pugleaf.net!rugeyes.chinalake.navy.mil!Peter_Eyes_Eiserloh From: Peter P. Eiserloh <Peter_Eyes_Eiserloh@wssagw.chinalake.navy.mil> Subject: Re: 64-bit integer support in M2 Content-Type: text/plain; charset=ISO-8859-1 Message-ID: <DG8y5B.G9K@avalon.chinalake.navy.mil> X-Xxmessage-Id: <ACA00A937D014A08@rugeyes.chinalake.navy.mil> X-Xxdate: Tue, 10 Oct 1995 18:33:39 GMT Sender: usenet@avalon.chinalake.navy.mil (NAWS news admin) Content-Transfer-Encoding: 8bit Organization: Naval Air Warfare Center - Weapons Division X-Newsreader: Nuntius 2.0.4_68K References: <45aanm$2s9@stork.qut.edu.au> Mime-Version: 1.0 Date: Tue, 10 Oct 1995 19:00:46 GMT