Question: Hi please helpp me with this MARIE ASSEMBLY code.I got this string with the address name as NameAddr. The string ends with a 0 character

Hi please helpp me with this MARIE ASSEMBLY code.I got this string with the address name as NameAddr. The string ends with a 0 character (HEX 000) .Currently my trim string function can find the address of the last character(0 character). However, now I need to iterate backwards and replace any spaces in the string with a 0 character using my removeSpace function. Problem is my function doesn't terminate?

TrimStringAddr, HEX 0 / address of string to trim TrimString, HEX 0 / <--- this is where you add your code for trimming a string StartTrim, LoadI TrimStringAddr Skipcond 800 JumpI TrimString / Return if character is 0 Load TrimStringAddr Add One Store TrimStringAddr Jump StartTrim //INSPECT CODE HERE //Remove spaces RemoveStringAddr, HEX 0 RemoveSpace, HEX 0 Space, DEC 32 CharacterReplace, Hex 000 StartStringAdr, HEX 0 LoadI NameAddr Store StartStringAdr

StartRemoveSpace, LoadI TrimStringAddr Subt StartStringAdr Skipcond 400//if at the start of the string, JumpI RemoveSpace LoadI TrimStringAddr Subt Space Skipcond 400//If its a space Load CharacterReplace //STORE ORI VALUE OF TRIMSTRING NOT THE ONE THAT SUBTRACT SPACE? Store TrimStringAddr//Replace Subt One//else store and iterate Jump StartRemoveSpace

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!