Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #395925

Re: 8 bit cpu

Path csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c
Subject Re: 8 bit cpu
Date Tue, 23 Dec 2025 19:35:03 -0800
Organization None to speak of
Lines 41
Message-ID <87cy448sd4.fsf@example.invalid> (permalink)
References <d4h8kk5jltr9t2hqq0m471tlflmnin97ln@4ax.com> <10ifejl$mj2o$1@dont-email.me>
MIME-Version 1.0
Content-Type text/plain
Injection-Date Wed, 24 Dec 2025 03:35:04 +0000 (UTC)
Injection-Info dont-email.me; posting-host="fafb48b540a2fff724766d529c113127"; logging-data="794647"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CFJGVyUtQnZYlf+xJIl5m"
User-Agent Gnus/5.13 (Gnus v5.13)
Cancel-Lock sha1:8oU9v0yQN9xb1jTFp0cTXcMmhPU= sha1:CyU8CnfXZQ8l0GEOP0kvV/XQD34=
Xref csiph.com comp.lang.c:395925

Show key headers only | View raw


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 */

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

8 bit cpu Rosario19 <Ros@invalid.invalid> - 2025-12-18 19:20 +0100
  Re: 8 bit cpu Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2025-12-18 20:03 +0000
    Re: 8 bit cpu Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2025-12-18 20:49 +0000
  Re: 8 bit cpu BGB <cr88192@gmail.com> - 2025-12-18 16:30 -0600
    Re: 8 bit cpu Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-12-18 15:36 -0800
      Re: 8 bit cpu Richard Heathfield <rjh@cpax.org.uk> - 2025-12-19 01:12 +0000
      Re: 8 bit cpu Kaz Kylheku <046-301-5902@kylheku.com> - 2025-12-20 19:23 +0000
        Re: 8 bit cpu Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-12-20 17:55 -0800
          Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-21 13:12 +0100
            Re: 8 bit cpu Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-12-21 16:14 -0800
              Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-22 08:41 +0100
    Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-19 09:49 +0100
    Re: 8 bit cpu Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-12-20 22:24 +0000
  Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-19 09:19 +0100
    Re: 8 bit cpu bart <bc@freeuk.com> - 2025-12-19 13:43 +0000
      Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-19 16:16 +0100
        Re: 8 bit cpu bart <bc@freeuk.com> - 2025-12-19 16:05 +0000
          Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-19 18:57 +0100
            Re: 8 bit cpu bart <bc@freeuk.com> - 2025-12-20 16:19 +0000
              Re: 8 bit cpu David Brown <david.brown@hesbynett.no> - 2025-12-20 18:29 +0100
  Re: 8 bit cpu Kaz Kylheku <046-301-5902@kylheku.com> - 2025-12-20 19:16 +0000
  Re: 8 bit cpu kalevi@kolttonen.fi (Kalevi Kolttonen) - 2025-12-24 01:11 +0000
    Re: 8 bit cpu Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-12-23 19:35 -0800
      Re: 8 bit cpu BGB <cr88192@gmail.com> - 2025-12-24 03:19 -0600

csiph-web