Hi I'm new to Marie programming language and I have a string with the address NameAddr.
My print subroutine stops printing when it reaches a 0 character (marking the end of the string).So to trim the white spaces I simply iterate backwards from the address of the last character and as long as its a white space I replace it with a 0.
However, my removeSpace subroutine does not terminate and when I step through it its not updating the LastCharAddr properly after I pass in the address of the last character?
//Remove spaces
LastCharAddr, HEX 0
RemoveSpace, HEX 0
Space, DEC 32 //constant needed for subroutine
CharacterReplace, Hex 000 //constant for subroutine
StartRemoveSpace, LoadI LastCharAddr
Subt Space
Skipcond 400 //If its a space
JumpI RemoveSpace //if not a space terminate
Load CharacterReplace //replace with 0
Store LastCharAddr //Replace
Load LastCharAddr
Subt One// iterate backwards
Store LastCharAddr
Jump StartRemoveSpace
Any help will be appreciated thanks!