Practice 15
Create a project called Practice 15. Write a program that asks the user to enter a file name. The file directory will be your own project folder. also, the file should have a small text, no longer than 50 characters. Read the file into a buffer that is larger than 50 characters. Search the buffer for the letter "a" and replace it with capital "A". Then write the buffer to a file called test.txt inside your own project folder, and display a message that the following text ... was written to test.txt. Of course, replace the dots with the text found in the user's file.   

Reading and Displaying Large Files
Create a program that will ask the user to enter the name of a text file. The text file should be in your project folder, so that you can upload it with your archived folder. The length of the text file should be at least 640 characters. Read the file in a buffer. The buffer has to be 64 bytes. Since your text file is larger than the buffer, you will have to take from the text file 64 bytes at a time and then display them in the console.

Solution PreviewSolution 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.

filename BYTE 80 DUP(0)
fileHandle HANDLE ?
msg BYTE 0dh, 0ah, "Here is the text:", 0dh,0ah, 0dh, 0ah,0
main PROC
; Let user input a filename.
mWrite "Enter an input filename: " ; output message
mov edx,OFFSET filename ; setup input buffer
mov ecx,SIZEOF filename ; setup size of buffer
call ReadString ; read string

; Open the file for input.
mov edx,OFFSET filename ; prepare to open the file
call OpenInputFile ; open file
mov fileHandle,eax ; store address of pointer to the file

; Check for errors.
cmp eax,INVALID_HANDLE_VALUE ; error opening file?
jne file_ok...
$60.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats