GECHEK - checkpoint snapshot.

Usage:

mme    gechek
tra    1,qu

Description:

MME GECHEK saves a "snapshot" of the program at the time the MME is called. At a later point, the program may "roll itself back" (restore itself to its state at the time this snapshot was taken) by calling MME GEROLL or by initiating a Checkpoint restart.

If your program is using File and Record Control, the Q-register must contain the following before calling MME GECHEK.

Bits 0-17
must contain the address of an FCB. The "snapshot" will be written to the file associated with this FCB. The file must have write permission.
Bits 18-19, Bits 21-35
must be zero.
Bit 20
is 1 if this is a pre-GERELS snapshot, and 0 otherwise (see below).

If your program is not using File and Record Control, the Q-register must contain the following.
Bits 0-5, 21-35
must be zero.
Bits 6-17
contain two BCD characters giving the file code of the file to which the snapshot will be written. The file must have write permission.
Bit 18
must be 0.
Bit 19
must be 1.
Bit 20
is 1 if this is a pre-GERELS snapshot, and 0 otherwise (see below).

MME GECHEK returns to the TRA instruction after the MME call. At this point, the upper half of the Q register will always hold the address of the TRA instruction, so the TRA will go on to the next instruction.

By default, when a MME GEROLL is used to restore a program at the point where the snapshot was taken, it will return to the TRA instruction following the MME GECHEK that took the snapshot. The upper half of the Q register will again hold the address of the TRA instruction so that execution proceeds normally.

However, if the upper half of word 14 in the user's memory area is assigned the address of a user routine before the first call to MME GECHEK, MME GEROLL will return to the specified user routine instead of the TRA instruction after the MME GECHEK. This user routine can then perform any special processing that might be required after the rollback. When MME GEROLL returns to the user routine, the upper half of the Q register will hold the address of the TRA instruction after the MME GECHEK; the user routine can use this address to return to the normal flow of the program.

Immediate Release of Files/Peripherals

If the program intends to use MME GERELS to release data files or peripherals immediately after the MME GECHEK, bit 20 in the Q register must be set to 1 before the MME GECHEK is called and the upper half of the A register must contain the address of the MME GERELS list. This list may contain a maximum of 38 files. The format of the list is

zero    N,0
bci     1,0000F1
bci     1,0000F2
     ...
bci     1,0000FN
where N is the number of files being released and F1 to FN are the file codes of these files.

If a MME GEROLL rolls back to this kind of checkpoint, the files in the list will not be accessed (and do not need to exist), since they are going to be released again immediately. Note that the MME GERELS must follow the MME GECHEK immediately for this construct to work correctly.

Notes:

MME GECHEK may not be executed inside a courtesy call.

Any number of snapshots may be written to the same file, but only the most recent can be used in a tape rollback operation. After switching tapes on a multi-reel file, the File and Record Control program takes an automatic snapshot on the current snapshot file if the upper half of SPA word 14 is non-zero.

The rollback procedure does not provide file positioning capabilities for files assigned to card readers, punches, or printers.

After a complete file is released, MME GERELS zeroes the flag indicating that a snapshot is present and sets the "No Activity Restart" indicator, unless the MME GECHEK took the pre-GERELS form. This prevents activity restart or rollback until a new snapshot is taken. MME GERELS does not zero the flag if it is just called to change dispositions or access mode.

After a new file is successfully allocated, MME GEMORE also zeroes the flag indicating a snapshot is present. A new MME GECHEK is required before rollback becomes possible. MME GEMORE does not zero the flag if it is just called to grow an existing file.

If desired, snapshots may be directed to the controlling data file itself. However, this can only be done if the data file resides on magnetic tape, is opened for output only, and is closed without the LOCK option.

If a disk snapshot file is big enough to hold two snapshots, MME GECHEK will alternate writing snapshots to the first and last halves of the file. This makes sure that there is one intact snapshot, even if an abort occurs while writing on the other half of the file.

Errors

If MME GECHEK encounters an error, the snapshot is not taken and an error code is returned in the lower half of the Q register. The following octal codes are used:

1
The file specified to hold the snapshot was not open.
2
The file specified to hold the snapshot was not open for output, or the program did not have write permission.
3
An error occurred in positioning the snapshot file.
4
The device specified for the snapshot file was invalid.
5
The attempted write produced a bad status return. In this case, an incomplete snapshot may exist -- a new snapshot should be taken.
6
An error was found in the pre-GERELS information. This could mean that the A register address was out of bounds, there were more than 38 entries in the list, or the list had an incorrect format.
7
End-of-tape was encountered when taking the snapshot.
11
Checksum error.
12
MME GECHEK was attempted inside a courtesy call.
13
The intended file was not large enough to contain the snapshot.
14
An error occurred when saving the file position.

See Also:

expl mme geroll

expl mme gerels

Copyright © 2000, Thinkage Ltd.