Question: Write an assembly language program for the LC-3 that obtains 7 characters to search, a string of 2 characters to search for in the string

Write an assembly language program for the LC-3 that obtains 7 characters to search, a string of 2 characters to search for in the string of 7, and 2 characters with which to replace the search string if found. The program will then print the string of 7 with the characters replaced if applicable. The program will then print the string of 7 with the entered as the first character at which time the program will immediately stop. Provide an algorithm. In the assembly language program, provide comments that relate the instructions to the algorithm.

Example:

Input characters: abcdeab

Find: ac

Replace: xy

abcdeab

Input characters: abcdean

Find: ab

Replace: wx

wxcdewx

Input characters: #

-----Halt Processor-----

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!