Re: Write to unused memory-mapped IO address (0xfffffffc)



In article <dmcpmc$1j1$1@xxxxxxxxxxxxxxxxx>, Paminu <asdad@xxxxxxx> wrote:
>In some assembly code I am writing I decrement the frame_pointer with 4
>after executing a store word instruction in a loop:
>
>sw $2, 0($30)
>addi $30, $0, -4 # fp point to next element in a.
>
>When the program starts $30 is initialized to:
>
>7FFFEFEC
>
>The first time the SW instruction is executed it works fine and the frame
>pointer is afterwards decremented with 4 and gets the value:
>
>FFFFFFFC

Which is not 0x7FFFEFEC minus 4, is it? So something is wrong.
Using twos' complement notation, 0xFFFFFFFC represents -4, no?
With that information, look again at your "addi" instruction --
can you spot what's wrong?

>
>But the next time the SW instruction is executed I get this error:
>
>"Write to unused memory-mapped IO address (0xfffffffc)"
>
>I use SPIM to simulate my code.
>
>Why is it not possible to write to 0xfffffffc??
>

Some real architectures perform I/O by doing something that, to
the programmer, looks like reading/writing using particular memory
addresses. Usually (AFAIK) these are addresses at either the high or
low end of memory -- such as 0xfffffffc. The hardware is supposed
to magically convert accesses to these addresses into operations
to communicate with devices or device controllers. (I feel sure
if this description is off-base someone will correct me, and/or
supply some details. There may also be a good description in your
(text?)book -- try "memory-mapped I/O" in the index.)

SPIM appears to be simulating this, with 0xfffffffc being one of
the addresses reserved for communicating with I/O devices. I'm
speculating here, but it sounds like maybe 0xfffffffc is reserved
for this purpose but not actually used, and therefore SPIM is not
going to let you perform an operation (writing to this address)
that wouldn't do anything.

--
| B. L. Massingill
| ObDisclaimer: I don't speak for my employers; they return the favor.
.



Relevant Pages

  • Suggested redcode instructions by others...
    ... BNC negate increment added to instruction pointer ... CCO copy opcode and addressing modes ... DRN decrements B. if B 0 jump to A, ... EAT subvert process executing at B ...
    (rec.games.corewar)
  • Re: Cross-Modifying Code
    ... > There's an explicit warning that instruction fetch and page table accesses ... > don't honour xFENCE for prefetched code either. ... > then you don't know when to issue the CPUID. ... The Opteron manuals don't comment on the interaction between executing code ...
    (comp.lang.asm.x86)
  • Re: unset($this) or maybe unset(&$this)
    ... which does not involve a jump is executed the next instruction to be executed will be the very next instruction in the same object method. ... The code may still exist in the class definition, but the object, which contains a copy of that code in memory, does not, so how can it continue executing any of that code? ... When you call something like obj.Func; in C++ (assuming obj is an instance of class Foo), the compiler actually translates that to something like: ...
    (comp.lang.php)
  • Re: Question about Instruction Format (ModR/M)
    ... (the first three bytes, being prefixes, could be in any order) ... This is a 32-bit PM instruction executing in 16-bit RM/PM due to ... they have to push the extra byte back onto the disassembly stream. ...
    (alt.lang.asm)
  • Re: Accessing program counter registers from within C or Assembler.
    ... >> current executing instruction in C while the ... it is close to the second scenario ("Where in memory ... is there a method to load a program image ...
    (Linux-Kernel)