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

Debug-microprocessor, Using DEBUG DEBUG.COM is a DOS efficacy that faci...

Using DEBUG DEBUG.COM is a DOS efficacy that facilitates the trouble-shooting and debugging of assembly language programs. In particular case of personal computers, all of th

#title:Shifitng of memory, Ask 2. Exchange higher byte of AX and higher byt...

Ask 2. Exchange higher byte of AX and higher byte of BX registers by using memory location 0160 in between the transfer. Then stores AX and BX registers onto memory location 0174 o

Shr-sar-logical instruction-microprocessor, SHR : Shift Logical Right: Thi...

SHR : Shift Logical Right: This instruction performs bit-wise right shifts on the operand word or byte that might be reside in  a memory location or a register, by the specified c

Program for initialize two row lcd, init_lcd                        ;(this ...

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

Instructions, Difference between div and idiv

Difference between div and idiv

Into-jmp-unconditional branch instruction-microprocessor, INTO : Interrupt...

INTO : Interrupt on Overflow:- It is executed, when the overflow flag OF is set. The new contents of IP and CS register are taken from the address 0000:0000 as described in INT

Hold response sequence-microprocesssor, Hold Response Sequence The HOLD...

Hold Response Sequence The HOLD pin is examined at leading edge of each clock pulse. If it is received active line by the processor before T4 of the earlier cycle/during the T1

Assignment, You have to write a subroutine (assembly language code using NA...

You have to write a subroutine (assembly language code using NASM) for the following equation. Dx= ax2+(ax-1)+2*(ax+2)/2

Cisc characteristics-microprocessor, CISC Characteristics : The design...

CISC Characteristics : The design of an instruction  set for a computer  might take into consideration  not only machine language constraints,  but  also  the  requirements  i

Fourth generation microprocessor, Fourth  Generation Microprocessor : T...

Fourth  Generation Microprocessor : The single chip 32-bit microprocessor was introduced in 1981 by Intel as iAPX 432. The other 4th generation  microprocessors  were;  Hewlett

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