Subject Computer Science Assembly Language Programming

Question

Write a program that reads a paragraph from the keyboard and processes it in the following fashion:
- Calculate the number of words in the paragraph
- Calculate the number of lines of text in the paragraph
- Calculate the number of characters that are the same as the 3rd letter of your last name.

   
Terminate the paragraph with special character (it should be the character above numerical key of the regular keyboard; your numerical key = [(the last digit of your ID) MODULO 7] +1).
Display results on screen.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

include irvine32.inc    ; from Irvine CDROM

.stack 4096

.data
getname_msg byte "enter your last name ", 0
getid_msg byte "enter your id ", 0
paragraph byte "enter paragraph : ", 0
words byte "the number of words in the paragraph ", 0
lines byte "the number of lines of text in the paragraph ", 0
sames byte "the number of characters that are the same as the 3rd letter of your last name ", 0

word_num dword 0
line_num dword 1
third_letter_count dword 0
CR equ 0Dh ; carrier return
last_name byte 30 dup(0)
id byte 20 dup(0)

last_name_bytes_count dword ?
third_letter byte ?
terminate_letter byte ?
previous byte ' '

.code
main proc

call getid ; get id and special charater
call getname ; get name and the 3rd charatger...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Raid Simulation Program Using Assembly Language
Homework Solution
$150.00
Assembly Language
Programming
Computer Science
Algorithms
Strings
Files
XOR
Commands
Input
Output
Bytes
System Kernel
Loop Counter
Pointers
Memory
Variables
Assembly Language Problems With Fibonacci Numbers
Homework Solution
$30.00
Assembly Language
Computer Science
Programming
Fibonacci Numbers
Arrays
European Mathematics
Indian Mathematics
Sequences
Characters
Strings
Columns
Rows
Values
Memory
Stack
Macros
Boolean
Registers
Get help from a qualified tutor
Live Chats