54 lines
2.0 KiB
Plaintext
54 lines
2.0 KiB
Plaintext
/* ARM assembly AARCH64 Raspberry PI 3B */
|
|
/* program loopdowhile64.s */
|
|
|
|
/*******************************************/
|
|
/* Constantes file */
|
|
/*******************************************/
|
|
/* for this file see task include a file in language AArch64 assembly*/
|
|
.include "../includeConstantesARM64.inc"
|
|
|
|
/*********************************/
|
|
/* Initialized data */
|
|
/*********************************/
|
|
.data
|
|
szMessResult: .asciz "Counter = @ \n" // message result
|
|
|
|
/*********************************/
|
|
/* UnInitialized data */
|
|
/*********************************/
|
|
.bss
|
|
sZoneConv: .skip 24
|
|
/*********************************/
|
|
/* code section */
|
|
/*********************************/
|
|
.text
|
|
.global main
|
|
main: // entry of program
|
|
mov x20,0 // indice
|
|
mov x21,6
|
|
1: // begin loop
|
|
mov x0,x20
|
|
ldr x1,qAdrsZoneConv // conversion value value
|
|
bl conversion10 // decimal
|
|
ldr x0,qAdrszMessResult
|
|
ldr x1,qAdrsZoneConv // display conversion
|
|
bl strInsertAtCharInc // insert result at @ character
|
|
bl affichageMess // display message
|
|
add x20,x20,1 // increment counter
|
|
udiv x0,x20,x21 // divide by 6
|
|
msub x1,x0,x21,x20 // compute remainder
|
|
cbnz x1,1b // loop if remainder <> zéro
|
|
|
|
100: // standard end of the program
|
|
mov x0,0 // return code
|
|
mov x8,EXIT // request to exit program
|
|
svc 0 // perform the system call
|
|
|
|
qAdrsZoneConv: .quad sZoneConv
|
|
qAdrszMessResult: .quad szMessResult
|
|
/********************************************************/
|
|
/* File Include fonctions */
|
|
/********************************************************/
|
|
/* for this file see task include a file in language AArch64 assembly */
|
|
.include "../includeARM64.inc"
|