Compare length of two strings: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 91: Line 91:
=={{header|ARM Assembly}}==
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi <br> or android 32 bits with application Termux}}
{{works with|as|Raspberry Pi <br> or android 32 bits with application Termux}}
<lang ARM Assembly>
<syntaxhighlight lang ARM Assembly>
/* ARM assembly Raspberry PI or android 32 bits */
/* ARM assembly Raspberry PI or android 32 bits */
/* program complength.s */
/* program complength.s */
Line 101: Line 101:


/* for constantes see task include a file in arm assembly */
/* for constantes see task include a file in arm assembly */

/************************************/
/************************************/
/* Constantes */
/* Constantes */
/************************************/
/************************************/

.include "../constantes.inc"
.include "../constantes.inc"
/************************************/
/************************************/
/* structures */
/* structures */
/************************************/
/************************************/

.struct 0
.struct 0
list_string: @ string address
list_string: @ string address
Line 120: Line 117:
/* Initialized data */
/* Initialized data */
/*********************************/
/*********************************/

.data
.data
szMessResult: .asciz "@ length : @\n"
szMessResult: .asciz "@ length : @\n"
Line 230: Line 226:
100:
100:
pop {r1-r2,pc} @ restaur registers
pop {r1-r2,pc} @ restaur registers

/******************************************************************/
/******************************************************************/
/* insertion sort */
/* insertion sort */
/******************************************************************/
/******************************************************************/

/* r0 contains the address of table */
/* r0 contains the address of table */
/* r1 contains the first element */
/* r1 contains the first element */
/* r2 contains the number of element */
/* r2 contains the number of element */

insertionSort:
insertionSort:
push {r1-r10,lr} @ save registers
push {r1-r10,lr} @ save registers
Line 278: Line 271:
/* ROUTINES INCLUDE */
/* ROUTINES INCLUDE */
/***************************************************/
/***************************************************/

.include "../affichage.inc"
.include "../affichage.inc"
</syntaxhighlight>
</lang>
<pre>
<pre>
abcd length : 4
abcd length : 4