Re: C and Low-level Storage



On Dec 19, 3:44 pm, Paul <paul-nospamatall.rauler...@xxxxxxx> wrote:
On 2008-12-18 12:01:59 -0600, Michael Wojcik <mwoj...@xxxxxxxxxxx> said:



PR wrote:

<amusement> Since the days of Von Neuman, executable code has been
stored in addressable memory.

But not always.

Do you have a real instance of a machine where the executable code in
memory is not readable?

There are plenty of 8-bitters that cannot treat code as data - ie, it
can only be read for execution. And 8-bitters still represent
90-something percent of all computers sold in a given year.

DSPs are also usually Harvard-architecture machines (separate
instruction and data).

General-purpose computers are only a tiny segment of the overall
computer market. The most popular computer application in the world,
by far, is "digital clock", and you don't need a 64-bit processor for
that.

I am not sure I understand what you are trying to say here.

That is because you fail to follow the discussion but conflate and
inflate it in meaningless ways. You also generalise the specific and
specificise the general.

The discussion started started when a program could not write to
variables in its own code segment, but the claim was that it could
read these as constants.

I pointed out that with some systems a program may not even be able to
read its own code segment.

You then thought that this meant that _nothing_ could read it.

Do try and keep up.

Usually, a
CPU has a an instruction fetch unit that reads the instruction data
from a memory address. That alone says to me that the instruction data
space has to be readable. But perhaps you are talking about something
entirely different.

But, in 'protected mode' the code segment may be _protected_ from
other processes _and_ even from its own process. That is any segment
(in a particular system) may be marked as 'not readable', 'read-only'
or 'read-write', but it may have another protection flag and and that
is 'executable' or 'non-execuatable'.

The 'instruction fetch unit' only cares about the 'executable' flag,
the _data_ fetch/put unit cares about the read/write flags.

How hard is this stuff ?


A lot of machine have separate instruction and data spaces; when I say
code or text section, I am talking about the instruction space. When I
say data or static section, I am talking about the data space, or space
that is read/write.

I know of no modern digital machines that are not stored program
machines. Even most embedded processors qualify as GPDCs these days.

Do you have a specific instance of a machine like you are talking
about? The closest examples I can thing of are some analog computers.

Your knowledge is not a limitation on the types of machines that can
be built.

It is quite easy to imagine an 8bit machine where the instruction
fetch unit accesses, say, a 64Kb ROM and the data fetch/put unit
accesses a completely different 64Kb RAM.

That would mean that the only way of 'loading' a binary program is to
put it in a ROM on some other machine and swap it, but that is how
many embedded systems work anyway. Having the ROM and RAM in the same
address space would simply limit the total to 64Kb rather than each
having a full 64Kb available.







.



Relevant Pages

  • Re: how to parse an executable in C and find out if there is any return(RET in assembly) or not
    ... then figuring out whether there is a machine return instruction ... for trillions of different possible input programs. ... instruction in the new execution, eventually leading to the 83 RETURN...) ... place a fixed pre-determined limit on the amount of memory available to ...
    (comp.lang.c)
  • Re: Cracking DES with C++ is faster than Java?
    ... >> Computers can access fixed locations in memory ... One of the disadvantages of using absolute memory ... When the instruction is longer, either it will take more time ... >> be accessed using relative locations. ...
    (comp.lang.java)
  • Re: Cracking DES with C++ is faster than Java?
    ... >> Computers can access fixed locations in memory ... One of the disadvantages of using absolute memory ... When the instruction is longer, either it will take more time ... >> be accessed using relative locations. ...
    (comp.lang.cpp)
  • Re: Cracking DES with C++ is faster than Java?
    ... >> Computers can access fixed locations in memory ... One of the disadvantages of using absolute memory ... When the instruction is longer, either it will take more time ... >> be accessed using relative locations. ...
    (sci.crypt)
  • Re: Invalid lock sequence
    ... If you are going after a reuse-after-delete, ... to get a stack trace of the code-path that free-ed the block of memory. ... but execution of arbitrary memory seems likely ... >> According to Intel's instruction set reference, ...
    (microsoft.public.vc.language)