Jump to content

String prepend: Difference between revisions

Line 17:
To illustrate the operation, show the content of the variable.
<br><br>
=={{header|360 Assembly}}==
<lang 360asm>* 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</lang>
{{out}}
<pre>
Hello world!
</pre>
 
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
1,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.