Question

FINAL Project 1-) Please submit the solution of your final as Ms-word or PDF document 2-)...

FINAL Project

1-) Please submit the solution of your final as Ms-word or PDF document

2-) Complete THREE QUESTIONS out of the four exam questions below.

3-) FOR EACH QUESTION, IT IS REQUIRED to include Ms-Word or Pdf file contains the following

A. Source file and sample of your output screen shots.

B. Up to one page of your program discussion. In the discussion, state the issues that you may have problem with if there is any. Why your program is not running (if it is not)? What was your approach (Your process to the solution)? How did you overcome the issues while writing the program?

C. Write your conclusion as what you have learned from this program.

Not including this report will result of losing 30% because I would not know if you really the one who did it or not.

YOUR REPORT WILL VERIFY THE UNDERSTANDING OF YOUR WORK, AND THAT YOU REALLY DID IT.

Question One: Write an assembly language program that allows a user to enter any 5 numbers then display the sum of the entered 5 numbers.

For example:

Enter: 1, 2, 3, 4, 5

Output First Line: Display: Sum of the Entered is: 15

Output Second Line: Display: Division of entered digit number 4 by entered digit number two 2 so (4/( 2 = 2)  

Question Two: Write an assembly language program that allows a user to enter any 6 numbers in any order then display the largest and smallest entered number and the order from small to large and then large to small

For example

Enter: 4, , 2, 7, 9, 6, 1

Display:

Largest entered number is: 9

Smallest entered number is: 1

Large to Small: 9, 7, 6, 4, 2, 1

Small to Large: 1, 2, 4, 6, 7, 9

Question Three: Write an assembly language program to count number of vowels in any given string.

Question Four: Write a procedure named Get_frequencies that constructs a character frequency table. Input to the procedure should be a pointer to a string, and a pointer to an array of 256 doublewords. Each array position is indexed by its corresponding ASCII code. When the procedure returns, each entry in the array contains a count of how many times that character occurred in the string. Include the source code only.


0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer One:

  1. INCLUDE io.h
  2. Cr EQU 0ah
  3. Lf EQU 0dh
  4. data SEGMENT
  5. p_a DB cr, lf, 'Enter a: ',0
  6. p_b DB lf, 'Enter b: ',0
  7. p_c DB lf, 'Enter c: ',0
  8. p_sum DB cr, lf, 'The sum is: ',0
  9. p_avg DB cr, lf, 'The avg is: ',0
  10. tmpstr DW 40 DUP (?)
  11. data ENDS
  12. code SEGMENT
  13. ASSUME cs:code, ds:data
  14. start: mov ax, data
  15. mov ds, ax
  16. ;input a
  17. output p_a
  18. inputs tmpstr, 10
  19. atoi tmpstr
  20. mov dx, ax
  21. ;input b
  22. output p_b
  23. inputs tmpstr, 10
  24. atoi tmpstr
  25. add dx, ax
  26. ;input c
  27. output p_c
  28. inputs tmpstr, 10
  29. atoi tmpstr
  30. add dx, ax
  31. ;find and print sum
  32. output p_sum
  33. mov ax, dx
  34. itoa tmpstr, ax
  35. output tmpstr
  36. ;find and print average
  37. output p_avg
  38. cwd
  39. mov cx, 3
  40. idiv cx
  41. itoa tmpstr, ax
  42. output tmpstr
  43. quit: mov al, 00h
  44. mov ah, 4ch
  45. int 21h
  46. code ENDS
  47. END start

Answer Two:

MEMORY ADDRESS MNEMONICS COMMENT
2000 LXI H 2050 H←20, L←50
2003 MOV C, M C←M
2004 DCR C C←C-01
2005 INX H HL←HL+0001
2006 MOV A, M A←M
2007 INX H HL←HL+0001
2008 CMP M A-M
2009 JNC 200D If Carry Flag=0, goto 200D
200C MOV A, M A←M
200D DCR C C←C-1
200E JNZ 2007 If Zero Flag=0, goto 2007
2011 STA 3050 A→3050
2014 HLT

Answer 3:

  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4. STRING DB "The quick brown fox jumped over lazy sleeping dog$"
  5. VOWEL DB ?
  6. .CODE
  7. MAIN PROC
  8. MOV AX, @DATA
  9. MOV DS, AX
  10. MOV SI, OFFSET STRING  
  11. MOV BL, 00     
  12. BACK: MOV AL, [SI]
  13. CMP AL,'$'
  14. JZ FINAL
  15. CMP AL,'A'
  16. JZ COUNT   
  17. CMP AL,'E'
  18. JZ COUNT   
  19. CMP AL,'I'
  20. JZ COUNT   
  21. CMP AL,'O'
  22. JZ COUNT   
  23. CMP AL,'U'
  24. JZ COUNT
  25. CMP AL,'a'
  26. JZ COUNT   
  27. CMP AL,'e'
  28. JZ COUNT   
  29. CMP AL,'i'
  30. JZ COUNT   
  31. CMP AL,'o'
  32. JZ COUNT   
  33. CMP AL,'u'
  34. JZ COUNT   
  35. INC SI
  36. JMP BACK
  37. COUNT: INC BL
  38. MOV VOWEL, BL
  39. INC SI
  40. JMP BACK
  41. FINAL: MOV AH, 4CH
  42. INT 21H
  43. MAIN ENDP.
  44. END.
Add a comment
Know the answer?
Add Answer to:
FINAL Project 1-) Please submit the solution of your final as Ms-word or PDF document 2-)...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assembly Language////Write a program that read in 10 integers from the user. Save the numbers into...

    Assembly Language////Write a program that read in 10 integers from the user. Save the numbers into an array; reverse the array and display the reversed array. .data arrayInt DWORD 10 DUP(?) Your program consists of 4 procedures: 1. main procedure: call procedures getInput, reverseArray, displayArray 2. getInput procedure: prompt user to enter 10 integer numbers, save the numbers into the memory for the arrayInt 3. reverseArray: reverse arrayInt 4. displayArray: display the reversed array

  • Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int...

    Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int *a2) Write a program addition.c that reads in an array (a1) of numbers, and creates a new array (a2) of numbers such that the first and last numbers of a1 are added and stored as the first number, the second and second-to-last numbers are added and stored as the second number, and so on. You need to check for even and odd length of...

  • build a phone number from digits entered by your user. Your program will loop until 10...

    build a phone number from digits entered by your user. Your program will loop until 10 valid digits have been entered. It will then use those digits to display the phone number entered using the format: XXXXXXXXXX (or (XXX) XXX – XXXX for extra credit). The program will ask for a digit, it will check to see if the digit is actually between 0 and 9 inclusively. If so, the digit will be stored as the next number in the...

  • c++ #include <iostream> #include <string> using namespace std; /* Write a function checkPrime such that input:...

    c++ #include <iostream> #include <string> using namespace std; /* Write a function checkPrime such that input: an int output: boolean function: Return true if the number is a prime number and return false otherwise */ //TO DO ************************************** /* Write a function checkPrime such that input: an array of int and size of array output: nothing function: Display the prime numbers of the array */ //TO DO ************************************** /* Write a function SumofPrimes such that input: an int output: nothing...

  • Java Switch Case Make From Pseudocode

    The following pseudo-code describes a menu-driven algorithm:loopask the user to input one of the characters a, b, c, d, e, q read in a character from the keyboardif the character is'a' output your name and your tutor's name (hard-coded) 'b' input 3 double numbers x, y, z and output the largestand the smallest of the three numbers'c' input 2 integer numbers m and n, and display all thenumbers between m and n (both inclusive) with five numbers per line (note...

  • c++ pleased Assignment 6a (15 points] - Character and String related processing... Listed below are two...

    c++ pleased Assignment 6a (15 points] - Character and String related processing... Listed below are two interesting programming challenges that will require a bit of character and/or string related processing with functions. (Carefully read the specifications for each programming challenge and select ONE.) (1) Sum of Digits in a String Write a program that asks the user to enter a series of single-digit numbers with nothing separating them. Read the input as a C-string or a string object. The program...

  • 2. Searching a String: Write a MIPS assembly language program to do the following: Read a...

    2. Searching a String: Write a MIPS assembly language program to do the following: Read a string and store it in memory. Limit the string length to 100 characters. Then, ask the user to enter a character. Search and count the number of occurrences of the character in the string. The search is not case sensitive. Lowercase and uppercase letters should be equal. Then ask the user to enter a string of two characters. Search and count the number of...

  • PA #1: Word Counter Tabulating basic document statistics is an interesting exercise that leverages your knowledge...

    PA #1: Word Counter Tabulating basic document statistics is an interesting exercise that leverages your knowledge of strings, files, loops, and arrays. In this homework, you must write a C++ program that asks the user for an input and output file. For each line in the input file, write a modified line containing a line number to the output file. Additionally, calculate the number of paragraphs, lines, words, and characters. Write the summary information to the bottom of the output...

  • PLEASE HELP!!!I need help with the following JAVA PROGRAMS. Please ready carefully. So this comes from...

    PLEASE HELP!!!I need help with the following JAVA PROGRAMS. Please ready carefully. So this comes from tony gaddis starting out with java book. I have included the screenshot of the problems for reference. I need HELP implementing these two problems TOGETHER. There should be TWO class files. One which has TWO methods (one to implement problem 8, and one to implement problem 9). The second class should consist of the MAIN program with the MAIN method which calls those methods....

  • please solve it before 11:15 today Subject :C++ programming - Lab_9_Sec 51.pdf 1411113: Programming for Engineers...

    please solve it before 11:15 today Subject :C++ programming - Lab_9_Sec 51.pdf 1411113: Programming for Engineers Fall 2017/2018 LAB #9 Name: ID: Date Section Objectives: After completing this lab, you will be able to .Analyze a problem. .Implement the solution in C++ . Practice arrays and strings. Lab Exc. Mark Score Correct input/output Computational correctness Correct input/output Computational correctness Exercise#1: Number of occurrences in an array Write a program that fills an array with 10 random numbers between 0 and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT