Re: Write to unused memory-mapped IO address (0xfffffffc)
- From: blmblm@xxxxxxxxxxxxx
- Date: 27 Nov 2005 18:36:43 GMT
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.
.
- Follow-Ups:
- References:
- Prev by Date: Write to unused memory-mapped IO address (0xfffffffc)
- Next by Date: Re: Simple assembly program
- Previous by thread: Write to unused memory-mapped IO address (0xfffffffc)
- Next by thread: Re: Write to unused memory-mapped IO address (0xfffffffc)
- Index(es):
Relevant Pages
|