| Author |
Message |
Paminu
Guest
|
Posted:
Sat Nov 26, 2005 1:15 am Post subject:
Return register padded to a double-word boundary? |
|
|
I am writing an assembler program and when a procedure calls another
procedure it has to save the return address in the stack frame. But in a
book I am reading (Computer Organization and Design 3. ed) $ra get
allocated 8 bytes on the stack because : its padded to a double-word
boundary:
subu $sp, $sp, 32
sw $ra, 20($sp)
sw $fp, 16($sp)
addiu $fp, $sp, 28
But in som other examples in the book it only gets 4 bytes!
Why the different size? |
|
| Back to top |
|
 |
glen herrmannsfeldt
Guest
|
Posted:
Sun Nov 27, 2005 1:15 am Post subject:
Re: Return register padded to a double-word boundary? |
|
|
Paminu wrote:
| Quote: | I am writing an assembler program and when a procedure calls another
procedure it has to save the return address in the stack frame. But in a
book I am reading (Computer Organization and Design 3. ed) $ra get
allocated 8 bytes on the stack because : its padded to a double-word
boundary:
|
Not knowing specifically which architecture you are using,
different ones have different word size.
As far as I know, the first byte addressable architecture to use the
term "word" is S/360, where a word is four bytes.
Not so much later along comes VAX, and calls a word two bytes,
and confusing everyone.
-- glen |
|
| Back to top |
|
 |
Guest
|
Posted:
Tue Nov 29, 2005 3:55 pm Post subject:
Re: Return register padded to a double-word boundary? |
|
|
glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:
| Quote: | As far as I know, the first byte addressable architecture to use the
term "word" is S/360, where a word is four bytes.
Not so much later along comes VAX, and calls a word two bytes, and
confusing everyone.
|
1964 to 1978 `not much later'?! And what have you got against the byte
addressed 16 bit word PDP-11...
--
Paul Repacholi 1 Crescent Rd.,
+61 (08) 9257-1001 Kalamunda.
West Australia 6076
comp.os.vms,- The Older, Grumpier Slashdot
Raw, Cooked or Well-done, it's all half baked.
EPIC, The Architecture of the future, always has been, always will be. |
|
| Back to top |
|
 |
glen herrmannsfeldt
Guest
|
Posted:
Mon Dec 05, 2005 9:15 am Post subject:
Re: Return register padded to a double-word boundary? |
|
|
prep@prep.synonet.com wrote:
| Quote: | glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:
As far as I know, the first byte addressable architecture to use the
term "word" is S/360, where a word is four bytes.
Not so much later along comes VAX, and calls a word two bytes, and
confusing everyone.
1964 to 1978 `not much later'?! And what have you got against the byte
addressed 16 bit word PDP-11...
|
Only using the word "word" to describe it. Otherwise, I have no
complaints about it at all. Typists call five characters a word, which
might be about right for the average english word. Two characters is
way too short for a word.
-- glen |
|
| Back to top |
|
 |
|
|
|
|