Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,147 @@
|
|||
/* ARM assembly AARCH64 Raspberry PI 3B */
|
||||
/* program arrayHash64.s */
|
||||
|
||||
/*******************************************/
|
||||
/* Constantes */
|
||||
/*******************************************/
|
||||
/* for this file see task include a file in language AArch64 assembly*/
|
||||
.include "../includeConstantesARM64.inc"
|
||||
|
||||
/*******************************************/
|
||||
/* Macros */
|
||||
/*******************************************/
|
||||
//.include "../../ficmacros64.inc" @ for developer debugging
|
||||
|
||||
/************************************/
|
||||
/* structure */
|
||||
/************************************/
|
||||
.struct 0 // hash structure
|
||||
hash_index:
|
||||
.struct hash_index + 8
|
||||
hash_value:
|
||||
.struct hash_value + 8
|
||||
hash_end:
|
||||
|
||||
/*******************************************/
|
||||
/* Initialized data */
|
||||
/*******************************************/
|
||||
.data
|
||||
szMessDebutPgm: .asciz "Program 64 bits start. \n"
|
||||
szCarriageReturn: .asciz "\n"
|
||||
szMessFinOK: .asciz "Program normal end. \n"
|
||||
szMessIndex: .asciz "Index : "
|
||||
szMessValue: .asciz " Value : "
|
||||
|
||||
szIndex1: .asciz "1"
|
||||
szIndex2: .asciz "2"
|
||||
szIndex3: .asciz "3"
|
||||
szIndex4: .asciz "4"
|
||||
|
||||
szValue1: .asciz "One"
|
||||
szValue2: .asciz "Two"
|
||||
szValue3: .asciz "Three"
|
||||
szValue4: .asciz "For"
|
||||
|
||||
listIndex: .quad szIndex1
|
||||
.quad szIndex2
|
||||
.quad szIndex3
|
||||
.quad szIndex4
|
||||
.equ NBINDEX, (. - listIndex ) / 8
|
||||
|
||||
listValue: .quad szValue1
|
||||
.quad szValue2
|
||||
.quad szValue3
|
||||
.quad szValue4
|
||||
.equ NBVALUE, (. - listValue ) / 8
|
||||
/*******************************************/
|
||||
/* UnInitialized data */
|
||||
/*******************************************/
|
||||
.bss
|
||||
.align 4
|
||||
hashExemple: .skip hash_end * NBINDEX
|
||||
|
||||
/*******************************************/
|
||||
/* code section */
|
||||
/*******************************************/
|
||||
.text
|
||||
.global main
|
||||
main:
|
||||
ldr x0,qAdrszMessDebutPgm
|
||||
bl affichageMess
|
||||
|
||||
ldr x4,qAdrlistIndex // index list address
|
||||
ldr x5,qAdrlistValue // value list address
|
||||
ldr x6,qAdrhashExemple
|
||||
mov x1,#hash_end // size one record
|
||||
mov x3,#0 // indice
|
||||
1:
|
||||
ldr x2,[x4,x3,lsl #3] // load one index address
|
||||
mul x7,x3,x1 // compute offset oh hah index address
|
||||
str x2,[x6,x7] // store index address in hah index address
|
||||
ldr x2,[x5,x3,lsl #3] // load one value address
|
||||
add x7,x7,#hash_value // compute offset hash value address
|
||||
str x2,[x6,x7] // store value address in hash value address
|
||||
|
||||
add x3,x3,#1 // increment indice
|
||||
cmp x3,#NBINDEX // end ?
|
||||
blt 1b
|
||||
|
||||
ldr x0,qAdrhashExemple // hash address
|
||||
mov x1,#NBINDEX // record umber
|
||||
bl displayHash // display
|
||||
|
||||
ldr x0,qAdrszMessFinOK
|
||||
bl affichageMess
|
||||
|
||||
100: // standard end of the program
|
||||
mov x0, #0 // return code
|
||||
mov x8,EXIT
|
||||
svc 0 // perform system call
|
||||
qAdrszMessDebutPgm: .quad szMessDebutPgm
|
||||
qAdrszMessFinOK: .quad szMessFinOK
|
||||
qAdrszCarriageReturn: .quad szCarriageReturn
|
||||
qAdrlistValue: .quad listValue
|
||||
qAdrlistIndex: .quad listIndex
|
||||
qAdrhashExemple: .quad hashExemple
|
||||
/******************************************************************/
|
||||
/* display hash array */
|
||||
/******************************************************************/
|
||||
/* r0 contains hash list address */
|
||||
/* r1 contains number lines */
|
||||
displayHash:
|
||||
stp x1,lr,[sp,-16]! // save registers
|
||||
stp x2,x3,[sp,-16]! //
|
||||
stp x4,x5,[sp,-16]! //
|
||||
mov x4,x0 // save hash address
|
||||
mov x2,#0 // indice
|
||||
mov x3,#hash_end // size record hash
|
||||
1:
|
||||
ldr x0,qAdrszMessIndex // display index libellé
|
||||
bl affichageMess
|
||||
mul x5,x2,x3 // compute hash index offset
|
||||
ldr x0,[x4,x5] // load address index
|
||||
bl affichageMess // and display
|
||||
ldr x0,qAdrszMessValue // display value libellé
|
||||
bl affichageMess
|
||||
add x5,x5,#hash_value // compute offset hash value
|
||||
ldr x0,[x4,x5] // load address value
|
||||
bl affichageMess // and display
|
||||
ldr x0,qAdrszCarriageReturn
|
||||
bl affichageMess
|
||||
add x2,x2,#1 // increment indice
|
||||
cmp x2,x1 // end ?
|
||||
blt 1b // no -> loop
|
||||
|
||||
100:
|
||||
ldp x4,x5,[sp],16 // restaur registers
|
||||
ldp x2,x3,[sp],16 //
|
||||
ldp x1,lr,[sp],16 //
|
||||
ret
|
||||
qAdrszMessIndex: .quad szMessIndex
|
||||
qAdrszMessValue: .quad szMessValue
|
||||
|
||||
/***************************************************/
|
||||
/* ROUTINES INCLUDE */
|
||||
/***************************************************/
|
||||
/* for this file see task include a file in language AArch64 assembly*/
|
||||
.include "../includeARM64.inc"
|
||||
144
Task/Hash-from-two-arrays/ARM-Assembly/hash-from-two-arrays.arm
Normal file
144
Task/Hash-from-two-arrays/ARM-Assembly/hash-from-two-arrays.arm
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
/* ARM assembly Raspberry PI */
|
||||
/* program arrayHash.s */
|
||||
/* REMARK 1 : this program use routines in a include file
|
||||
see task Include a file language arm assembly
|
||||
for the routine affichageMess conversion10
|
||||
see at end of this program the instruction include */
|
||||
|
||||
/*******************************************/
|
||||
/* Constantes */
|
||||
/*******************************************/
|
||||
.include "../constantes.inc"
|
||||
|
||||
/*******************************************/
|
||||
/* Macros */
|
||||
/*******************************************/
|
||||
//.include "../../ficmacros32.inc" @ for developer debugging
|
||||
|
||||
/************************************/
|
||||
/* structure */
|
||||
/************************************/
|
||||
.struct 0 @ hash structure
|
||||
hash_index:
|
||||
.struct hash_index + 4
|
||||
hash_value:
|
||||
.struct hash_value + 4
|
||||
hash_end:
|
||||
|
||||
/*******************************************/
|
||||
/* Initialized data */
|
||||
/*******************************************/
|
||||
.data
|
||||
szMessDebutPgm: .asciz "Program 32 bits start. \n"
|
||||
szCarriageReturn: .asciz "\n"
|
||||
szMessFinOK: .asciz "Program normal end. \n"
|
||||
szMessIndex: .asciz "Index : "
|
||||
szMessValue: .asciz " Value : "
|
||||
|
||||
szIndex1: .asciz "1"
|
||||
szIndex2: .asciz "2"
|
||||
szIndex3: .asciz "3"
|
||||
szIndex4: .asciz "4"
|
||||
|
||||
szValue1: .asciz "One"
|
||||
szValue2: .asciz "Two"
|
||||
szValue3: .asciz "Three"
|
||||
szValue4: .asciz "For"
|
||||
|
||||
listIndex: .int szIndex1
|
||||
.int szIndex2
|
||||
.int szIndex3
|
||||
.int szIndex4
|
||||
.equ NBINDEX, (. - listIndex ) / 4
|
||||
|
||||
listValue: .int szValue1
|
||||
.int szValue2
|
||||
.int szValue3
|
||||
.int szValue4
|
||||
.equ NBVALUE, (. - listValue ) / 4
|
||||
/*******************************************/
|
||||
/* UnInitialized data */
|
||||
/*******************************************/
|
||||
.bss
|
||||
.align 4
|
||||
hashExemple: .skip hash_end * NBINDEX
|
||||
|
||||
/*******************************************/
|
||||
/* code section */
|
||||
/*******************************************/
|
||||
.text
|
||||
.global main
|
||||
main:
|
||||
ldr r0,iAdrszMessDebutPgm
|
||||
bl affichageMess
|
||||
|
||||
ldr r4,iAdrlistIndex @ index list address
|
||||
ldr r5,iAdrlistValue @ value list address
|
||||
ldr r6,iAdrhashExemple
|
||||
mov r1,#hash_end @ size one record
|
||||
mov r3,#0 @ indice
|
||||
1:
|
||||
ldr r2,[r4,r3,lsl #2] @ load one index address
|
||||
mul r7,r3,r1 @ compute offset oh hah index address
|
||||
str r2,[r6,r7] @ store index address in hah index address
|
||||
ldr r2,[r5,r3,lsl #2] @ load one value address
|
||||
add r7,#hash_value @ compute offset hash value address
|
||||
str r2,[r6,r7] @ store value address in hash value address
|
||||
|
||||
add r3,r3,#1 @ increment indice
|
||||
cmp r3,#NBINDEX @ end ?
|
||||
blt 1b
|
||||
|
||||
ldr r0,iAdrhashExemple @ hash address
|
||||
mov r1,#NBINDEX @ record umber
|
||||
bl displayHash @ display
|
||||
|
||||
ldr r0,iAdrszMessFinOK
|
||||
bl affichageMess
|
||||
|
||||
100: @ standard end of the program
|
||||
mov r0, #0 @ return code
|
||||
mov r7, #EXIT @ request to exit program
|
||||
svc 0 @ perform system call
|
||||
iAdrszMessDebutPgm: .int szMessDebutPgm
|
||||
iAdrszMessFinOK: .int szMessFinOK
|
||||
iAdrszCarriageReturn: .int szCarriageReturn
|
||||
iAdrlistValue: .int listValue
|
||||
iAdrlistIndex: .int listIndex
|
||||
iAdrhashExemple: .int hashExemple
|
||||
/******************************************************************/
|
||||
/* display hash array */
|
||||
/******************************************************************/
|
||||
/* r0 contains hash list address */
|
||||
/* r1 contains number lines */
|
||||
displayHash:
|
||||
push {r1-r5,lr} @ save registers
|
||||
mov r4,r0 @ save hash address
|
||||
mov r2,#0 @ indice
|
||||
mov r3,#hash_end @ size record hash
|
||||
1:
|
||||
ldr r0,iAdrszMessIndex @ display index libellé
|
||||
bl affichageMess
|
||||
mul r5,r2,r3 @ compute hash index offset
|
||||
ldr r0,[r4,r5] @ load address index
|
||||
bl affichageMess @ and display
|
||||
ldr r0,iAdrszMessValue @ display value libellé
|
||||
bl affichageMess
|
||||
add r5,r5,#hash_value @ compute offset hash value
|
||||
ldr r0,[r4,r5] @ load address value
|
||||
bl affichageMess @ and display
|
||||
ldr r0,iAdrszCarriageReturn
|
||||
bl affichageMess
|
||||
add r2,r2,#1 @ increment indice
|
||||
cmp r2,r1 @ end ?
|
||||
blt 1b @ no -> loop
|
||||
|
||||
100:
|
||||
pop {r1-r5,pc} @ restaur registers
|
||||
iAdrszMessIndex: .int szMessIndex
|
||||
iAdrszMessValue: .int szMessValue
|
||||
|
||||
/***************************************************/
|
||||
/* ROUTINES INCLUDE */
|
||||
/***************************************************/
|
||||
.include "../affichage.inc"
|
||||
Loading…
Add table
Add a link
Reference in a new issue