The assembler reflects the architecture of the machine.  Originally, you could 
not load a 32-bit integer (called a full word) into a register from memory 
unless the address was properly aligned.  Attempting to do so would cause the 
instruction to terminate and a program check interrupt (specification 
exception) to occur.  There were similar alignment restrictions on halfword 
integers, single and doubleword floating point values, and address values.

Some things have changed in the ensuing 50+ years.  Some misalignments no 
longer cause an interrupt, merely a degradation in performance.  Some newer 
more complex instructions come with new different alignment requirements.

When you specify an operand with an implied length and alignment, the assembler 
will automatically add padding as necessary before the operand to insure the 
implied alignment.  That is why your original DS F was shifted two bytes to the 
right.  The assembler also provides a way to override this default behavior for 
individual operands.  You do this by specify the desired length.  If you had 
coded DS FL4, your operand would have abutted the previous halfword operand.  
Whether this would have produced the desired result when you executed your 
program is a different issue.

If you haven't done so already, you can download the Principles of Operation 
manual which discusses the hardware in considerable detail.

> -----Original Message-----
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On
> Behalf Of Nguyen Dt
> Sent: Sunday, July 05, 2020 8:24 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Assembler question
> 
> Thank you all for your inputs,
> 
> I am over the problem now.
> In fact what i tried to do is to Move some fields to my output fields and 
> then write it
> as a report. (It is a Db2 performance report, the input are from the trace 
> buffers with
> the macros given by Db2 libraries)
> 
> So my program is roughly like this
> READ Buffer on QW... variables
> 
> MVC OW...,QW...
> 
> 
> OW... are the output fields i defined it exactly as in the DSECT got from the 
> macros.
> As it is an output field, the position is important  (and it is why i 
> detected a problem in
> the positions of my fields)
> Its is OK now with OW... variables defined as characters CLx
> 
> (PS: When i use NOALIGN , the program abends at execution ...)
> 
> As i learn assembler "on the flight" , there is some important things that i 
> don' t
> understand , such as the alignment .... This is something we don't care in 
> cobol , rexx
> .... Can you tell me why assembler has the alignment in words that are easy to
> understand and visualize in my little head ?
> 
> Thank you again.
> Duc
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to