• Re: RP2350 and Pico 2 - things missing

    From The Natural Philosopher@3:770/3 to Ahem A Rivet's Shot on Fri Aug 23 13:38:30 2024
    On 23/08/2024 11:12, Ahem A Rivet's Shot wrote:
    On Fri, 23 Aug 2024 10:17:56 +0100
    The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 22/08/2024 11:57, Ahem A Rivet's Shot wrote:
    On Thu, 22 Aug 2024 11:00:26 +0100

    I don't recall them ever appearing in C source. They are not part of the
    C language.

    No they are not - but they did appear as extensions in every
    8086/80286 compiler I ever used.

    Dint appea as extensions in ANY of the ones I used. You compiled for
    small model or for large model.
    Small model couldnt exceed 64k program space

    AIR you could compile for 'small model' or 'large model'

    There were several models available (tiny had one segment shared for code and data, small had separate code and data then there were mixed small code large data and vice versa). These set the memory mapping and the
    default sizes of pointers but the near and far keywords could override
    those defaults in some models.

    Not in any compiler I used.


    It was *horrible*, the 80386 was a breath of fresh air.

    I'll grant you that.


    --
    "Strange as it seems, no amount of learning can cure stupidity, and
    higher education positively fortifies it."

    - Stephen Vizinczey

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to The Natural Philosopher on Fri Aug 23 14:15:33 2024
    On 23/08/2024 13:38, The Natural Philosopher wrote:
    Not in any compiler I used.

    It was in 16bit MS C Compiler, Watcom C, Borland C, Zorland/Zortech
    C/C++. In fact the availability of memory models exceeding small and
    large was a desirability of 8086 compilers. Such large code small data,
    small code, large data and huge (large code and large data). In fact the
    legacy of NEAR and FAR keywords lived on for a long time.

    Certainly MS Visual Studio 2019 includes header files for code designed
    for Windows (windef.h) with the following legacy definitions still:

    #ifndef pascal
    #define pascal __ONLY_IN_WINELIB(__stdcall)
    #endif
    #ifndef _pascal
    #define _pascal __ONLY_IN_WINELIB(__stdcall)
    #endif
    #ifndef __export
    #define __export __ONLY_IN_WINELIB(__stdcall)
    #endif
    #ifndef near
    #define near __ONLY_IN_WINELIB(/* nothing */)
    #endif
    #ifndef far
    #define far __ONLY_IN_WINELIB(/* nothing */)
    #endif
    #ifndef _near
    #define _near __ONLY_IN_WINELIB(/* nothing */)
    #endif
    #ifndef _far
    #define _far __ONLY_IN_WINELIB(/* nothing */)
    #endif
    #ifndef NEAR
    #define NEAR __ONLY_IN_WINELIB(/* nothing */)
    #endif
    #ifndef FAR
    #define FAR __ONLY_IN_WINELIB(/* nothing */)
    #endif

    Segment registers still exist on x86-64 CPUS.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to none@invalid.com on Fri Aug 23 14:51:39 2024
    On Fri, 23 Aug 2024 14:15:33 +0100
    mm0fmf <none@invalid.com> wrote:

    On 23/08/2024 13:38, The Natural Philosopher wrote:
    Not in any compiler I used.

    It was in 16bit MS C Compiler, Watcom C, Borland C, Zorland/Zortech
    C/C++.

    Also Lattice C and the compiler in XENIX-286.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Charlie Gibbs@3:770/3 to Ahem A Rivet's Shot on Fri Aug 23 17:49:42 2024
    On 2024-08-23, Ahem A Rivet's Shot <steveo@eircom.net> wrote:

    On Fri, 23 Aug 2024 10:17:56 +0100
    The Natural Philosopher <tnp@invalid.invalid> wrote:

    I don't recall them ever appearing in C source. They are not part of the
    C language.

    No they are not - but they did appear as extensions in every
    8086/80286 compiler I ever used.

    AIR you could compile for 'small model' or 'large model'

    There were several models available (tiny had one segment shared for code and data, small had separate code and data then there were mixed small code large data and vice versa). These set the memory mapping and the
    default sizes of pointers but the near and far keywords could override
    those defaults in some models.

    It was *horrible*, the 80386 was a breath of fresh air.

    Not if you were stuck programming for MS-DOS or Windows, unfortunately.

    --
    /~\ Charlie Gibbs | We'll go down in history as the
    \ / <cgibbs@kltpzyxm.invalid> | first society that wouldn't save
    X I'm really at ac.dekanfrus | itself because it wasn't cost-
    / \ if you read it the right way. | effective. -- Kurt Vonnegut

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to Charlie Gibbs on Fri Aug 23 19:14:43 2024
    On Fri, 23 Aug 2024 17:49:42 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:

    Not if you were stuck programming for MS-DOS or Windows, unfortunately.

    I briefly programmed for MS-DOS at the same time as XENIX but I
    have managed to avoid ever writing anything for Windows - I've almost
    managed to avoid ever having to even use Windows but Dell scupppered that record by buying a PPOE, putting the B in org and making us all use Dells running Windows - so I left.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to Ahem A Rivet's Shot on Sat Aug 24 07:31:32 2024
    On Fri, 23 Aug 2024 11:12:41 +0100, Ahem A Rivet's Shot wrote:

    It was *horrible*, the 80386 was a breath of fresh air.

    Sure it was. Except it was only giving the Intel market what the users of
    other CPUs (Motorola, NatSemi) had been enjoying for years.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to Lawrence D'Oliveiro on Sat Aug 24 09:13:56 2024
    On Sat, 24 Aug 2024 07:31:32 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

    On Fri, 23 Aug 2024 11:12:41 +0100, Ahem A Rivet's Shot wrote:

    It was *horrible*, the 80386 was a breath of fresh air.

    Sure it was. Except it was only giving the Intel market what the users of other CPUs (Motorola, NatSemi) had been enjoying for years.

    Sure there's always plenty of fresh air in the fields but this was
    in the sewer.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to Ahem A Rivet's Shot on Sat Aug 24 10:48:26 2024
    On 23/08/2024 19:14, Ahem A Rivet's Shot wrote:
    On Fri, 23 Aug 2024 17:49:42 GMT
    Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:

    Not if you were stuck programming for MS-DOS or Windows, unfortunately.

    I briefly programmed for MS-DOS at the same time as XENIX but I
    have managed to avoid ever writing anything for Windows - I've almost
    managed to avoid ever having to even use Windows but Dell scupppered that record by buying a PPOE, putting the B in org and making us all use Dells running Windows - so I left.


    You are lucky. Sadly my employers have customers (mainly in Asia) that
    insist we provide the same software for both Linux and Windows. Quite
    often we have issues making stuff as reliable on Windows as on Linux and
    then we find that the customers ran up the Windows version once to check
    it worked and then use the Linux versions. But they *must* have a
    Windows version. And now we have the clusterfuck that is Win11 and lots
    and lots of stuff that no longer works and driver signing issues and....
    Still it keeps me fed and off the streets.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to All on Mon Aug 26 02:42:06 2024
    On Sat, 24 Aug 2024 10:48:26 +0100, mm0fmf wrote:

    Sadly my employers have customers (mainly in Asia) that
    insist we provide the same software for both Linux and Windows. Quite
    often we have issues making stuff as reliable on Windows as on Linux and
    then we find that the customers ran up the Windows version once to check
    it worked and then use the Linux versions. But they *must* have a
    Windows version.

    I don’t see why that should be “sad”. I would describe it as a “revenue opportunity” ...

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to Ahem A Rivet's Shot on Mon Aug 26 02:43:11 2024
    On Sat, 24 Aug 2024 09:13:56 +0100, Ahem A Rivet's Shot wrote:

    On Sat, 24 Aug 2024 07:31:32 -0000 (UTC) Lawrence D'Oliveiro
    <ldo@nz.invalid> wrote:

    On Fri, 23 Aug 2024 11:12:41 +0100, Ahem A Rivet's Shot wrote:

    It was *horrible*, the 80386 was a breath of fresh air.

    Sure it was. Except it was only giving the Intel market what the users
    of other CPUs (Motorola, NatSemi) had been enjoying for years.

    Sure there's always plenty of fresh air in the fields but this was
    in the sewer.

    And then it took the Windows/DOS world about another decade to transition
    to properly 32-bit APIs.

    And there it seems to have got stuck: even on today’s 64-bit machines, Windows programs still use “Win32”.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to Lawrence D'Oliveiro on Mon Aug 26 15:06:52 2024
    On 26/08/2024 03:43, Lawrence D'Oliveiro wrote:
    Windows programs still use “Win32”.

    Win32 is the name of the API.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to All on Tue Aug 27 04:31:29 2024
    On Mon, 26 Aug 2024 15:06:52 +0100, mm0fmf wrote:

    On 26/08/2024 03:43, Lawrence D'Oliveiro wrote:

    Windows programs still use “Win32”.

    Win32 is the name of the API.

    Why is it not “Win64”?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to Lawrence D'Oliveiro on Tue Aug 27 08:36:18 2024
    On 27/08/2024 05:31, Lawrence D'Oliveiro wrote:
    On Mon, 26 Aug 2024 15:06:52 +0100, mm0fmf wrote:

    On 26/08/2024 03:43, Lawrence D'Oliveiro wrote:

    Windows programs still use “Win32”.

    Win32 is the name of the API.

    Why is it not “Win64”?

    The 64bit version is the same API compiled for 64bit instead of 32bit.

    IIRC Win32 API first appeared 30 years ago and the name stuck as it differentiated it from other APIs. Now there are no new 32bit Windows
    versions on sale the name quietly changed in MS docs to Windows API.

    If you say Win32 to people who develop for Windows then they know what
    you mean.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to All on Tue Aug 27 23:30:19 2024
    On Tue, 27 Aug 2024 08:36:18 +0100, mm0fmf wrote:

    On 27/08/2024 05:31, Lawrence D'Oliveiro wrote:
    On Mon, 26 Aug 2024 15:06:52 +0100, mm0fmf wrote:

    On 26/08/2024 03:43, Lawrence D'Oliveiro wrote:

    Windows programs still use “Win32”.

    Win32 is the name of the API.

    Why is it not “Win64”?

    The 64bit version is the same API compiled for 64bit instead of 32bit.

    That’s the trouble. It hasn’t really adapted to the availability as standard of 64-bit integers, for example.

    Compare the POSIX APIs, where they were careful to use generic types like “size_t” and “time_t”, so that the same code could be compiled, unchanged,
    to work on both 32-bit and 64-bit architectures. Not something Windows
    code can manage.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to All on Wed Aug 28 21:29:03 2024
    T24gMjgvMDgvMjAyNCAwMDozMCwgTGF3cmVuY2UgRCdPbGl2ZWlybyB3cm90ZToNCj4gT24g VHVlLCAyNyBBdWcgMjAyNCAwODozNjoxOCArMDEwMCwgbW0wZm1mIHdyb3RlOg0KPiANCj4+ IE9uIDI3LzA4LzIwMjQgMDU6MzEsIExhd3JlbmNlIEQnT2xpdmVpcm8gd3JvdGU6DQo+Pj4g T24gTW9uLCAyNiBBdWcgMjAyNCAxNTowNjo1MiArMDEwMCwgbW0wZm1mIHdyb3RlOg0KPj4+ PiBXaW4zMiBpcyB0aGUgbmFtZSBvZiB0aGUgQVBJLg0KPj4+DQo+Pj4gV2h5IGlzIGl0IG5v dCDigJxXaW42NOKAnT8NCj4+DQo+PiBUaGUgNjRiaXQgdmVyc2lvbiBpcyB0aGUgc2FtZSBB UEkgY29tcGlsZWQgZm9yIDY0Yml0IGluc3RlYWQgb2YgMzJiaXQuDQo+IA0KPiBUaGF04oCZ cyB0aGUgdHJvdWJsZS4gSXQgaGFzbuKAmXQgcmVhbGx5IGFkYXB0ZWQgdG8gdGhlIGF2YWls YWJpbGl0eSBhcw0KPiBzdGFuZGFyZCBvZiA2NC1iaXQgaW50ZWdlcnMsIGZvciBleGFtcGxl Lg0KPiANCj4gQ29tcGFyZSB0aGUgUE9TSVggQVBJcywgd2hlcmUgdGhleSB3ZXJlIGNhcmVm dWwgdG8gdXNlIGdlbmVyaWMgdHlwZXMgbGlrZQ0KPiDigJxzaXplX3TigJ0gYW5kIOKAnHRp bWVfdOKAnSwgc28gdGhhdCB0aGUgc2FtZSBjb2RlIGNvdWxkIGJlIGNvbXBpbGVkLCB1bmNo YW5nZWQsDQo+IHRvIHdvcmsgb24gYm90aCAzMi1iaXQgYW5kIDY0LWJpdCBhcmNoaXRlY3R1 cmVzLiBOb3Qgc29tZXRoaW5nIFdpbmRvd3MNCj4gY29kZSBjYW4gbWFuYWdlLg0KDQpZb3Ug Y2FuIGRvIHRoaXMgb24gV2luZG93cyB0b28sIGJ1dCB0aGV5IGhhZCB0byBiYXN0YXJkaXNl IHRoZWlyIEMgDQpjb21waWxlciBmb3IgcGVvcGxlIHRoYXQgaGFkbid0LiBJdCdzIHRoZSBv bmx5IG9uZSB0aGF0IG9uIGEgNjQgYml0IA0KcGxhdGZvcm0gdGhhdCBoYXMgbG9uZyBhcyAz MiBiaXRzLg0KDQpXaW5kb3dzOi0NCg0KaW50PTMyIGJpdHMsIGxvbmc9MzIgYml0cywgbG9u ZyBsb25nPTY0IGJpdHMNCg0KRXZlcnlvbmUgZWxzZSBpbiB0aGUgYmxvb2R5IHdvcmxkOi0N Cg0KaW50PTMyIGJpdHMsIGxvbmc9NjQgYml0cywgbG9uZyBsb25nPTY0IGJpdHMNCg0KLS0t ZHJ1Y2sNCg0K

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to druck on Wed Aug 28 23:59:42 2024
    On 28/08/2024 21:29, druck wrote:
    On 28/08/2024 00:30, Lawrence D'Oliveiro wrote:
    On Tue, 27 Aug 2024 08:36:18 +0100, mm0fmf wrote:

    On 27/08/2024 05:31, Lawrence D'Oliveiro wrote:
    On Mon, 26 Aug 2024 15:06:52 +0100, mm0fmf wrote:
    Win32 is the name of the API.

    Why is it not “Win64”?

    The 64bit version is the same API compiled for 64bit instead of 32bit.

    That’s the trouble. It hasn’t really adapted to the availability as
    standard of 64-bit integers, for example.

    Compare the POSIX APIs, where they were careful to use generic types like
    “size_t” and “time_t”, so that the same code could be compiled,
    unchanged,
    to work on both 32-bit and 64-bit architectures. Not something Windows
    code can manage.

    You can do this on Windows too, but they had to bastardise their C
    compiler for people that hadn't. It's the only one that on a 64 bit
    platform that has long as 32 bits.

    Windows:-

    int=32 bits, long=32 bits, long long=64 bits

    Everyone else in the bloody world:-

    int=32 bits, long=64 bits, long long=64 bits

    ---druck


    The original PDP on which C was written had int 16 bits and long 32 bits
    K & R specifically said that no size should be inferred for int. It was
    the length of a native word on the machines


    --
    "The great thing about Glasgow is that if there's a nuclear attack it'll
    look exactly the same afterwards."

    Billy Connolly

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Richard Kettlewell@3:770/3 to druck on Thu Aug 29 09:32:49 2024
    druck <news@druck.org.uk> writes:
    You can do this on Windows too, but they had to bastardise their C
    compiler for people that hadn't. It's the only one that on a 64 bit
    platform that has long as 32 bits.

    Windows:-

    int=32 bits, long=32 bits, long long=64 bits

    Everyone else in the bloody world:-

    (Almost everyone; Cray had 64-bit int.)

    int=32 bits, long=64 bits, long long=64 bits

    THe Windows approach is well within what the C language spec allows, and simplified the adaptation of existing Windows application code to 64-bit platforms. The equivalent exercise in Linux needed attention to anything
    that made (sometimes invisible) assumptions about the definition of
    long.

    I don’t think I’d fault either decision though the fact that we’ve ended up with two conventions does make writing/maintaining portable code a
    bit more annoying, though not really any more so than the slightly
    different set of things compilers warn about or the lack of GCC
    compatibility from MSVC. I think MS should bow the inevitable and
    replace cl with Clang.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to Ahem A Rivet's Shot on Thu Aug 29 10:41:55 2024
    On 29/08/2024 10:28, Ahem A Rivet's Shot wrote:
    On Thu, 29 Aug 2024 09:32:49 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    I don’t think I’d fault either decision though the fact that we’ve ended
    up with two conventions does make writing/maintaining portable code a
    bit more annoying,

    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    There are always the int<n>_t types for when size matters.


    Yes, from what I remember of the 90s, Microsoft code used typedefs,
    Int32, Int64 or maybe even Macros for types. Big projects sometimes used
    their own typedefs. I never liked it. I used int and long, but I
    recognised my code was suboptimal.

    Then I moved to Csharp and Java and stop worrying :-).

    C was shit, for not making types explicit, subsequent OS software
    developers were just polishing the turd.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to Richard Kettlewell on Thu Aug 29 10:28:39 2024
    On Thu, 29 Aug 2024 09:32:49 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    I don’t think I’d fault either decision though the fact that we’ve ended
    up with two conventions does make writing/maintaining portable code a
    bit more annoying,

    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    There are always the int<n>_t types for when size matters.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Richard Kettlewell on Thu Aug 29 13:09:36 2024
    On 29/08/2024 09:32, Richard Kettlewell wrote:
    druck <news@druck.org.uk> writes:
    You can do this on Windows too, but they had to bastardise their C
    compiler for people that hadn't. It's the only one that on a 64 bit
    platform that has long as 32 bits.

    Windows:-

    int=32 bits, long=32 bits, long long=64 bits

    Everyone else in the bloody world:-

    (Almost everyone; Cray had 64-bit int.)

    int=32 bits, long=64 bits, long long=64 bits

    THe Windows approach is well within what the C language spec allows, and simplified the adaptation of existing Windows application code to 64-bit platforms. The equivalent exercise in Linux needed attention to anything
    that made (sometimes invisible) assumptions about the definition of
    long.

    I don’t think I’d fault either decision though the fact that we’ve ended
    up with two conventions does make writing/maintaining portable code a
    bit more annoying, though not really any more so than the slightly
    different set of things compilers warn about or the lack of GCC
    compatibility from MSVC. I think MS should bow the inevitable and
    replace cl with Clang.

    Most code that cares seems to use things like int_32 or long_64 where it matters and macro expand that on a per target hardware basis

    --
    Climate Change: Socialism wearing a lab coat.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Richard Kettlewell@3:770/3 to Ahem A Rivet's Shot on Thu Aug 29 13:43:11 2024
    Ahem A Rivet's Shot <steveo@eircom.net> writes:
    Richard Kettlewell <invalid@invalid.invalid> wrote:
    I don’t think I’d fault either decision though the fact that we’ve
    ended up with two conventions does make writing/maintaining portable
    code a bit more annoying, though not really any more so than the slightly
    different set of things compilers warn about or the lack of GCC
    compatibility from MSVC. I think MS should bow the inevitable and
    replace cl with Clang.

    Portable code should only rely on the standards not implementations,
    some very weird possibilities are legal within the standard.

    There are always the int<n>_t types for when size matters.

    Life is not always that simple and declaring how things ‘should’ be does not fix a single line of code.

    One of the public APIs we support largely uses ‘long’ and ‘unsigned long’ for integral values, which causes occasional issues with our cross-platform code. For example ‘unsigned long’ has the same size as ‘size_t’ on Linux, but not on 64-bit Windows.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to Richard Kettlewell on Thu Aug 29 14:05:19 2024
    On Thu, 29 Aug 2024 13:43:11 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    Ahem A Rivet's Shot <steveo@eircom.net> writes:

    There are always the int<n>_t types for when size matters.

    Life is not always that simple and declaring how things ‘should’ be does not fix a single line of code.

    Very true - horse, water, drink.

    One of the public APIs we support largely uses ‘long’ and ‘unsigned long’ for integral values, which causes occasional issues with our cross-platform code. For example ‘unsigned long’ has the same size as ‘size_t’ on Linux, but not on 64-bit Windows.

    Which is why putting assigning the value of a size_t to an unsigned long or vice-versa is wrong. But hey early C programmers used to store
    pointers in ints (there's a moan about it in first edition K&R *that*
    early).

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Richard Kettlewell@3:770/3 to Ahem A Rivet's Shot on Thu Aug 29 16:13:42 2024
    Ahem A Rivet's Shot <steveo@eircom.net> writes:
    Richard Kettlewell <invalid@invalid.invalid> wrote:
    Ahem A Rivet's Shot <steveo@eircom.net> writes:
    There are always the int<n>_t types for when size matters.

    Life is not always that simple and declaring how things ‘should’ be
    does not fix a single line of code.

    Very true - horse, water, drink.

    One of the public APIs we support largely uses ‘long’ and ‘unsigned
    long’ for integral values, which causes occasional issues with our
    cross-platform code. For example ‘unsigned long’ has the same size as
    ‘size_t’ on Linux, but not on 64-bit Windows.

    Which is why putting assigning the value of a size_t to an unsigned
    long or vice-versa is wrong.

    No, it’s not necessarily wrong. If the value fits in the destination
    type there’s nothing wrong with it. The results are well-defined and do
    not change the value. You can look up the rules in the C standard.

    The common case (for users of this API) is passing the size of a
    relatively small object, of fixed size. There is no practical issue
    there. The less common case is where the value is unknown at compile
    time, meaning an extra check and an explicit conversion are needed. It’s
    not remotely difficult to deal with, it’s just an annoyance (as I
    previously wrote).

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to Richard Kettlewell on Thu Aug 29 17:22:39 2024
    On Thu, 29 Aug 2024 16:13:42 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    No, it’s not necessarily wrong. If the value fits in the destination
    type there’s nothing wrong with it. The results are well-defined and do
    not change the value. You can look up the rules in the C standard.

    What is wrong is making assumptions about the relative size of long
    and size_t - AFAIK the standard makes no guarantees about that. Note that
    it's only "wrong" if you care about portability - long experience suggests
    that not caring about portability is a good way to get bitten on the arse.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From John Aldridge@3:770/3 to All on Thu Aug 29 18:57:57 2024
    In article <20240829102839.5bb67af25e568ebabc65ede6@eircom.net>, steveo@eircom.net says...

    On Thu, 29 Aug 2024 09:32:49 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    I don?t think I?d fault either decision though the fact that we?ve ended
    up with two conventions does make writing/maintaining portable code a
    bit more annoying,

    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    Heh, yes. I worked for several years on a machine where a null pointer
    wasn't all bits zero, and where char* was a different size to any other pointer.

    --
    John

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Ahem A Rivet's Shot on Thu Aug 29 20:12:04 2024
    On 29/08/2024 19:13, Ahem A Rivet's Shot wrote:
    On Thu, 29 Aug 2024 18:57:57 +0100
    John Aldridge <jpsa@cantab.net> wrote:

    In article <20240829102839.5bb67af25e568ebabc65ede6@eircom.net>,
    steveo@eircom.net says...

    On Thu, 29 Aug 2024 09:32:49 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    I don?t think I?d fault either decision though the fact that we?ve
    ended up with two conventions does make writing/maintaining portable
    code a bit more annoying,

    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    Heh, yes. I worked for several years on a machine where a null pointer
    wasn't all bits zero, and where char* was a different size to any other
    pointer.

    That rings vague bells, what was it ?

    24 bit pointers were I think quite common, but isn't the 'null pointer' *defined* to be
    (Char *)0 ?
    Otherwise how could you test for it?

    --
    Canada is all right really, though not for the whole weekend.

    "Saki"

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to John Aldridge on Thu Aug 29 19:13:34 2024
    On Thu, 29 Aug 2024 18:57:57 +0100
    John Aldridge <jpsa@cantab.net> wrote:

    In article <20240829102839.5bb67af25e568ebabc65ede6@eircom.net>, steveo@eircom.net says...

    On Thu, 29 Aug 2024 09:32:49 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    I don?t think I?d fault either decision though the fact that we?ve
    ended up with two conventions does make writing/maintaining portable
    code a bit more annoying,

    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the standard.

    Heh, yes. I worked for several years on a machine where a null pointer
    wasn't all bits zero, and where char* was a different size to any other pointer.

    That rings vague bells, what was it ?

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Richard Kettlewell@3:770/3 to Ahem A Rivet's Shot on Thu Aug 29 20:33:02 2024
    Ahem A Rivet's Shot <steveo@eircom.net> writes:
    Richard Kettlewell <invalid@invalid.invalid> wrote:
    No, it’s not necessarily wrong. If the value fits in the destination
    type there’s nothing wrong with it. The results are well-defined and do
    not change the value. You can look up the rules in the C standard.

    What is wrong is making assumptions about the relative size of long
    and size_t - AFAIK the standard makes no guarantees about that.

    Nobody is making any such assumption here. Everyone involved knows
    perfectly well that size_t could be a different size to long.

    Note that it's only "wrong" if you care about portability - long
    experience suggests that not caring about portability is a good way to
    get bitten on the arse.

    The API in question is essentially fixed in this respect. Changing these details would break all the applications that the API supports. We just
    have to live with its infelicities regardless of how much anyone
    involved may care about portability.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Richard Kettlewell@3:770/3 to The Natural Philosopher on Thu Aug 29 20:26:45 2024
    The Natural Philosopher <tnp@invalid.invalid> writes:
    24 bit pointers were I think quite common, but isn't the 'null
    pointer' *defined* to be (Char *)0 ?
    Otherwise how could you test for it?

    The null pointer you get from (char *)0 (or similar constructions)
    doesn’t have to be all bits 0.

    https://c-faq.com/null/index.html

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to The Natural Philosopher on Thu Aug 29 21:33:28 2024
    On 29/08/2024 13:09, The Natural Philosopher wrote:
    Most code that cares seems to use things like int_32 or long_64 where it matters and macro expand that on a per target hardware basis

    Yes stdint.h is your friend

    ---druck

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From crn@3:770/3 to Richard Kettlewell on Fri Aug 30 01:13:30 2024
    On 2024-08-29, Richard Kettlewell <invalid@invalid.invalid> wrote:

    There are always the int<n>_t types for when size matters.

    Life is not always that simple and declaring how things ‘should’ be does not fix a single line of code.

    What a mess - Much simpler on Fortran, you just need to remember
    which variable name spellings are floats.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Gerhard Hoffmann@3:770/3 to All on Fri Aug 30 03:40:24 2024
    Am 30.08.24 um 03:13 schrieb crn:
    On 2024-08-29, Richard Kettlewell <invalid@invalid.invalid> wrote:

    There are always the int<n>_t types for when size matters.

    Life is not always that simple and declaring how things ‘should’ be does >> not fix a single line of code.

    What a mess - Much simpler on Fortran, you just need to remember
    which variable name spellings are floats.

    GOD is real unless declared integer.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Richard Kettlewell on Fri Aug 30 12:11:45 2024
    On 29/08/2024 20:26, Richard Kettlewell wrote:
    The Natural Philosopher <tnp@invalid.invalid> writes:
    24 bit pointers were I think quite common, but isn't the 'null
    pointer' *defined* to be (Char *)0 ?
    Otherwise how could you test for it?

    The null pointer you get from (char *)0 (or similar constructions)
    doesn’t have to be all bits 0.

    https://c-faq.com/null/index.html

    Ah, thanks.

    Hadn't apprecaied the level of mapping going on during compilation.



    --
    In theory, there is no difference between theory and practice.
    In practice, there is.
    -- Yogi Berra

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From John Aldridge@3:770/3 to All on Fri Aug 30 14:28:06 2024
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>, steveo@eircom.net says...
    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the standard.

    Heh, yes. I worked for several years on a machine where a null pointer wasn't all bits zero, and where char* was a different size to any other pointer.

    That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    --
    John

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to John Aldridge on Fri Aug 30 14:40:30 2024
    On Fri, 30 Aug 2024 14:28:06 +0100
    John Aldridge <jpsa@cantab.net> wrote:

    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>, steveo@eircom.net says...
    Portable code should only rely on the standards not implementations, some very weird possibilities are legal within the standard.

    Heh, yes. I worked for several years on a machine where a null
    pointer wasn't all bits zero, and where char* was a different size to
    any other pointer.

    That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    Thank you, that was indeed the bell it rang. I only heard about it, never met it.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to All on Fri Aug 30 15:45:25 2024
    On 30/08/2024 15:39, mm0fmf wrote:
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>,
    steveo@eircom.net says...
        Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    Heh, yes. I worked for several years on a machine where a null pointer >>>> wasn't all bits zero, and where char* was a different size to any other >>>> pointer.

        That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC and
    some Fortran. It seemed quite fast at the time in timeshare mode with
    plenty of undergrads using it. But the CPU was only as fast as an 8MHz
    68000!

    That is the staggering thing. CPU performance in the mini era wasn't
    that hot at all.

    I see someone has made a Pi PICO emulate a range of 6502 based computers
    - apple II etc.

    I am fairly sure a PI Zero could outperform a 386 running SCO Unix...and
    that was pretty comparable with - if not better than - a PDP 11.


    --
    “There are two ways to be fooled. One is to believe what isn’t true; the other is to refuse to believe what is true.”

    —Soren Kierkegaard

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to John Aldridge on Fri Aug 30 15:39:26 2024
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>, steveo@eircom.net says...
    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    Heh, yes. I worked for several years on a machine where a null pointer
    wasn't all bits zero, and where char* was a different size to any other
    pointer.

    That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC and
    some Fortran. It seemed quite fast at the time in timeshare mode with
    plenty of undergrads using it. But the CPU was only as fast as an 8MHz
    68000!

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to The Natural Philosopher on Fri Aug 30 16:20:51 2024
    On 30/08/2024 15:45, The Natural Philosopher wrote:
    On 30/08/2024 15:39, mm0fmf wrote:
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>,
    steveo@eircom.net says...
        Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the >>>>>> standard.

    Heh, yes. I worked for several years on a machine where a null pointer >>>>> wasn't all bits zero, and where char* was a different size to any
    other
    pointer.

        That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC and
    some Fortran. It seemed quite fast at the time in timeshare mode with
    plenty of undergrads using it. But the CPU was only as fast as an 8MHz
    68000!

    That is the staggering thing. CPU performance in the mini era wasn't
    that hot at all.

    I see someone has made a Pi PICO emulate a range of 6502 based computers
    - apple II etc.

    I am fairly sure a PI Zero could outperform a 386 running SCO Unix...and
    that was pretty comparable with - if not better than - a PDP 11.



    The 386 slaughtered most of the Unix Minis of the time.

    The PDP 11 was already a legacy predecessor of the Vax, did they even
    have demand paging? PDP 11s were around in some of the companies I
    worked for, but they were for the old codger programmers (i.e. 30+).

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to John Aldridge on Fri Aug 30 16:26:18 2024
    On 29/08/2024 18:57, John Aldridge wrote:
    In article <20240829102839.5bb67af25e568ebabc65ede6@eircom.net>, steveo@eircom.net says...

    On Thu, 29 Aug 2024 09:32:49 +0100
    Richard Kettlewell <invalid@invalid.invalid> wrote:

    I don?t think I?d fault either decision though the fact that we?ve ended >>> up with two conventions does make writing/maintaining portable code a
    bit more annoying,

    Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the
    standard.

    Heh, yes. I worked for several years on a machine where a null pointer
    wasn't all bits zero, and where char* was a different size to any other pointer.


    The follow question to the non-zero NULL pointer, is what OS didn't
    protect memory address 0, so you could dereference a NULL pointer
    without a hardware exception?

    I never saw it myself, but we were always cautioned that such an OS
    existed. Maybe it was an old wives' tale?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Gordon Henderson@3:770/3 to none@invalid.com on Fri Aug 30 18:22:29 2024
    In article <vasliu$hgao$1@dont-email.me>, mm0fmf <none@invalid.com> wrote:
    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC and
    some Fortran. It seemed quite fast at the time in timeshare mode with
    plenty of undergrads using it. But the CPU was only as fast as an 8MHz
    68000!

    I used Primes at uni too - starting with the 550 in 1980 but it was
    woefully underpowered for us - I think we might well have been the first
    intake of students who'd already had 1 or 2 years experience of micros
    at school by then (Apple II in my case). I felt that the Apple II could
    have run rings round the Prime. We were doing mostly COBOL, Pascal and
    FORTRAN. Also some assembler.

    Their systems were archaic - we had to write the programs on coding forms,
    it was typed in by "the girls" then submitted to the batch system and
    if we were lucky we'd get it back the following day.

    Eventually they relented and hooked up a room of TTY33s for us to do
    our own edits on.. But really that just made it worse. Upgraded to a
    750 then eventually 9950s but by then it was really too late...

    Fortunately I also found a PDP11/40 tucked away in a little room running Unix...

    Gordon

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to The Natural Philosopher on Fri Aug 30 20:50:11 2024
    On 30/08/2024 15:45, The Natural Philosopher wrote:
    On 30/08/2024 15:39, mm0fmf wrote:
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>,
    steveo@eircom.net says...
        Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the >>>>>> standard.

    Heh, yes. I worked for several years on a machine where a null pointer >>>>> wasn't all bits zero, and where char* was a different size to any
    other
    pointer.

        That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC and
    some Fortran. It seemed quite fast at the time in timeshare mode with
    plenty of undergrads using it. But the CPU was only as fast as an 8MHz
    68000!

    That is the staggering thing. CPU performance in the mini era wasn't
    that hot at all.

    I see someone has made a Pi PICO emulate a range of 6502 based computers
    - apple II etc.

    I am fairly sure a PI Zero could outperform a 386 running SCO Unix...and
    that was pretty comparable with - if not better than - a PDP 11.



    The CPUs may not have had stunning performance but were generally quite
    a bit quicker than the Z80/6502s of the day. The real performance came
    from having disks and ISTR hardware assisted IO. i.e. the CPU didn't
    have to poll or handle IRQs from each UART but there was something
    helping. It's all so long ago now I forget the details. What I do
    remember was it was around 1985 when someone lit the blue touch paper
    and the performance of micros started rocketing. Though if you started
    10 years before me there will have been something that was when
    performance took off for you. I think everyone has some point in their
    memory when things started to go whoosh!

    In 1989 I was writing Z80 assembler to control medical gear. All the
    code took about 45mins to cross assemble and link on a Unix system
    running on a Vax 11/730. In 1990 we got a 25MHz 80386 running DOS and
    the same source took under 3mins to cross assemble and link. The
    bottleneck went from the time to build the code to the time to erase,
    download and burn the EPROMS.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to All on Fri Aug 30 22:53:58 2024
    On 30/08/2024 20:50, mm0fmf wrote:
    On 30/08/2024 15:45, The Natural Philosopher wrote:
    On 30/08/2024 15:39, mm0fmf wrote:
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>,
    steveo@eircom.net says...
        Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the >>>>>>> standard.

    Heh, yes. I worked for several years on a machine where a null
    pointer
    wasn't all bits zero, and where char* was a different size to any
    other
    pointer.

        That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger.

    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC and
    some Fortran. It seemed quite fast at the time in timeshare mode with
    plenty of undergrads using it. But the CPU was only as fast as an
    8MHz 68000!

    That is the staggering thing. CPU performance in the mini era wasn't
    that hot at all.

    I see someone has made a Pi PICO emulate a range of 6502 based
    computers - apple II etc.

    I am fairly sure a PI Zero could outperform a 386 running SCO
    Unix...and that was pretty comparable with - if not better than - a
    PDP 11.



    The CPUs may not have had stunning performance but were generally quite
    a bit quicker than the Z80/6502s of the day. The real performance came
    from having disks and ISTR hardware assisted IO. i.e. the CPU didn't
    have to poll or handle IRQs from each UART but there was something
    helping. It's all so long ago now I forget the details. What I do
    remember was it was around 1985 when someone lit the blue touch paper
    and the performance of micros started rocketing.   Though if you started
    10 years before me there will have been something that was when
    performance took off for you. I think everyone has some point in their
    memory when things started to go whoosh!

    In 1989 I was writing Z80 assembler to control medical gear. All the
    code took about 45mins to cross assemble and link on a Unix system
    running on a Vax 11/730. In 1990 we got a 25MHz 80386 running DOS and
    the same source took under 3mins to cross assemble and link.  The
    bottleneck went from the time to build the code to the time to erase, download and burn the EPROMS.

    Yes. I was writing C and assembler for a 6809 cross complied on a PDP/11.
    We had PCS as serial terminals and text editors.

    Compile was very slow compared to on a PC.

    The thing was that until the 386 Intel CPUs didn't have the big boy
    features. After that they did.

    Even an old IBM mainframe could be emulated under AIX on a PC.
    I did some work on a Vax running Unix too. Better, but still pretty awful

    --
    I would rather have questions that cannot be answered...
    ...than to have answers that cannot be questioned

    Richard Feynman

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Townley@3:770/3 to The Natural Philosopher on Sat Aug 31 00:26:59 2024
    On 30/08/2024 22:53, The Natural Philosopher wrote:
    On 30/08/2024 20:50, mm0fmf wrote:
    On 30/08/2024 15:45, The Natural Philosopher wrote:
    On 30/08/2024 15:39, mm0fmf wrote:
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>,
    steveo@eircom.net says...
        Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within the >>>>>>>> standard.

    Heh, yes. I worked for several years on a machine where a null
    pointer
    wasn't all bits zero, and where char* was a different size to any >>>>>>> other
    pointer.

        That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger. >>>>>
    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC
    and some Fortran. It seemed quite fast at the time in timeshare mode
    with plenty of undergrads using it. But the CPU was only as fast as
    an 8MHz 68000!

    That is the staggering thing. CPU performance in the mini era wasn't
    that hot at all.

    I see someone has made a Pi PICO emulate a range of 6502 based
    computers - apple II etc.

    I am fairly sure a PI Zero could outperform a 386 running SCO
    Unix...and that was pretty comparable with - if not better than - a
    PDP 11.



    The CPUs may not have had stunning performance but were generally
    quite a bit quicker than the Z80/6502s of the day. The real
    performance came from having disks and ISTR hardware assisted IO. i.e.
    the CPU didn't have to poll or handle IRQs from each UART but there
    was something helping. It's all so long ago now I forget the details.
    What I do remember was it was around 1985 when someone lit the blue
    touch paper and the performance of micros started rocketing.   Though
    if you started 10 years before me there will have been something that
    was when performance took off for you. I think everyone has some point
    in their memory when things started to go whoosh!

    In 1989 I was writing Z80 assembler to control medical gear. All the
    code took about 45mins to cross assemble and link on a Unix system
    running on a Vax 11/730. In 1990 we got a 25MHz 80386 running DOS and
    the same source took under 3mins to cross assemble and link.  The
    bottleneck went from the time to build the code to the time to erase,
    download and burn the EPROMS.

    Yes. I was writing C and assembler for a 6809 cross complied on a PDP/11.
    We had PCS as serial terminals and text editors.

    Compile was very slow compared to on a PC.

    The thing was that until the 386 Intel CPUs didn't have the big boy features.  After that they did.

    Even an old IBM mainframe could be emulated under AIX on a PC.
    I did some work on a Vax running Unix too. Better, but still pretty awful


    Vaxen were much better running VMS!

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Chris Townley on Sat Aug 31 09:59:39 2024
    On 31/08/2024 00:26, Chris Townley wrote:
    On 30/08/2024 22:53, The Natural Philosopher wrote:
    On 30/08/2024 20:50, mm0fmf wrote:
    On 30/08/2024 15:45, The Natural Philosopher wrote:
    On 30/08/2024 15:39, mm0fmf wrote:
    On 30/08/2024 14:28, John Aldridge wrote:
    In article <20240829191334.570e88c7507598ffe5b28d87@eircom.net>,
    steveo@eircom.net says...
        Portable code should only rely on the standards not
    implementations, some very weird possibilities are legal within >>>>>>>>> the
    standard.

    Heh, yes. I worked for several years on a machine where a null >>>>>>>> pointer
    wasn't all bits zero, and where char* was a different size to
    any other
    pointer.

        That rings vague bells, what was it ?

    Prime. It was word, not byte, addressed, so a char* had to be bigger. >>>>>>
    I used a Prime750 at Uni. But only undergrad tasks in Prime BASIC
    and some Fortran. It seemed quite fast at the time in timeshare
    mode with plenty of undergrads using it. But the CPU was only as
    fast as an 8MHz 68000!

    That is the staggering thing. CPU performance in the mini era wasn't
    that hot at all.

    I see someone has made a Pi PICO emulate a range of 6502 based
    computers - apple II etc.

    I am fairly sure a PI Zero could outperform a 386 running SCO
    Unix...and that was pretty comparable with - if not better than - a
    PDP 11.



    The CPUs may not have had stunning performance but were generally
    quite a bit quicker than the Z80/6502s of the day. The real
    performance came from having disks and ISTR hardware assisted IO.
    i.e. the CPU didn't have to poll or handle IRQs from each UART but
    there was something helping. It's all so long ago now I forget the
    details. What I do remember was it was around 1985 when someone lit
    the blue touch paper and the performance of micros started
    rocketing.   Though if you started 10 years before me there will have
    been something that was when performance took off for you. I think
    everyone has some point in their memory when things started to go
    whoosh!

    In 1989 I was writing Z80 assembler to control medical gear. All the
    code took about 45mins to cross assemble and link on a Unix system
    running on a Vax 11/730. In 1990 we got a 25MHz 80386 running DOS and
    the same source took under 3mins to cross assemble and link.  The
    bottleneck went from the time to build the code to the time to erase,
    download and burn the EPROMS.

    Yes. I was writing C and assembler for a 6809 cross complied on a PDP/11.
    We had PCS as serial terminals and text editors.

    Compile was very slow compared to on a PC.

    The thing was that until the 386 Intel CPUs didn't have the big boy
    features.  After that they did.

    Even an old IBM mainframe could be emulated under AIX on a PC.
    I did some work on a Vax running Unix too. Better, but still pretty awful


    Vaxen were much better running VMS!

    Were they?
    I dont think they got any faster..

    --
    "Anyone who believes that the laws of physics are mere social
    conventions is invited to try transgressing those conventions from the
    windows of my apartment. (I live on the twenty-first floor.) "

    Alan Sokal

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to druck on Sun Sep 1 07:50:33 2024
    On Thu, 29 Aug 2024 21:33:28 +0100, druck wrote:

    Yes stdint.h is your friend

    Unless you have an elderly code base that still hasn’t caught up with
    C99 ...

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to druck on Sun Sep 1 07:49:37 2024
    On Wed, 28 Aug 2024 21:29:03 +0100, druck wrote:

    On 28/08/2024 00:30, Lawrence D'Oliveiro wrote:

    Compare the POSIX APIs, where they were careful to use generic types
    like “size_t” and “time_t”, so that the same code could be compiled, >> unchanged, to work on both 32-bit and 64-bit architectures. Not
    something Windows code can manage.

    You can do this on Windows too, but they had to bastardise their C
    compiler for people that hadn't. It's the only one that on a 64 bit
    platform that has long as 32 bits.

    I know. This is why you have “LP64” (long and pointers both 64-bits)
    versus “LLP64” (only long long and pointers are 64 bits, long is still 32 bits). I think LP64 is pretty much universal outside the Windows world.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to Pancho on Sun Sep 1 07:51:44 2024
    On Thu, 29 Aug 2024 10:41:55 +0100, Pancho wrote:

    C was shit, for not making types explicit ...

    Back then, there were still machines with word lengths like 12, 18, 24, 36
    bits and even 60 bits.

    Not byte-addressable, of course.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to Lawrence D'Oliveiro on Sun Sep 1 11:07:17 2024
    On 01/09/2024 08:50, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 21:33:28 +0100, druck wrote:

    Yes stdint.h is your friend

    Unless you have an elderly code base that still hasn’t caught up with
    C99 ...

    Or you were programming in C on an Analog Devices SHARC were char was 32
    bits.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to none@invalid.com on Sun Sep 1 11:53:14 2024
    On Sun, 1 Sep 2024 11:07:17 +0100
    mm0fmf <none@invalid.com> wrote:

    On 01/09/2024 08:50, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 21:33:28 +0100, druck wrote:

    Yes stdint.h is your friend

    Unless you have an elderly code base that still hasn’t caught up with
    C99 ...

    Or you were programming in C on an Analog Devices SHARC were char was 32 bits.

    I'll bet that broke a lot of bad code :)

    Stll even in that environment a compliant compiler should still
    provide int<n>_t types. They'd probably have to have horrendously
    inefficient implementations not dissimilar to the bitfields in structs but
    they should exist. Woe betide anyone who thought they could put a char into
    an int16_t safely though.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Ahem A Rivet's Shot on Sun Sep 1 13:12:34 2024
    On 01/09/2024 11:53, Ahem A Rivet's Shot wrote:
    On Sun, 1 Sep 2024 11:07:17 +0100
    mm0fmf <none@invalid.com> wrote:

    On 01/09/2024 08:50, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 21:33:28 +0100, druck wrote:

    Yes stdint.h is your friend

    Unless you have an elderly code base that still hasn’t caught up with
    C99 ...

    Or you were programming in C on an Analog Devices SHARC were char was 32
    bits.

    I'll bet that broke a lot of bad code :)

    Stll even in that environment a compliant compiler should still
    provide int<n>_t types. They'd probably have to have horrendously
    inefficient implementations not dissimilar to the bitfields in structs but they should exist. Woe betide anyone who thought they could put a char into an int16_t safely though.


    Ah yes. I was cross compiling C for a 6809 (on a PDP/11) when I
    discovered that to do anything with a char it was promoted into a 16 bit
    int, which on an 8 bit microprocessor results in a shit load of code.

    Needless to say there ended up being a lot of #asm statements..

    --
    Religion is regarded by the common people as true, by the wise as
    foolish, and by the rulers as useful.

    (Seneca the Younger, 65 AD)

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to Ahem A Rivet's Shot on Sun Sep 1 15:47:38 2024
    On 01/09/2024 11:53, Ahem A Rivet's Shot wrote:
    On Sun, 1 Sep 2024 11:07:17 +0100
    mm0fmf <none@invalid.com> wrote:

    On 01/09/2024 08:50, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 21:33:28 +0100, druck wrote:

    Yes stdint.h is your friend

    Unless you have an elderly code base that still hasn’t caught up with
    C99 ...

    Or you were programming in C on an Analog Devices SHARC were char was 32
    bits.

    I'll bet that broke a lot of bad code :)

    Stll even in that environment a compliant compiler should still
    provide int<n>_t types. They'd probably have to have horrendously
    inefficient implementations not dissimilar to the bitfields in structs but they should exist. Woe betide anyone who thought they could put a char into an int16_t safely though.

    ISTR the compiler was a custom version of gcc 1.xx. 26 years ago so the
    exact version has evaporated from my memory. The compiler did understand
    the hardware funnies well, floats were 32bits or 40bits, it understood
    the zero overhead loops and circular buffer support. But all the fixed
    point multiply and accumulate stuff we did in inline assembler. All the performance stuff was in hand optimised assembler as you could do a DMA
    in, integer operation, multiply&accumulate, float operation and a DMA
    out all the in one cycle. There was dual access on chip RAM too, you
    could read and then write the same location in the same clock cycle.

    Careful programming meant you could get quite amazing levels of DSP
    processing run on what was only a 66MHz device.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Single Stage to Orbit@3:770/3 to All on Sun Sep 1 21:36:14 2024
    On Sun, 2024-09-01 at 15:47 +0100, mm0fmf wrote:
    STR the compiler was a custom version of gcc 1.xx. 26 years ago so
    the exact version has evaporated from my memory.

    Your dates are slightly off. These gcc 1.x versions were between 1987 -
    1993. I do remember using 2.7.2.3 with Linux 2.0 in 1997.
    --
    Tactical Nuclear Kittens

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to crn on Mon Sep 2 03:57:07 2024
    On Fri, 30 Aug 2024 01:13:30 -0000 (UTC), crn wrote:

    On 2024-08-29, Richard Kettlewell <invalid@invalid.invalid> wrote:

    There are always the int<n>_t types for when size matters.

    Life is not always that simple and declaring how things ‘should’ be
    does not fix a single line of code.

    What a mess - Much simpler on Fortran, you just need to remember which variable name spellings are floats.

    Which ones are double precision?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to All on Mon Sep 2 04:01:49 2024
    On Sun, 1 Sep 2024 11:07:17 +0100, mm0fmf wrote:

    Or you were programming in C on an Analog Devices SHARC were char was 32 bits.

    I was watching a video clip the other day which talked about the Symbolics
    3600 Lisp Machine from the 1980s. This one had core Lisp constructs like garbage collection and arbitrary-precision integers programmed into its microcode.

    When they came to implement a C compiler, they didn’t bother defining finite-precision integers for it: they just had it use the arbitrary-
    precision ones, since they were already available in the machine
    instruction set. The “sizeof” operator did return small, fixed values for types, but for integers, they were essentially meaningless.

    Somebody wrote a test program to determine how large an integer was, by initializing a variable to 1 and left-shifting it until it overflowed and
    went to zero.

    The program ran for over an hour, exhausted all the available memory, and crashed.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mm0fmf@3:770/3 to Single Stage to Orbit on Mon Sep 2 13:10:38 2024
    On 01/09/2024 21:36, Single Stage to Orbit wrote:
    On Sun, 2024-09-01 at 15:47 +0100, mm0fmf wrote:
    STR the compiler was a custom version of gcc 1.xx. 26 years ago so
    the exact version has evaporated from my memory.

    Your dates are slightly off. These gcc 1.x versions were between 1987 -
    1993. I do remember using 2.7.2.3 with Linux 2.0 in 1997.

    I'd agree that gcc main line release would be around 2.7 in 1998. I can remember I started writing software for a Strongarm based video security
    system in 2001. By then ARM kernels were compiled/cross-compiled with
    gcc 2.95.x. Then gcc 3.0 / 3.1 came out which was better for userland
    code but kernels compiled with it would not run so we stayed with 2.95
    for some time.

    However, the SHARC stuff was definitely derived from gcc 1.x in 1998 as
    it struck me as very old as 2.x had been out for a while by then. This
    was the version of the compiler that ran on Windows. ISTR I used a PII
    200MHz probably running WinNT to develop on. The Unix systems were
    reserved for ADA, Occam and other esoteric stuff ;-)

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Ahem A Rivet's Shot@3:770/3 to none@invalid.com on Mon Sep 2 13:47:24 2024
    On Mon, 2 Sep 2024 13:10:38 +0100
    mm0fmf <none@invalid.com> wrote:

    However, the SHARC stuff was definitely derived from gcc 1.x in 1998 as
    it struck me as very old as 2.x had been out for a while by then.

    I recall that gcc 1.6.3 was considered something of a golden
    version of the original C compiler and IIRC 2.0 brought in a lot of the structure that converted it from the GNU C Compile to the GNU Compiler Collection.

    --
    Steve O'Hara-Smith
    Odds and Ends at http://www.sohara.org/
    For forms of government let fools contest
    Whate're is best administered is best - Alexander Pope

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Kerr-Mudd, John@3:770/3 to The Natural Philosopher on Mon Sep 2 15:43:48 2024
    On Fri, 30 Aug 2024 22:53:58 +0100
    The Natural Philosopher <tnp@invalid.invalid> wrote:

    []

    The thing was that until the 386 Intel CPUs didn't have the big boy
    features. After that they did.

    Even an old IBM mainframe could be emulated under AIX on a PC.


    Just at the cusp there was
    https://en.wikipedia.org/wiki/XT/370

    That ran a style of CP/CMS.

    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Single Stage to Orbit@3:770/3 to All on Mon Sep 2 18:09:07 2024
    On Mon, 2024-09-02 at 13:10 +0100, mm0fmf wrote:
    On 01/09/2024 21:36, Single Stage to Orbit wrote:
    On Sun, 2024-09-01 at 15:47 +0100, mm0fmf wrote:
    STR the compiler was a custom version of gcc 1.xx. 26 years ago
    so the exact version has evaporated from my memory.

    Your dates are slightly off. These gcc 1.x versions were between
    1987 - 1993. I do remember using 2.7.2.3 with Linux 2.0 in 1997.

    I'd agree that gcc main line release would be around 2.7 in 1998. I
    can remember I started writing software for a Strongarm based video
    security system in 2001. By then ARM kernels were compiled/cross-
    compiled with gcc 2.95.x. Then gcc 3.0 / 3.1 came out which was
    better for userland code but kernels compiled with it would not run
    so we stayed with 2.95 for some time.

    Now, this I do definitely do remember. Stuck on 2.95.3 for years for
    the kernel, whilst we were able to use newer compilers just for the
    userspace. Linus kept running into code generation bugs and his rants
    were gold! :-D

    Also the great libc5 / glibc2 switch over which caused me a few
    nightmares :-)

    However, the SHARC stuff was definitely derived from gcc 1.x in 1998
    as it struck me as very old as 2.x had been out for a while by then. 
    This was the version of the compiler that ran on Windows. ISTR I used
    a PII 200MHz probably running WinNT to develop on. The Unix systems
    were reserved for ADA, Occam and other esoteric stuff ;-)

    Yeah, that'd be right. Some people do keep old toolchains around
    because it's the only way to build code for platforms that have gone
    the way of the Dodo.
    --
    Tactical Nuclear Kittens

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to All on Tue Sep 3 00:03:43 2024
    On Mon, 2 Sep 2024 13:10:38 +0100, mm0fmf wrote:

    By then ARM kernels were compiled/cross-compiled with
    gcc 2.95.x. Then gcc 3.0 / 3.1 came out which was better for userland
    code but kernels compiled with it would not run so we stayed with 2.95
    for some time.

    This would have been the time of the great EGCS schism. The GNU people
    (*cough* Stallman *cough*) were being overly control-freaky as per usual,
    so a bunch of GCC contributors forked off the code into a new project
    called “EGCS”. This soon became known for generating better code than the original GCC.

    Eventually the GNU folks realized the error of their ways. Their existing “GCC” project was taken out back and put out of its misery, and the EGCS project took over the “GCC” name.

    I thought this began with GCC 3.0, but according to this <https://gcc.gnu.org/wiki/History#EGCS> it was actually 2.95.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to Pancho on Tue Sep 3 02:22:30 2024
    On Fri, 30 Aug 2024 16:20:51 +0100, Pancho wrote:

    The 386 slaughtered most of the Unix Minis of the time.

    True, but the coming of RISC in 1989 or so completely turned the tables;
    it wasn’t until about 1995 or thereafter that Intel was able to
    successfully fight back.

    The PDP 11 was already a legacy predecessor of the Vax, did they even
    have demand paging?

    No. The entire 64kiB address space was covered by just 8 page table
    entries.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)