Paul Gilmartin wrote:

In a recent note, Greg Smith said:

Date:         Wed, 6 Jul 2005 12:26:01 -0400

 ds 0d
a ds 12x
b ds 16x
But if I code

  mvc b(16),a

the overlap is destructive (ie b won't necessarily be an exact copy of
a).  Would a
concurrent copy occur?   (in this case, a concurrent copy could occur
without affecting
the result).

No.  I believe the "destructive" character of the overlap has long
been part of the specification of MVC.  In particular, programmers
of old were accustomed to blanking out a buffer with:

   MVI C' ',A
   MVC A+1(L'A'-1),A

(before padding MVCL).

-- gil
Well that's what I would think.  I'm trying to understand concurrent copy
better - as I understand it, if the dest and source begin on the same byte
boundary in a doubleword, doublewords are fetched and stored
concurrently and if they are off by 4 then fullwords are fetched and stored
concurrently (once you get to the proper boundary).  However, if there is
destructive overlap, then bytes are moved 1 at a time.

But, I cannot get the program below to fail. Either I don't quite understand destructive overlap (tfm: ` Destructive overlap is said to exist when the result
location is used as a source after the result has been stored, assuming
processing to be performed one byte at a time') or there is concurrent
copy if the source and dest are far enough apart.

Greg


MVCTEST CSECT
       SAVE   (14,12)
       lr     12,15
       using  MVCTEST,12
       IDENTIFY EP=SUBTASK,ENTRY=SUBTASK
       ATTACH EP=SUBTASK
loop    mvc    a(32),c
       mvc    a(16),b
       mvc    b(16),a
       cli    sw,0
       be     loop
       STIMER WAIT,BINTVL==f'5'
       RETURN (14,12),RC=0
SUBTASK SAVE (14,12)
       lr     12,15
       ahi    12,MVCTEST-SUBTASK
       l      0,=a(N)
loop2   l      1,b
       cl     1,c+12
       be     cont
       cl     1,c+24
       be     cont
       cl     1,c
       be     cont
       mvi    sw,1
       dc     h'0'
cont    bct    0,loop2
       mvi    sw,1
       RETURN (14,12),RC=0
N EQU 500000000
sw      dc     f'0'
ds d a ds 12x
b       ds     20x
c       dc     x'01020304',x'05060708',x'090a0b0c',x'0d0e0f10'
       dc     x'11121314',x'15161718',x'191a1b1c',x'1d1e1f20'
end

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to