Re: Stupid cache question.

From: Ed Beroset (beroset_at_mindspring.com)
Date: 10/07/04


Date: Thu, 07 Oct 2004 17:57:18 GMT

CBFalconer wrote:
> Neil Bradley wrote:
>
>>"Jim Stewart" <jstewart@jkmicro.com> wrote in message
>>
>>
>>>Has anyone ever tried to use a processer with
>>>on-board data cache without any ram, using the
>>>cache as the ram?
>>
>>This is how modern day Pentium based BIOSes work. They have the
>>ability to turn cache into real RAM - sure beats trying to do
>>memory sizing with no memory or stack!
>
> Tell us more, including how to do it.

I sure don't know how to do such a thing (explicitly use cache as RAM),
but programming without using RAM at all is certainly possible. On the
x86 platforms, for example, you can simulate subroutine calls by JMPing
directly to the "subroutine" after storing the return address in a
register, say EBX. Such a call would look something like this:

; simulated subroutine call
        lea ebx, over ; load effective address of "over" label
        jmp psuedosubr ; jmp to the pseudo-subroutine
over:
        nop ; code continues

; simulated subroutine body
        ; obviously, there is no stack frame
        nop ; do stuff
; ...
        jmp [ebx] ; return from pseudo-subroutine

This avoids using RAM, but maintains some semblance of organization to
the code. It's probably pretty obvious how you could wrap all of this
into macros, and if we wanted to get really tricky, we might be able to
use another register (or bit of another register) to tell us whether
we're in psuedo-subroutine or real-subroutine mode and execute the
correct return accordingly. I doubt that would be worth much, though,
given any reasonable amount of ROM and RAM. The only purpose I know of
for such code is running before the memory hardware is set up to be
usable and/or if the requirement is to do RAM testing and diagnostics
before using the RAM. I don't think there's much sense in actually
building a completely RAM-less system.

Ed



Relevant Pages

  • Re: Upgrade Business Machine Recommendation Please
    ... Registered RAM contains a register between the RAM and memory ... ECC is error correction through additional memory bits holding checksum ...
    (uk.comp.homebuilt)
  • Re: PIC vs ARM assembler (no flamewar please)
    ... register and memory has nearly the same speed. ... speed bottleneck for CPUs, it would be horribly slow to implement. ... The TMS9995 was much closer to an MCU with onboard RAM ... and it still was much slower than register based CPUs. ...
    (comp.arch.embedded)
  • Re: PIC vs ARM assembler (no flamewar please)
    ... Slower, yes. ... memory addresses or not I don't know, the RAM is on-chip at address ... go away) to point to the first register in memory. ...
    (comp.arch.embedded)
  • Re: How do I meet this memory IO with least resources on FPGA?
    ... For very large memory, register implementation takes N times silicon than ... For a small memory, RAM have overheads like RW, sensing, amplifier, etc ...
    (comp.arch.fpga)
  • Re: Steve Jobs demos Macintosh in 1984
    ... Woody wrote: ... Stop annoying the fucking hell out of me, ... For sure not much computer memory had been made in 1948 - but it could ... For sure you got a bit more RAM to use in the Speccy - ...
    (uk.comp.sys.mac)