Copy a string: Difference between revisions

add task to ARM64 assembly Raspberry Pi
(Add Zig example)
(add task to ARM64 assembly Raspberry Pi)
Line 35:
B DS CL64 b
REFA DS A @a</lang>
=={{header|AArch64 Assembly}}==
 
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
<lang AArch64 Assembly>
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program copystr64.s */
/*******************************************/
/* Constantes file */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
/*******************************************/
/* Initialized data */
/*******************************************/
.data
szString: .asciz "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n"
/*******************************************/
/* UnInitialized data */
/*******************************************/
.bss
.align 4
qPtString: .skip 8
szString1: .skip 80
/*******************************************/
/* code section */
/*******************************************/
.text
.global main
main: // entry of program
// display start string
ldr x0,qAdrszString
bl affichageMess
// copy pointer string
ldr x0,qAdrszString
ldr x1,qAdriPtString
str x0,[x1]
// control
ldr x1,qAdriPtString
ldr x0,[x1]
bl affichageMess
// copy string
ldr x0,qAdrszString
ldr x1,qAdrszString1
1:
ldrb w2,[x0],1 // read one byte and increment pointer one byte
strb w2,[x1],1 // store one byte and increment pointer one byte
cmp x2,#0 // end of string ?
bne 1b // no -> loop
// control
ldr x0,qAdrszString1
bl affichageMess
100: // standard end of the program */
mov x0,0 // return code
mov x8,EXIT // request to exit program
svc 0 // perform the system call
qAdrszString: .quad szString
qAdriPtString: .quad qPtString
qAdrszString1: .quad szString1
/********************************************************/
/* File Include fonctions */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
</lang>
=={{header|ABAP}}==
<lang ABAP>data: lv_string1 type string value 'Test',