Return register padded to a double-word boundary?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Return register padded to a double-word boundary?

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture
Author Message
Paminu
Guest





Posted: Sat Nov 26, 2005 1:15 am    Post subject: Return register padded to a double-word boundary? Reply with 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:

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? Reply with quote

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? Reply with quote

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? Reply with quote

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
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB