Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly 370 > Re: Assembler: ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 13 Topic 248 of 328
Post > Topic >>

Re: Assembler: alignment of machine instructions

by "John Small" <zjsmallz@[EMAIL PROTECTED] > Jul 14, 2005 at 10:50 AM

On Wed, 13 Jul 2005 21:13:45 UTC, "Michel Castelein" 
<arcis@[EMAIL PROTECTED]
> wrote:

> A DC or DS instruction with a zero duplication factor forces boundary 
> alignment, even when the NOALIGN assembler option is in effect.
> 
> At the other hand, IMHO, the assembler always aligns machine
instructions on 
> a halfword boundary.
> 
> So, I'm wondering why the expansion of the SAVE macro begins with a DS
0H.
> 
> That's redundant, isn't it?
> 
> Or are there some historical reasons? If yes, which ones?
> 
> The first one to provide me with the correct information will receive a
copy 
> of my new assembler course.

When I was an active programmer I used to do this all the time, 
especially on the first instruction of a macro I wrote.  

One, the DS forces the alignment.  This is not redundant because the 
SAVE macro could be coded following some data which may not have 
terminated on a halfword boundary.

Two, the DS provides an easy way to assign the label, if any, on the 
macro to the first instruction of the macro.  Since the macro may 
expand in various ways and therefore may have various first executable
instructions, it is a lot easier to use the DS than to assign/reassign
the label to the various first executable instructions.  Even if a 
simple macro does not have multiple ways of expanding, macros are not 
always static.  They tend to change over time.  It is just much easier
to maintain macros without having to juggle with assigning and 
reassigning the label for the first instruction.

-- 

John Small

(remove the z's for email address)
 




 13 Posts in Topic:
Assembler: alignment of machine instructions
"Michel Castelein&qu  2005-07-13 23:13:45 
Re: Assembler: alignment of machine instructions
richgr@[EMAIL PROTECTED]   2005-07-13 21:37:48 
Re: Assembler: alignment of machine instructions
Binyamin Dissen <posti  2005-07-14 11:26:02 
Re: Assembler: alignment of machine instructions
"arargh" arargh  2005-07-13 18:00:03 
Re: Assembler: alignment of machine instructions
glen herrmannsfeldt <g  2005-07-13 21:27:03 
Re: Assembler: alignment of machine instructions
glen herrmannsfeldt <g  2005-07-19 13:43:28 
Re: Assembler: alignment of machine instructions
Binyamin Dissen <posti  2005-07-14 11:26:04 
Re: Assembler: alignment of machine instructions
"John Small" &l  2005-07-14 10:50:59 
Re: Assembler: alignment of machine instructions
glen herrmannsfeldt <g  2005-07-25 16:03:55 
Re: Assembler: alignment of machine instructions
"Michel Castelein&qu  2005-07-26 08:25:21 
Re: Assembler: alignment of machine instructions
"Sven Pran" <  2005-07-27 09:45:31 
Re: Assembler: alignment of machine instructions
beu@[EMAIL PROTECTED] (B  2005-07-27 20:50:58 
Re: Assembler: alignment of machine instructions
"Sven Pran" <  2005-07-28 00:11:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:16:06 CDT 2008.