我的print子例程在到达0字符(标记字符串的结尾)时停止打印。因此,为了修剪空白,我只需从最后一个字符的地址向后迭代,只要是空白,我就用0替换它。
//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
任何帮助都将不胜感激谢谢!