|
|
DataMuseum.dkPresents historical artifacts from the history of: Zilog MCZ Floppy Disks |
This is an automatic "excavation" of a thematic subset of
Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3438 (0xd6e)
Types: TextFile
Names: »NOTE.TO.PATCH.USER«
└─⟦329ff8d5f⟧ Bits:30006811 8" ZilogMCZ floppy NThun_0013 (SYSTEM MCZ 1/05)
└─⟦this⟧ »NOTE.TO.PATCH.USER«
PATCH PROGRAM NOTE TO USER
DECEMBER, 1979
I. Purpose
The PATCH program allows the user to append a new segment
of code to an existing RIO procedure file, or to modify bytes in
any kind of file without program relinking.
II. Operation
The PATCH program has two modes of operation, PATCH and
MODIFY, as described below.
Example:
%PATCH
#FILE PATCH 1.0
#SELECT MODE:
MODIFY (M OR m) OR PATCH (P or p)
P
III. PATCH mode
The PATCH program stores a string of bytes at a given address
in a program. The length of the string of bytes is user-defined and
must be less than or equal to 255 bytes. The PATCH program stores
a CALL instruction and as many NOP instructions as are needed to fill
out the length supplied by the user. The bytes replaced by this
string become the first bytes in the new code segment. In this way
the user may move as many instructions as are needed to the new
code segment. PATCH creates a segment that starts at a user supplied
address and contains the bytes taken from the original segment and
any user supplied bytes. When the user teminates the byte input
PATCH writes the last segment and fixes the descriptor record to
include the new segment.
The user input for PATCH mode is as follows:
1. Procedure file name - A RIO procedure-type file.
#PROCEDURE FILE NAME
test_program
2. CALL address (hex) - The address in the procedure where the
call instruction is to be placed.
#ADDRESS TO STORE CALL
5A35
\f
- 2 -
3. PATCH address (hex) - The low address of the new segment.
#ADDRESS FOR PATCH
6E00
4. Number of bytes to be transferred to the new segment (decimal).
#NUMBER OF BYTES TO MOVE OUT OF OLD SEGMENT
NULL INPUT (CARRIAGE RETURN) SETS DEFAULT (=3)
5
5. Code bytes (hex) - The bytes of data or code for the new
program segment.
#ENTER PATCH BYTES (ONE AT A TIME),
NULL INPUT (CARRIAGE RETURN) TERMINATES INPUT
FD
21
0B
50
CD
03
14
C9
IV. MODIFY Mode
In MODIFY mode, PATCH allows the user to replace existing
bytes within a file (any type). PATCH prompts the user for the
record number to be modified (records index from 1), and the
index into the record for the byte being modified (bytes also
index from 1). PATCH then asks the user for the new byte value,
inserts the new value in the record, and updates the file. This
mode of the PATCH program operates in a loop so that multiple
bytes may be changed in a single session.
NOTE: The PATCH program replaces the original file with the new
one. If the user is uncertain about the changes, a
backup copy of the original should be made.
The user input for MODIFY mode is as follows:
1. File name to be modified - Any RIO file
#MODIFY FILE NAME
test_modify
\f
- 3 -
2. Record number to be modified (decimal) - The record
number (indexed from 1) that contains the byte to be
modified.
#RECORD NUMBER
1
3. Byte position to be modified (decimal) - The position
(indexed from 1) in the specified record.
#BYTE POSITION
23
4. New value for the byte (hex)
#NEW VALUE
FF
V. I/O Unit Utilization
Unit 1 - User input
Unit 2 _ Console messages
Unit 4 - File I/O