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

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).

Posted Date: 2/27/2013 5:33:26 AM | Location : United States







Related Discussions:- Program to perform a conversion on characters in a text file, Assignment Help, Ask Question on Program to perform a conversion on characters in a text file, Get Answer, Expert's Help, Program to perform a conversion on characters in a text file Discussions

Write discussion on Program to perform a conversion on characters in a text file
Your posts are moderated
Related Questions
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

IRET : Return from ISR:- When an interrupt service routine is called, before transferring control to it, the IP, CS  register and flag registers are stored in the stack to ment

init_lcd                        ;(this initialises a 2 row lcd)     bcf     TRISA,0             ;PORTA bit 0 as an output (lcd RS pin)     bcf     TRISA,1             ;PORTA bit 1

The Pentium   The next member of the Intel family of microprocessors was the Pentium, introduced in the year 1993. With the Pentium, Intel broke its custom of numeric model name

given a sentence, find the number of times a particular character or word appear. the sentence is to be entered by the user

RISC Characteristics : The  concept  of  RISC  architecture  include  an  attempt  to  reduce  execution  time  by make  simple  the instruction set of the computer. The main c

code to add two matrices

The Intel Processors :         The Intel Corporation is the biggest manufacturer  of microchips  in the world,  in addition  to being  the leading provider of chips for PCs. I

DMA controller :     Steps include in transferring a block of data from I/O devices (for example a disk) to memory: 1. CPU sends a signal to initiate disk transfe

assempbly language routine that takes an array named A containing n bytes of postive numebrs and fills two arranys, array B containing n words and array C containing n long words