reading legacy floppy disks

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sun Sep 10 03:33:58 UTC 2006


On 9/8/06, Lennart Sorensen <lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> wrote:
> On Thu, Sep 07, 2006 at 07:27:42AM -0400, James Knott wrote:
> > You're lucky.  When I took Fortran, BASIC and Pascal courses there, back
> > in the mid '80s, we couldn't even use floppies.  We used an IBM
> > mainframe there and the only way to get the code out, was via print out
> > or dial up access.
> >
> > When I took C at George Brown College in 1995, we could use 3.5"
> > floppies.  However, in class we used Turbo C on Windows 3.1, while at
> > home I used Borland C on OS/2, so I had to be careful about variable
> > sizes.  For example an int was 16 bits in Borland C, but only 8 in
> > Turbo.  On occasion, my code would work fine at home, but crap out in
> > class because I'd overflowed a variable.
>
> Don't 8 bit integers violate the C standard?  I thought it required
> integer to be at least 16 bits.

On a PIC, they could almost certainly be 8 bits :-)

The sizes of char/short/int/long are not required to be any particular
size in the standard.  If memory serves, the relationship needs to
hold that:

  sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long)

But having 8 bit ints *is* consistent with...

    8 <= 8 <= 8 <= 16

There used to be weirder platforms out there, such as systems with 12
bit registers, as well as Crays, where, if memory serves, the
relationship was more like...

   64 <= 64 <= 64 <= 64

(e.g. - a char was 64 bits long)

Having an int 8 bits wide strikes me as being troublesome, for
practical reasons, but it doesn't forcibly have to be nonstandard :-).
-- 
http://www3.sympatico.ca/cbbrowne/linux.html
Oddly enough, this is completely standard behaviour for shells. This
is a roundabout way of saying `don't use combined chains of `&&'s and
`||'s unless you think Gödel's theorem is for sissies'.
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wini/Mailing_lists





More information about the Legacy mailing list