65 lines
2.3 KiB
Plaintext
65 lines
2.3 KiB
Plaintext
/* ARM assembly AARCH64 Raspberry PI 3B */
|
|
/* program lenAreaString64.s */
|
|
|
|
/*******************************************/
|
|
/* Constantes file */
|
|
/*******************************************/
|
|
/* for this file see task include a file in language AArch64 assembly*/
|
|
.include "../includeConstantesARM64.inc"
|
|
/*******************************************/
|
|
/* Initialized data */
|
|
/*******************************************/
|
|
.data
|
|
szMessLenArea: .asciz "The length of area is : @ \n"
|
|
szCarriageReturn: .asciz "\n"
|
|
|
|
/* areas strings */
|
|
szString1: .asciz "Apples"
|
|
szString2: .asciz "Oranges"
|
|
/* pointer items area */
|
|
tablesPoi:
|
|
ptApples: .quad szString1
|
|
ptOranges: .quad szString2
|
|
ptVoid: .quad 0
|
|
/*******************************************/
|
|
/* UnInitialized data */
|
|
/*******************************************/
|
|
.bss
|
|
sZoneConv: .skip 30
|
|
/*******************************************/
|
|
/* code section */
|
|
/*******************************************/
|
|
.text
|
|
.global main
|
|
main: // entry of program
|
|
|
|
ldr x1,qAdrtablesPoi // begin pointer table
|
|
mov x0,0 // counter
|
|
1: // begin loop
|
|
ldr x2,[x1,x0,lsl 3] // read string pointer address item x0 (8 bytes by pointer)
|
|
cmp x2,0 // is null ?
|
|
cinc x0,x0,ne // no increment counter
|
|
bne 1b // and loop
|
|
|
|
ldr x1,qAdrsZoneConv // conversion decimal
|
|
bl conversion10S
|
|
ldr x0,qAdrszMessLenArea
|
|
ldr x1,qAdrsZoneConv
|
|
bl strInsertAtCharInc // insert result at @ character
|
|
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
|
|
qAdrtablesPoi: .quad tablesPoi
|
|
qAdrszMessLenArea: .quad szMessLenArea
|
|
qAdrsZoneConv: .quad sZoneConv
|
|
qAdrszCarriageReturn: .quad szCarriageReturn
|
|
/********************************************************/
|
|
/* File Include fonctions */
|
|
/********************************************************/
|
|
/* for this file see task include a file in language AArch64 assembly */
|
|
.include "../includeARM64.inc"
|