Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c    |    Meh, in C you gotta define EVERYTHING    |    243,242 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 242,575 of 243,242    |
|    Keith Thompson to Kalevi Kolttonen    |
|    Re: 8 bit cpu    |
|    23 Dec 25 19:35:03    |
   
   From: Keith.S.Thompson+u@gmail.com   
      
   kalevi@kolttonen.fi (Kalevi Kolttonen) writes:   
   [...]   
   > I do not know whether C standards permit 8-bit ints,   
      
   It does not. C (up to C17) requires INT_MIN to be -32767 or lower,   
   and INT_MAX to be +32767 or higher. (C23 changes the requirement   
   for INT_MIN from -32767 to -32768, and mandates 2's-complement for   
   signed integer types.)   
      
   > but   
   > cc65 is a real-world 6502 C cross-compiler available straight   
   > from the standard repositories on Fedora Linux 43 and FreeBSD 15.   
   >   
   > We can install cc65 and VICE emulator to do a simple test:   
   [...]   
      
   I have cc65 on my Ubuntu system. Here's how I demonstrated the same   
   thing (that sizeof (int) is 2):   
      
   $ cat c.c   
   int SIZEOF_INT = sizeof (int);   
   $ cc65 c.c   
   $ cat c.s   
      
   File generated by cc65 v 2.18 - Ubuntu 2.19-1   
      
    .fopt compiler,"cc65 v 2.18 - Ubuntu 2.19-1"   
    .setcpu "6502"   
   [7 lines deleted]   
    .export _SIZEOF_INT   
      
   .segment "DATA"   
      
   _SIZEOF_INT:   
    .word $0002   
      
   $   
      
   --   
   Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com   
   void Void(void) { Void(); } /* The recursive call of the void */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca