Return register padded to a double-word boundary?

General discussion of computer architecture.

Return register padded to a double-word boundary?

Postby Paminu » Sat Nov 26, 2005 1:15 am

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?
Paminu
 

Re: Return register padded to a double-word boundary?

Postby glen herrmannsfeldt » Sun Nov 27, 2005 1:15 am

Paminu wrote:

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
glen herrmannsfeldt
 

Re: Return register padded to a double-word boundary?

Postby Guest » Tue Nov 29, 2005 3:55 pm

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...

--
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.
Guest
 

Re: Return register padded to a double-word boundary?

Postby glen herrmannsfeldt » Mon Dec 05, 2005 9:15 am

prep@prep.synonet.com wrote:

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
glen herrmannsfeldt
 


Return to Computer Architecture

Who is online

Users browsing this forum: No registered users and 0 guests

cron