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

Short-type-global-assemblers operator-microprocessor, SHORT  : The  SHO...

SHORT  : The  SHORT operator denoted to the assembler that only one byte is needed to code the displacement for a jump (for example displacement is within -128 to +127 bytes fr

General terms for cache-microprocessor, General terms for Cache : Cac...

General terms for Cache : Cache Hits : When the cache consisted the information requested, the transaction is said to be a cache hit. Cache Miss : When the cache does n

Synchronous and asynchronous transmissions of 8251, Typical link to modems ...

Typical link to modems for synchronous and asynchronous transmissions are shown in Figure. With regard to the synchronous connections it is consider that the timing is controlled

Space don''t come in ASCII characters while printing?, .MODEL SMALL .STACK...

.MODEL SMALL .STACK 100H .DATA PROMPT DB \''The 256 ASCII Characters are : $\'' .CODE MAIN PROC MOV AX, @DATA ; initialize DS MOV DS, AX

Assembler directives and operators-microprocessor, Assembler Directives and...

Assembler Directives and Operators The major advantage of machine language programming is directly that the memory control is in the hands of the programmer, so that, he can be

Assembly language, Assembly Language: Inside the 8085, instructions ar...

Assembly Language: Inside the 8085, instructions are really stored like binary numbers, not a very good manner to look at them and very difficult to decipher. An assembler is

Formulate the linear programming model , Print Media Advertising (PMA) has ...

Print Media Advertising (PMA) has been providing a contract to market Buzz Cola via newspaper ads in a main southern newspaper. Full-page ads in the weekday editions (Monday throug

#largest number, #write a program 8086 to find the largest number

#write a program 8086 to find the largest number

Neg-arithmetic intruction-microprocessor, NEG: Negate:- The negate instruc...

NEG: Negate:- The negate instruction forms the 2's complement of the particular destination in the instruction. For obtaining 2's complement, it subtracts the contents of destinat

8086, Ask(2) Write a program to mask bits D3D2D1D0 and to set bits D5D4 and...

Ask(2) Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6 of the AX register question #Minimum 100 words accepted#

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