Question

Write a program that will allow the user to specify how many times the program will...

Write a program that will allow the user to specify how many times the program will loop and display the title of the program include your name in the title, print from in the loop a string and count.

-Assembly Language MASM 8086

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

COPY TO CODE:


.model small
.stack 100h
.data

;prompt for input
prompt db 'Enter the number of line : $'

;it wil print message
lineToPrint db 'hello my name is shahrukh : $'

.code
main proc

;to print counter
Mov bl,'0'

mov ax,@data ;move data address to ax
mov ds,ax ;move ax to data segment   
  
  
lea dx , prompt ;if use lea no need to use offset
mov ah,9 ;ask to print array of string
int 21h


mov ah,1 ;input function
int 21h

;convert ascii value to integer input
sub al,30h
mov ch,0
mov cl,al ;save the value from input

srk:

mov dx,10 ;print \n
mov ah,2
int 21h   

mov dx,13 ;cursor at first position
mov ah,2
int 21h


lea dx , lineToPrint ;if use lea no need to use offset

mov ah,9 ;ask to print array of string
int 21h


add bl,1
mov dl,bl

mov ah,2
int 21h  
  


loop srk   
  
  

mov ah,4ch
int 21h
main endp
end main

OUTPUT:

emulator: printStringnumberOfLoop.exe file math debug view external virtual devices er of line $ name is sha St emulator scre

Add a comment
Know the answer?
Add Answer to:
Write a program that will allow the user to specify how many times the program will...
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
  • I need the following done in MASM (Assmebly or ASM) This program must use Irvine Library and the outline for the code is...

    I need the following done in MASM (Assmebly or ASM) This program must use Irvine Library and the outline for the code is below (Kip irvine) Write an assembly language program to input a string from the user. Your program should do these two things: 1. count and display the number of words in the user input string. 2. Flip the case of each character from upper to lower or lower to upper. For example if the user types in:   ...

  • Programming: Write a SPIM assembly language program num-vowel.s based on the hardware implementation method in the...

    Programming: Write a SPIM assembly language program num-vowel.s based on the hardware implementation method in the lab notes and the above practice. The program will do the following: Prompt the user to enter a string. The program will call the procedure vowelp to check if a character entered in the string is a vowel or not. Count how many vowels and how many non-vowels are in the string. Print out the calculated results with appropriate message. Hint: A loop is...

  • Write a x64 MASM program using ReadConsoleA and WriteConsoleA to prompt the user for their name....

    Write a x64 MASM program using ReadConsoleA and WriteConsoleA to prompt the user for their name. The program should then display the user's name surrounded by asterisks. Allow the name to be up to 30 characters long. Example (user input is boldface, and there are 28 asterisks on the top and bottom lines): What is your name? Kristin Jacobs **************************** *Kristin Jacobs * **************************** Copy / Paste a sample run from the console screen into your .asm file following your...

  • Write a C program that prompts the user for the number for times the user wants...

    Write a C program that prompts the user for the number for times the user wants to flip a coin. Your program will flip a virtual coin that number of times and return the following: 1) The number of times heads occurred. 2) The number of times tails occured. Then take the coin flip program and modify the random number generator to roll a single 6-sided dice.   DO NOT DISPLAY THE RESULTS OF EACH ROLL. 1) Ask the user how...

  • Write a program that asks the user to enter a string and then asks the user...

    Write a program that asks the user to enter a string and then asks the user to enter a character. The program should count and display the number of times that the specified character appears in the string. python programming

  • LANGUAGE = C i. Write a program that takes int numbers from user until user gives...

    LANGUAGE = C i. Write a program that takes int numbers from user until user gives a sentinel value (loop terminating condition). Sort the numbers in ascending order using Insertion sort method. Sorting part should be done in different function named insertionSort(). Your code should count the number of swaps required to sort the numbers. Print the sorted list and total number of swaps that was required to sort those numbers. (4 marks) ii. In this part take another number...

  • ssembly Language Programming with x86, IRVINe MASM 1. Write a program to add 7 12 times...

    ssembly Language Programming with x86, IRVINe MASM 1. Write a program to add 7 12 times and print out the result ------------------------------------------------------------------------------- Write a program to print and add 10 20 30 40 50   ; you can use a loop The output should be “The sum of 10 20 30 40 50 ”

  • Write a C++ program to allow an user to enter username and password, and then compare...

    Write a C++ program to allow an user to enter username and password, and then compare the entered values with the values which stored in a file called login.txt. Display an message "Login successful" if the values are matched, otherwise display "Login fail!. This program allow the user to have three times of tries, if exceeded the number of times, display a message "Number of times is exceeded, please contact administrator (Assume, the stored username is "INTI-IU and password is...

  • 21 Write a program that asks the user to input the length and breadth of a...

    21 Write a program that asks the user to input the length and breadth of a soccer field, and then computes and returns the number of square meters of grass required to cover the field The formula for the area is the product of length and breadth (5) 22 The following program uses the break statement to terminate an infinite while loop to print 5 numbers Rewrite the program to use a while loop to display numbers from 1 to...

  • write a program code that asks the user how many numbers they wish to find the...

    write a program code that asks the user how many numbers they wish to find the statistics of and then asks the user to enter those numbers. The program must then calculate and display the average variance and standard deviation of the numbers entered by the user. the program code must -ask three user how many numbers they wish to find the statistics of -ask the user to enter those numbers and store them in an array - use a...

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