Rars Rise V please
Write a program that inserts a minus “-“ between all (!)double-consonants:
Tunnel -> Tun-nel Busseat -> Bus-seat
And so on..
Howto:
Write a program that lets you enter a string.
Use ecall(12) readchar for that in a loop until carriagereturn.
The string can be limited to 30 letters.
Make a static string array in the data section holding at least40 letters.
Loop over the string searching for double-consonants.
Have a second string for the result.
Print the result string.
You can use:
.global _start # Provide program starting address to linker_start:
#loop
addi a7, x0, 12 # linux write system call
ecall .data
sourcestring: .ascii \" \" #30
targetstring: .ascii \" \"#40