
The programs prg2usr, retype, skip and protect may be copied freely.
If You have any bug reports, comments or questions, please contact me.
Philip Zembrod, zembrod@informatik.uni-freiburg.de


Installation
------------

Copy all the files onto a C64 disk. Run prg2usr. Enter "retype" as
filename. Do the same for "skip" and "protect". Afterwards the disk
contains three USR files, "&retype", "&skip" and "&protect". These can
be loaded and executed by the floppy CPU.



PRG2USR
-------

This is a little utility for conveniant development of USR files.
You can write them with a normal assembler and use PRG2USR to convert
the assembled PRG files into USR files which have a special format
with a checksum at least every 254 bytes.



&retype, &skip, &protect
------------------------
All three are loaded in the same way:

OPEN 15,8,15,"&retype/&skip/&protect"

After that they reside in memory in the 1541 from address $0500 (only
one of them at a time).

PRINT#15,"u5"

removes them (i.e. frees the buffer they have allocated),

PRINT#15,"u3"

fixes them again, but this only works safely immediatly after a
removal, otherwise they might have been overwritten by some other
operation. That they allocate a buffer does mean that only two SEQ or
one REL file can be open simultaneously while one of the programs is
in memory.


&retype:

The syntax is

PRINT#15,"u4x:filename{,filename}

where 'x' stands for one of 's', 'p', 'u' (SEQ, PRG, USR) or 'l' (REL)
and is the type You want to give to the files. More than one file can
be specified just as in the scratch-command. Wildcards can be used.
Turning other files into REL files is not recommended because no Side
Sector Blocks are allocated; this may lead to strange or desaterous
results.


&skip:

allows You to skip a number of bytes in a SEQ (or PRG or USR) file
which must be opened for read before a skip is performed. Loading
&skip into memory before is OK. The syntax is

PRINT#15,"u4:"+CHR$(channel)+CHR$(lo)+CHR$(hi)

where channel is the secondary address of the open SEQ file and lo/hi
is the number of bytes to skip.
Example: You want to read byte No. 520 of file "data".

10 OPEN 15,8,15,"&skip"
20 OPEN 1,8,5,"data,s,r"
30 PRINT# 15,"u4:"+CHR$(5)+CHR$(7)+CHR$(2):REM skip 519 bytes
40 GET# 1,a$:byte=ASC(a$+CHR$(0))
50 CLOSE 1,15
60 PRINT byte


&protect:

Very similar to &retype

PRINT# 15,"u4:file{,file}"

The scratch protect flag (bit 6 in the type byte in the directory) is
toggled for all specified files. It is shown in the directory by a '<'
behind the file type.

