VON NEUMANN VS HARVARD

OK, I can accept that.

In some respects C is a horrid language and there are a number of things I wish were different.

--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Reply to
Flash Gordon
Loading thread data ...

Then your programs must not have had much constant data.

You need pragmas, or something equivalent in practice, if you have significant amounts of constant data (e.g. strings, lookup tables, menu structures). The C run time system has to copy all such into RAM in order for it to be accessed as data. Most "harvard" processors these days seem to be microcontrollers, which have comparatively little RAM to begin with. It would be much better if constant data can be left in ROM.

An alternative is for the compiler to embed extra information into pointers, indicating whether the pointer is to "data" or "program" space. But this makes the code slow and bulky, since each pointer has to be interpreted at runtime.

This is the main problem with the AVR IMHO. It is much nicer working with the newer ARM microcontrollers.

--

John Devereux
Reply to
John Devereux

In article , snipped-for-privacy@yahoo.com wrote: [....]

I wouldn't characterize the PIC as "reduced" instruction set for the same reason as I wouldn't say a PDP-8 was a RISC machine. They are both "very simple processors" out of the need to keep the number of transistors low.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

while

No you don't. PIIs had the L2 on the backside of the bus, on the cartridge. The original Pentiums (socket 5/7) had SRAMs on the board.

You are *SO* wrong.

You'd better study Computer Architecture 101 a bit harder.

1960s.

Nope.

All current High-end CPUs.

At least S/370 ->

--
  Keith
Reply to
Keith

All the compilers above recognises "const" which is standard C to mean constant data and will optimise them away into a look-up table in program memory/ROM. No pragmas needed.

Reply to
slebetman

No, they do not. In the case of AVR gcc, look at avr-libc, there is a whole infrastructure of "program space" macros and functions that are required in order to achieve this. If you do not use these, and stick to standard C, then the linker will put the constant data in the data section, which will be copied to RAM by the c startup.

--

John Devereux
Reply to
John Devereux

No, the ability to pass and return structures was added into Unix Version 7 C. Along with the enumeration type.

_Recent Changes to C_, November 15, 1978, Page 277, Unix Programmers Manul, V.2

1979, 1983, Bell Telephone Laboratories Holt Reinhart and Wilson

There was a warning that the PDP-11 version didn't handle reentrancy within an interrupt properly, though.

Mark Zenier snipped-for-privacy@eskimo.com Googleproofaddress(account:mzenier provider:eskimo domain:com)

Reply to
Mark Zenier

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.