
Basic Data Operation

This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:


Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses


Task

Create a string variable equal to any text value.

Prepend the string variable with another string literal.

If your language supports any idiomatic ways to do this without referring to the variable twice in one expression, include such solutions.



To illustrate the operation, show the content of the variable.




*        String prepend - 14/04/2020
PREPEND  CSECT
         USING  PREPEND,13         base register
         B      72(15)             skip savearea
         DC     17F'0'             savearea
         SAVE   (14,12)            save previous context
         ST     13,4(15)           link backward
         ST     15,8(13)           link forward
         LR     13,15              set addressability
         MVC    C+L'B(L'A),A       c=a
         MVC    C(L'B),B           c=b+c  (prepend)
         XPRNT  C,L'C              print buffer
         L      13,4(0,13)         restore previous savearea pointer
         RETURN (14,12),RC=0       restore registers from calling sav
A        DC     C'world!'          a
B        DC     C'Hello '          b
C        DC     CL80' '            c
         END    PREPEND