Question

Write an Assembler Program to input a string from the keyboard, store the string in memory....

Write an Assembler Program to input a string from the keyboard, store the string in

memory. Your program should check and display if the string contains vowel letters (A, E, I, O, U),

Hint: your program should check both lower and upper case

Homework Answers

Answer #1

Program:

.MODEL SMALL

.STACK 64

.DATA

MAXCHAR DB 60;

ACTCHAR DB ?;

STR DB 60 DUP (?);

VOWEL_NO DB 0;

NEWLN DB 0DH,0AH,”$”;

CHECK STR DB 65, 69, 73, 79, 85, 97, 101, 105, 111, 117; {A, B, …. Z = 65, 66 …. 90 : a, b, … z = 97, 98, …122}

.CODE

MAIN PROC

MOV AX, @DATA;                            initialize data segment

MOV DS, AX;                                      register

LEA DX, MAXCHAR;                         compute address of value

MOV AH, 0AH;                                   Getline function

INT 21H;                                               Get input

CALL NEXT LINE;                               New Line

MOV CL, ACTCHAR;

MOV CH, 0;

MOV, 0;

L1:          PUSH CX;                                             Save Register

MOV DL, STR[BX];

MOV CX, 10;

MOV SI, 0;

L3:          CMP DL, CHECK STR[SI];                compare DL and str[si]

JZ L2;                                                     jump to label L2 if CF = 1

INC SI;                                                   Add 1 to contents of SI register

LOOP L3;                                              Repeat until all elements adjusted

JMP L4;                                                 Jump to L4 without any condition

L2:          INC VOWEL_NO;                              Add 1 to content of Vowel no

MOV AH, 02H;                                   Put the immediate number

INT 21H;                                               Get input

L4:          INC BX;                                                 Add 1 to contents of BX register

POP CX;                                                Copy a word from the top of stack to CX

;                                               Increment SP by 2

LOOP L1;                                              Repeat until all elements adjusted

CALL VOWEL COUNT DISP

MOV AX, 4000H;                               Put the immediate number

INT 21H;                                               Get input

MAIN ENDP

NEXT LINE PROC NEAR;

LEA DX, NEWLN;                               compute address of value

MOV AH, 09H;                                   Put the immediate number

INT 21H;

RET;                                                       Return to main line

NEXTLINE ENDP

VOWEL COUNT DISP PROC NEW

MOV CX, 10;                                       Put the immediate number

MOV AL, VOWEL_NO;                    Copy word from Vowel no to AL Register

MOV AH, 0;                                         Put the immediate number

MOV BX, 0;                                         Put the immediate number

LABEL1: MOV DX, 0;                                        Put the immediate number

DIV CX;                                                 Divide doubleword in DX and AX by word in CX.

;                                     Quotient in AX, reminder in DX

ADD DX, 30H;                                     Add immediate number 30H to content of DX.

;                                     Result in AL

PUSH DX;                                             Decrement SP by 2, copy DX to stack

INC BX;                                                 Add 1 to contents of BX register

CMP AX, 0;                                          Compare by subtracting 0 from AX

JA LABEL1;                                           Jump to level LABEL1 if AX above 0

MOV AH, A2H;                                   Put the immediate number

MOV CX, BX;                                       Copy word from BX to CX Register

DISP:     POP DX;                                                Copy a word from the top of stack to DX

;                                               Increment SP by 2

INT 21H;                                               Get Input

LOOP DISP;                                         Repeat until all elements adjusted

RET;                                                       return to main program

VOWEL COUNT DISP ENDP

END MAIN;                                         End of main program

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a JAVA program that reads in a string from standard input and determines the following:...
Write a JAVA program that reads in a string from standard input and determines the following: - How many vowels are in the string (FOR THE PURPOSE OF THIS PROGRAM 'Y' is NOT considered a vowel)? - How many upper case characters are in the string? - How many digits are in the string? - How many white space characters are in the string? - Modify the program to indicate which vowel occurs the most. In the case of a...
Write a program that prompts the user to input a string and outputs the string in...
Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use dynamic arrays to store the string.) my code below: /* Your code from Chapter 8, exercise 5 is below. Rewrite the following code to using dynamic arrays. */ #include <iostream> #include <cstring> #include <cctype> using namespace std; int main() { //char str[81]; //creating memory for str array of size 80 using dynamic memory allocation char *str = new char[80]; int len;...
Lab Assignment | Count vowels Write a program that will use a while loop to count...
Lab Assignment | Count vowels Write a program that will use a while loop to count and display the number of vowels in the string provided as input by the end-user. This program will consider the letters a, e, i, o, and u (both upper and lower case) to be vowels. The user may enter a single word, a sentence, a paragraph, or nothing at all as input. Be sure to test each possibility. Python 3 please!
Write a program that takes a string of characters (including spaces) as input, computes the frequency...
Write a program that takes a string of characters (including spaces) as input, computes the frequency of each character, sorts them by frequency, and outputs the Huffman code for each character.   When you are writing your program, you should first test it on a string of 7 characters, so you can check it. PLEASE NOTE: Your program must work for any text that has upper and lower case letters digits 0 - 9, commas, periods, and spaces. Please submit the...
Write a java program that repeatedly prompts the user to input a string starting with letters...
Write a java program that repeatedly prompts the user to input a string starting with letters from the English alphabet. The program must stop getting input when the user inputs the string “STOOOOP”. Then the program must display the words starting with each letter from the alphabet in a separate line (e.g. you need to make a new line after all words starting with a specific letter are finished.
Write a Java application a String input by the user and shows whether the string contains...
Write a Java application a String input by the user and shows whether the string contains all 26 letters of the (English version of the Latin) alphabet. For example, "Pack my box with five dozen liquor jugs" contains all 26 letters, but "The quick frown box jumps over the hazy log" does not contain a d. It does not matter whether one or more letters appear more than once. needs, at minimum, asl user to input for the String, then...
1 Design and implement FileCompare program that compares two text input files (file1.txt and file2.txt), line-by-line,...
1 Design and implement FileCompare program that compares two text input files (file1.txt and file2.txt), line-by-line, for equality. Print any lines that are not equivalent indicating the line numbers in both files. The language of implementation is java 2 . Create a program that reads a string input from the user, then determines and prints how many of each lowercase vowels (a, e. i, o, and u) appear in the entire string. Have a separate counter for each vowel. Also...
Write an ARM Assembly program that obtains integer input from the keyboard. please write comments so...
Write an ARM Assembly program that obtains integer input from the keyboard. please write comments so i can understand what its doing :)
C++ Part B: (String) Program Description: Write a word search program that searches an input data...
C++ Part B: (String) Program Description: Write a word search program that searches an input data file for a word specified by the user. The program should display the number of times the word appears in the input data file. In addition, the program should count and display the number of grammatical characters in the input data file. Your program must do this by providing the following functions : void processFile(ifstream &inFile, string wordSearch, int &wordCount, int &grammaticalCount) ; (15%)...
Write a Java application with a JavaFX GUI that takes a String input by the user...
Write a Java application with a JavaFX GUI that takes a String input by the user and shows whether the string contains all 26 letters of the (English version of the Latin) alphabet. For example, "Pack my box with five dozen liquor jugs" contains all 26 letters, but "The quick frown box jumps over the hazy log" does not contain a d. It does not matter whether one or more letters appear more than once. The GUI needs, at minimum,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT