Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

org 100h MOV DI,0 MOV CX,0 MOV DX, OFFSET MSG MOV AH,9 INT 21H GETWORD: MOV AH,00 INT 16H CMP AL,0DH JE PRINT MOV AH,0EH

org 100h MOV DI,0 MOV CX,0 MOV DX, OFFSET MSG MOV AH,9 INT 21H

GETWORD: MOV AH,00 INT 16H CMP AL,0DH JE PRINT MOV AH,0EH INT 10H MOV ARR[DI],AL INC DI INC CX JMP GETWORD PRINT: MOV DX, OFFSET MSGPRINT MOV AH,9 INT 21H MOV DI,0 LOOP1: MOV AL, ARR[DI] MOV AH,0EH INT 10H MOV AL, ' ' MOV AH,0EH INT 10H INC DI Loop LOOP1: ret

ARR DB 26 DUP(0) MSG DB "ENTER INPUT:$" MSGPRINT DB " > $" NEWLINE DB 13,10,"$"

I HAVE THIS PART OF MY CODE. Could you complete the code using the code snippet I provided below, according to the requirements I've given?

Become familiar with program control instructions.

Write an assembly program that can get a text input and find the characters that the indices in the given text and alphabet match. (You must use the English alphabet). The program must be able to run infinitely until the user enters TERMINATE as input. For example, for the given text AYTDEKZHEUKHOM, the result is A, D, E, H, K > 5:

INDEXES LETTERS

1 A 2 B 3 C 4 D 5 E 6 F 7 G 8 H 9 I 10 J 11 K 12 L 13 M 14 N 15 O 16 P 17 Q 18 R 19 S 20 T 21 U 22 V 23 W 24 X 25 Y 26 Z

'A' index in text:1, index in alphabet:1 match 'Y' index in text:2, index in alphabet:25 no match 'T' index in text:3, index in alphabet:20 no match 'D' index in text:4, index in alphabet:4 match 'E' index in text:5, index in alphabet:5 match 'K' index in text:6, index in alphabet:11 no match 'Z' index in text:7, index in alphabet:26 no match 'H' index in text:8, index in alphabet:8 match 'E' index in text:9, index in alphabet:5 match 'U' index in text:10, index in alphabet:21 no match 'K' index in text:11, index in alphabet:11 match 'H' index in text:12, index in alphabet:8 match 'O' index in text:13, index in alphabet:15 no match 'M' index in text:14, index in alphabet:13 no match

1. Get a text as an input using Emulator Screen. The program must only accept capital letters. The program must check whether the entered character is a capital letter and if it is not, it can be neither processed nor printed. For example, if the user enters C1E?+N:*+G then the program must not print 1, ?, +, :, * and print only CENG. When the Enter key is pressed, the program must get the printed text as input and start processing. 2. When the program gets the input from the user, it must check each character if the required match occurs and store the matched characters. 3. Finally, the program prints the matched characters and the count of matched characters on the Emulator Screen and waits for the new text until the new text is TERMINATE.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions