Re: Write to unused memory-mapped IO address (0xfffffffc)
- From: "Paminu" <asdad@xxxxxxx>
- Date: Sun, 27 Nov 2005 22:53:08 +0100
> 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.
Think you are right. I have now intialized the stack-pointer before I use
it:
ori $sp, $0, 0xfffc # Init stack
$sp = 0000FFFC
I would then like to make room for 3 (3*4 = 12 Bytes) arguments and an array
with 10 integers (a[10] = 40 Bytes). I therefore decrement the stack-pointer
with 52
addi $29, $29, -52
$sp = 0000FFC8
I would the like to store the return address as the first item on the stack:
sw $31, 48($29) # main's $ra is first item on stack.
but then I get this error (taken form SPIM):
[0x00400014] 0xafbf0030 sw $31, 48($29) ; 10: sw $31,
48($29) # main's $ra is first item on stack.
Exception occurred at PC=0x00400014
Bad address in data/stack read: 0x0000fff8
Can't expand stack segment by 16777216 bytes to 16842752 bytes
Use -lstack # with # > 16842752
Why is it impossible to store $ra from 0x0000fff8??
.
- Follow-Ups:
- References:
- Prev by Date: proceses selection
- Next by Date: Re: Simple assembly program
- Previous by thread: Re: Write to unused memory-mapped IO address (0xfffffffc)
- Next by thread: Re: Write to unused memory-mapped IO address (0xfffffffc)
- Index(es):
Relevant Pages
|