Program to perform a conversion on characters in a text file, Assembly Language

Assignment Help:

Write an assembly language program to perform a rot131 conversion on characters in a text file.  The program should read charatcers from the input file, perform the rot13 conversion, and write the characters to the output file.  The program should read the buffer size (large or small), name of an input file, and the name of an output file from the command line.  For example:

ed-vm% ./rot13  -b l  -i file.txt  -o tmp.txt

The provided main program calls the following routines:

? A getOptions() procedure that reads and checks the command line arguments. The command line arguments must be in the format of:  /b= /i= /o= in that order.  The buffer size should be "l" or "s".  To check the file name, attempt to open the file.  If the files open correctly, the routine should return the file descriptor (for each file).  If there is an error, an appropriate error message should be displayed (see examples).

? A readBuff() procedure to read the input file and return the characters in a buffer.  The procedure will use the buffer address, file descriptor, and buffer size flag to read the file.  The procedure should return the characters in the buffer and the count of characters.  The procedure should also return a flag (true/false) for the last read.

? A rotate13() procedure to perform the rot13 function on the characters in the buffer.  The rot13 function is as follows:

NewCharacter = (Character+13) mod 26

The procedure will use the buffer address and character count.

? A writeBuff() procedure to write the modified buffer to the output file.  The procedure will use the buffer address, file descriptor, and count of characters.

To ensure efficient I/O operations, the program must buffer the data read and written.  For this assignment, the buffer size should be either 2 for the 'small' or 60,000 for the 'large' buffer size.

Note, a utility for testing will be made available on the class web page.

Note, your procedures must be placed into a separate file and linked with the provided main.  Refer to the handout for directions how to link multiple files.  Only the procedures file, not the provided main, will be submitted on-line.  As such, you must not change the provided main!

Testing

A batch file to execute the program on a series of pre-defined inputs will be provided.  The test script compares the program output to pre-defined expected output (based on the example I/O).


Related Discussions:- Program to perform a conversion on characters in a text file

Input output interface-microprocessor, I/O interface I/O  devices such ...

I/O interface I/O  devices such as displays and keyboards  establish  communication of computer with outside world. Devices may be interfaced in 2 ways Memory mapped I/O and I/

8237 modes-microprocessor, 8237 modes : Intel 8237 can be set to four d...

8237 modes : Intel 8237 can be set to four different type of style of transfer: 1) Single - One transfer at a time,  it allow processor access to the bus between transfers

Xor-logical instruction-microprocessor, XOR: Logical Exclusive OR: The XOR...

XOR: Logical Exclusive OR: The XOR operation is again carried out in a similar way to the AND and OR operation. The constraint over operands are also similar. The XOR operation pr

Programming with an assembler-microprocessor, Programming with an assembler...

Programming with an assembler The procedure of hand-coding 8086 programs is somewhat tiresome; hence generally a programmer may find it hard to get a correct listing of the mac

Add-arithmetic instruction-microprocessor, ADD:  Add :- This instruction ...

ADD:  Add :- This instruction adds an immediate contents of a memory location specified in the a register ( source ) or instruction to the contents of another register (destinat

Code, How to print strings in Right Triangle form?

How to print strings in Right Triangle form?

Microprocessor, from pin description it seems that 8086 has 16 address/data...

from pin description it seems that 8086 has 16 address/data lines i.e.AD0_AD15.The physical address is however is larger than 2^16.How this condition can be handled

Write a program to print name, Write a program to do the following: 1. P...

Write a program to do the following: 1. Print your name 2. Using a bottom testing loop, prompt the user to enter a number from 1 to 5.  If the number entered is not 1..5, pri

Program for game by using microcontroller 8051, I want to do a program as a...

I want to do a program as a game by using the Microcontroller 8051 with the assembly language, by using 4*4 keypad and its matrix display. I have to use the keypad for playing the

MIPS Assembly, Need help with 2 homework assignments

Need help with 2 homework assignments

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd