Its a code that takes the first value in the x array and adds it to the next, saves it to the first value in y, then takes the second value from x and adds it to the third and stores it in the second value in y, and so forth. Then it takes the last value of x and adds it to the first value of x and saves it to the last value of y.
This is an ambiguous wording! "adds it to the next" need not automatically imply writing the sum into the X array, just as "saves it to the first value in y" does not necessarily mean that it is the original (before addition) value that goes into the Y array. That is how the unrolled code that you show us does it, but it is not how the pseudo code in @SevaAlekseyev's answer does it, so be careful!
The code snippets in my answer do it like you have shown because the sentence "Then it takes the last value of x and adds it to the first value of x and saves it to the last value of y." seems to tell us just that...
Writing a loop
The simplest solution uses an address register for the X array and another address register for the Y array. If this needs to be 8086 code then you can choose between BX, SI, DI, and BP. The 'index' registers SI and DI being the logical choices. Since your array has 6 elements but processing the last element is somewhat special, you could initialize the counter in CX to 1 less, so 5, and then process the last element separately outside of the loop. This will avoid having to insert conditional branches:
.data
x sword 10, 20, 30, -10, -20, -30
y sword 6 dup (?)
mov di, OFFSET y
mov si, OFFSET x
mov cx, 5
more:
mov ax, [si] ; mov ax, x
add si, 2
add [si], ax ; add x+2, ax
mov [di], ax ; mov y, ax
add di, 2
loop more
mov ax, [si] ; mov ax, x+10
add x, ax ; add x, ax
mov [di], ax ; mov y+10, ax
Next is an alternative way that too avoids having to insert conditional branches. Note the extra word at the end of the X array that I'll use for a sixth regular iteration followed by a corrective add onto the first element of the X array. Since we're assuming 8086, why not shorten the code using the lodsw and stosw string primitives:
.data
x sword 10, 20, 30, -10, -20, -30, ?
y sword 6 dup (?)
mov di, OFFSET y
mov si, OFFSET x
mov cx, 6
more:
lodsw ; mov ax, x
add [si], ax ; add x+2, ax
stosw ; mov y, ax
loop more
add x, ax ; add x, ax
And next code shows how you could use a single index instead of separate pointers. The index increments by 2 because it is actually an offset in the arrays that hold word-sized elements. This snippet also demonstrates that you don't have to use the loop instruction per se. In 8086 code it is fine but don't use loop in 32-bit code where it is a slow instruction:
.data
x sword 10, 20, 30, -10, -20, -30
y sword 6 dup (?)
xor bx, bx ; Current offset in the arrays
more:
mov ax, [x + bx] ; mov ax, x
mov [y + bx], ax ; mov y, ax
add bx, 2
add [x + bx], ax ; add x+2, ax
cmp bx, 10 ; Continue for the first 5 word-sized elements
jb more
mov ax, [x + bx] ; mov ax, x+10
add x, ax ; add x, ax
mov [y + bx], ax ; mov y+10, ax