

Task

Split a (character) string into comma (plus a blank) delimited
strings based on a change of character   (left to right).

Show the output here   (use the 1st example below).



Blanks should be treated as any other character   (except
they are problematic to display clearly).   The same applies
to commas.



For instance, the string:

 gHHH5YY++///\ 

should be split and show:

 g, HHH, 5, YY, ++, ///, \ 




Other tasks related to string operations:

Metrics
 Array length
 String length
 Copy a string
 Empty string  (assignment)
Counting
 Word frequency
 Letter frequency
 Jewels and stones
 I before E except after C
 Bioinformatics/base count
 Count occurrences of a substring
 Count how many vowels and consonants occur in a string
Remove/replace
 XXXX redacted
 Conjugate a Latin verb
 Remove vowels from a string
 String interpolation (included)
 Strip block comments
 Strip comments from a string
 Strip a set of characters from a string
 Strip whitespace from a string -- top and tail
 Strip control codes and extended characters from a string
Anagrams/Derangements/shuffling
 Word wheel
 ABC problem
 Sattolo cycle
 Knuth shuffle
 Ordered words
 Superpermutation minimisation
 Textonyms (using a phone text pad)
 Anagrams
 Anagrams/Deranged anagrams
 Permutations/Derangements
Find/Search/Determine
 ABC words
 Odd words
 Word ladder
 Semordnilap
 Word search
 Wordiff  (game)
 String matching
 Tea cup rim text
 Alternade words
 Changeable words
 State name puzzle
 String comparison
 Unique characters
 Unique characters in each string
 Extract file extension
 Levenshtein distance
 Palindrome detection
 Common list elements
 Longest common suffix
 Longest common prefix
 Compare a list of strings 
 Longest common substring
 Find common directory path
 Words from neighbour ones
 Change e letters to i in words
 Non-continuous subsequences
 Longest common subsequence
 Longest palindromic substrings
 Longest increasing subsequence
 Words containing "the" substring
 Sum of the digits of n is substring of n
 Determine if a string is numeric
 Determine if a string is collapsible
 Determine if a string is squeezable
 Determine if a string has all unique characters
 Determine if a string has all the same characters
 Longest substrings without repeating characters
 Find words which contains all the vowels
 Find words which contains most consonants
 Find words which contains more than 3 vowels
 Find words which first and last three letters are equals
 Find words which odd letters are consonants and even letters are vowels or vice_versa
Formatting
 Substring
 Rep-string
 Word wrap
 String case
 Align columns
 Literals/String
 Repeat a string
 Brace expansion
 Brace expansion using ranges
 Reverse a string
 Phrase reversals
 Comma quibbling
 Special characters
 String concatenation
 Substring/Top and tail
 Commatizing numbers
 Reverse words in a string
 Suffixation of decimal numbers
 Long literals, with continuations 
 Numerical and alphabetical suffixes
 Abbreviations, easy
 Abbreviations, simple
 Abbreviations, automatic
Song lyrics/poems/Mad Libs/phrases
 Mad Libs
 Magic 8-ball
 99 Bottles of Beer
 The Name Game (a song)
 The Old lady swallowed a fly
 The Twelve Days of Christmas
Tokenize
 Text between
 Tokenize a string
 Word break problem
 Tokenize a string with escaping
 Split a character string based on change of character
Sequences
 Show ASCII table
 De Bruijn sequences
 Self-referential sequences
 Generate lower case ASCII alphabet




 
/* ARM assembly AARCH64 Raspberry PI 3B */
/*  program splitcar64.s   */
 
/*******************************************/
/* Constantes file                         */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
 
/*********************************/
/* Initialized data              */
/*********************************/
.data
szCarriageReturn:   .asciz "\n"
szString1:          .asciz "gHHH5YY++///\\"
/*   IMPORTANT REMARK for compiler as 
The way to get special characters into a string is to escape these characters: precede them
with a backslash ‘\’ character. For example ‘\\’ represents one backslash: the first \ is
an escape which tells as to interpret the second character literally as a backslash (which
prevents as from recognizing the second \ as an escape character).
*/
 
/*********************************/
/* UnInitialized data            */
/*********************************/
.bss  
sBuffer:               .skip  100
 
/*********************************/
/*  code section                 */
/*********************************/
.text
.global main 
main:                              // entry of program 
 
    ldr x0,qAdrszString1           // input string address
    ldr x1,qAdrsBuffer             // output buffer address
    bl split 
 
    ldr x0,qAdrsBuffer
    bl affichageMess               // display message
    ldr x0,qAdrszCarriageReturn
    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
 
qAdrszString1:            .quad szString1
qAdrszCarriageReturn:     .quad szCarriageReturn
qAdrsBuffer:              .quad sBuffer
 
/******************************************************************/
/*     generate value                                  */ 
/******************************************************************/
/* x0 contains the address of input string  */
/* x1 contains the address of output buffer  */
 
split:
    stp x1,lr,[sp,-16]!            // save  registers
    mov x4,0                       // indice loop input string
    mov x5,0                       // indice buffer
    ldrb w2,[x0,x4]                // read first char in reg x2
    cbz x2,4f                       // if null -> end
    strb w2,[x1,x5]                // store char in buffer
    add x5,x5,1                    // increment location buffer
1:
    ldrb w3,[x0,x4]                //read char[x4] in reg x3
    cbz x3,4f                      // if null  end
    cmp x2,x3                      // compare two characters
    bne 2f
    strb w3,[x1,x5]                // = -> store char in buffer   
    b 3f                           // loop
2:
    mov x2,','                    // else store comma in buffer
    strb w2,[x1,x5]                // store char in buffer
    add x5,x5,1
    mov x2,' '                    // and store space in buffer
    strb w2,[x1,x5]
    add x5,x5,1
    strb w3,[x1,x5]               // and store input char in buffer
    mov x2,x3                     // and maj x2 with new char
3:
    add x5,x5,1                   // increment indices
    add x4,x4,1
    b 1b                          // and loop
4:
    strb w3,[x1,x5]               // store zero final in buffer
100:
    ldp x1,lr,[sp],16             // restaur  2 registers
    ret                           // return to address lr x30
/********************************************************/
/*        File Include fonctions                        */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
 