Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
94
Task/Machine-code/AArch64-Assembly/machine-code.aarch64
Normal file
94
Task/Machine-code/AArch64-Assembly/machine-code.aarch64
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/* ARM assembly AARCH64 Raspberry PI 3B */
|
||||
/* program Machine code */
|
||||
|
||||
/*******************************************/
|
||||
/* Constantes */
|
||||
/*******************************************/
|
||||
/* for this file see task include a file in language AArch64 assembly*/
|
||||
.include "../includeConstantesARM64.inc"
|
||||
|
||||
/*******************************************/
|
||||
/* macros */
|
||||
/*******************************************/
|
||||
//.include "../../ficmacros64.inc" // for developper debugging
|
||||
|
||||
/*********************************/
|
||||
/* Initialized data */
|
||||
/*********************************/
|
||||
.data
|
||||
szMessDebutPgm: .asciz "Program 64 bits start. \n"
|
||||
szCarriageReturn: .asciz "\n"
|
||||
szMessFinOK: .asciz "Program normal end. \n"
|
||||
|
||||
/*********************************/
|
||||
/* UnInitialized data */
|
||||
/*********************************/
|
||||
.bss
|
||||
sAreaConv: .skip 24
|
||||
.align 4
|
||||
|
||||
/*********************************/
|
||||
/* code section */
|
||||
/*********************************/
|
||||
.text
|
||||
.global main
|
||||
main:
|
||||
ldr x0,qAdrszMessDebutPgm
|
||||
bl affichageMess // start message
|
||||
|
||||
mov x0,#5
|
||||
mov x1,#10
|
||||
bl addition // call function
|
||||
|
||||
ldr x1,qAdrsAreaConv // decimal conversion
|
||||
bl conversion10
|
||||
ldr x0,qAdrsAreaConv // display result
|
||||
bl affichageMess
|
||||
ldr x0,qAdrszCarriageReturn
|
||||
bl affichageMess
|
||||
|
||||
adr x2,bCodeArmText // code machine arm address
|
||||
mov x0,#10
|
||||
mov x1,#20
|
||||
blr x2 // call code machine
|
||||
|
||||
ldr x1,qAdrsAreaConv // decimal conversion
|
||||
bl conversion10
|
||||
ldr x0,qAdrsAreaConv // display result
|
||||
bl affichageMess
|
||||
ldr x0,qAdrszCarriageReturn
|
||||
bl affichageMess
|
||||
|
||||
ldr x0,qAdrszMessFinOK
|
||||
bl affichageMess
|
||||
|
||||
100:
|
||||
mov x8,EXIT
|
||||
svc #0 // system call
|
||||
qAdrszMessDebutPgm: .quad szMessDebutPgm
|
||||
qAdrszMessFinOK: .quad szMessFinOK
|
||||
qAdrszCarriageReturn: .quad szCarriageReturn
|
||||
qAdrsAreaConv: .quad sAreaConv
|
||||
|
||||
/******************************************************************/
|
||||
/* add two registers */
|
||||
/******************************************************************/
|
||||
/* x0 contains value 1 */
|
||||
/* x1 contains value 2 */
|
||||
|
||||
addition:
|
||||
stp x1,lr,[sp,-16]! // TODO: a completer
|
||||
add x0,x0,x1
|
||||
100:
|
||||
ldp x1,lr,[sp],16 // TODO: a completer
|
||||
ret
|
||||
// code machine ARM AARCH 64 bits
|
||||
bCodeArmText: .byte 0xE1,0x7B,0xBF,0xA9 // stp x1,lr,[sp,-16]!
|
||||
.byte 0x00,0x00,0x01,0x8B // add x0,x0,x1
|
||||
.byte 0xE1,0x7B,0xC1,0xA8 // ldp x1,lr,[sp],16
|
||||
.byte 0xC0,0x03,0x5F,0xD6 // ret
|
||||
/***************************************************/
|
||||
/* ROUTINES INCLUDE */
|
||||
/***************************************************/
|
||||
/* for this file see task include a file in language AArch64 assembly*/
|
||||
.include "../includeARM64.inc"
|
||||
Loading…
Add table
Add a link
Reference in a new issue