SPRING 2002
CSCI 2370
4/23/2002
DISK EDITOR
Assignment 6
due: 4/30
20 points
Write and run the final main program and the subprograms SNEWDIG, SWRSECT and SWRDISK. When testing SWRSECT and SWRDISK make sure you are using a disk that can be destroyed.
The grade for each lab in the project includes a portion (15%) on programming style and a portion (20%) on how well the program, macros and subprograms were tested.
Assignments are due at the beginning of class on the date given. Late assignments are penalized at a rate of 10% per day up to a maximum of 50%.
SUBPROGRAM DESCRIPTIONS
SNEWDIG the subprogram to use the hex digit typed by the user, put the digit on the screen, change the value of the byte in the sector array, and put the character value on the screen.
SWRSECT the subprogram to write the sector back to the designated disk and sector.
SWRDISK the subprogram to get the disk letter and sector number from the user, and then call SWRSECT.
THE MAIN PROGRAM
The main program controls the operation of the entire program by taking the keys the user presses and calls the appropriate subprogram. That continues until the user wants to quit, indicated by hitting the control-Q key combination. The following are the keys and corresponding action:
HEX
KEYS VALUE ACTION
---- ----- -------------------------------------------------
00,48 moves the cursor up one line within the sector on the screen, if it is not already at the top line. If the cursor is on the top line of the second page display, then the cursor is moved to the last line of the first page with the first page put on the screen.
00,50 moves the cursor down one line within the sector on the screen, if it is not already at the bottom line. If the cursor is on the bottom line of the first page display, then the cursor is moved to the first line of the second page with the second page put on the screen.
00,4D moves the cursor to the right one position in the sector display on the screen. The blank spaces are skipped over. If the cursor is already at the right edge of the hex value display, it moves to the beginning of the next line of the display, even if it is on the next page.
00,4B moves the cursor to the left one position in the sector display on the screen. If the cursor is already at the left edge of the hex value display, it moves to the end of the previous line of display, even if it is on the first page.
PGUP 00,49 displays the first page of 256 bytes of the sector. The cursor stays at the same spot on the screen.
PGDN 00,51 displays the second page of the sector. The cursor stays at the same spot on the screen.
CTRL-R 12 reads the desired sector from the disk and then display the first 256 bytes with the cursor in the upper left corner of the byte display.
CTRL-W 17 writes the sector back to the disk.
CTRL-Q 11 quits the editor.
normal 30-39 changes the digit at the cursor position.
digits 41-46 The value of the byte in the sector array is
61-66 also changed along with the character value display.