Question: After creating a new . mas file with the adjusted code that was suggested by the expert it appears the problem is still persisting when

After creating a new .mas file with the adjusted code that was suggested by the expert it appears the problem is still persisting when I run through test cases. However now it appears to move to the CheckROT13 loop which is an improvement from being stuck in the main loop I had previously.
Here is the code as it stands currently. The aim is to have the program move to output after a single period ('.') is entered.
/ Initialization
ORG 100
/ Initialize Ptr (pointer)
Load Start
Store Ptr
/ Main Program
MainLoop, Input / Input a character
Store InVal / Store input in InVal
Load InVal / Load input value to AC
Subt ChPer / Check if input is a period
Skipcond 400/ If AC ==0(input is '.'), jump to OutputStart
Jump CheckROT13
CheckROT13, Jns ROT13/ Call ROT13 subroutine to transform the character
StoreI Ptr / Store the transformed character in memory
Load Ptr / Load pointer address
Add One / Increment pointer
Store Ptr / Store updated pointer
Jump MainLoop / Repeat the input loop
/ Output Phase
OutputStart, Load Start / Initialize pointer to the start of stored characters
Store Ptr
OutputLoop, LoadI Ptr / Load the character from memory
Subt ChPer / Check if the character is '.'
Skipcond 400/ If AC ==0(character is '.'), jump to EndProgram
Output / Output the character
Load Ptr / Load pointer address
Add One / Increment pointer
Store Ptr / Store updated pointer
Jump OutputLoop / Repeat the output loop
EndProgram, Halt / End the program
/ ROT13 Subroutine
ROT13, HEX 0
Load InVal
Add Val13
Store Hold
Subt ChZ
Skipcond 800
Jump NoAdj
Add ChA
Jump Done
NoAdj, Load Hold
Done, JumpI ROT13
/ Constants
ChA, HEX 0041/ Constant value 'A'
ChZ, HEX 005A / Constant value 'Z'
ChPer, HEX 002E / Constant period char '.'
Val13, DEC 13/ Constant ROT13 value
One, HEX 1/ Constant value 1
Start, HEX 200/ Constant address for starting memory location
/ Data Area
InVal, HEX 0/ Subroutine input value
Hold, HEX 0/ Temporary variable
Ptr, HEX 0/ Character pointer

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!