MediaWiki:Sitenotice:
2024-03-02: The wiki ran out of disk space, so things were not working. This has been resolved by adding another 5GB of quota ;-) Thanks to Tim Lindner for reporting the issues.
2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)
Binary file: Difference between revisions
mNo edit summary |
(+ tape file format) |
||
Line 1: | Line 1: | ||
A CoCo '''binary file''' can contain sheer data or one or more executable machine language programs. They can be loaded into memory from disk using the LOADM command or from tape using the CLOADM command. Included in the format is the load address of the binary as well as an execution address. They may contain multiple loadable sections each having its own load address. A section starts with a five byte long preamble of which the first byte is $00, the following two bytes specify the length of the data block to be loaded, and the last two bytes specify the start address in RAM the data block is to be loaded at. This is then followed by the actual bytes comprising ML code and/or any data. The data block can be followed by another preamble to a new section with more data/code or is terminated with a postamble. The postamble is also five bytes in length, with the first one being $FF, the next two being $00, and the last two forming the execution address for the ML program in the binary file, if any. | A CoCo '''binary file''' can contain sheer data or one or more executable machine language programs. They can be loaded into memory from disk using the LOADM command or from tape using the CLOADM command. Included in the format is the load address of the binary as well as an execution address. They may contain multiple loadable sections each having its own load address. A section starts with a five byte long preamble of which the first byte is $00, the following two bytes specify the length of the data block to be loaded, and the last two bytes specify the start address in RAM the data block is to be loaded at. This is then followed by the actual bytes comprising ML code and/or any data. The data block can be followed by another preamble to a new section with more data/code or is terminated with a postamble. The postamble is also five bytes in length, with the first one being $FF, the next two being $00, and the last two forming the execution address for the ML program in the binary file, if any. Pure data blocks are typically 256 bytes long, whereas a ML program usually is a single block the size of the program, depending on how it was assembled. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 17: | Line 17: | ||
== Loading from tape == | == Loading from tape == | ||
Tape files have a slightly different format: | |||
# A leader of 128 bytes of $55 | |||
# Namefile block | |||
# 0.5 sec blank | |||
# 128 bytes $55 | |||
# data blocks | |||
# end of file block | |||
Namefile block 15 bytes of data | |||
# 8 bytes for name | |||
# file type byte; Basic=0, data=1, ML=2 | |||
# ascii flag; binary=0, ascii=$FF | |||
# gap flag byte; continuous=1, gaps=$FF - this byte may not be used | |||
# 2 bytes; start address | |||
# 2 bytes; load address | |||
Block headers | |||
# $55 | |||
# $3C sync byte | |||
# block type; name=0, data=1, EOF=$FF | |||
# block length byte; value 0-255 | |||
# data; 0-255 bytes | |||
# checksum | |||
# $55 | |||
EOF block | |||
# No data bytes |
Revision as of 08:18, 13 May 2013
A CoCo binary file can contain sheer data or one or more executable machine language programs. They can be loaded into memory from disk using the LOADM command or from tape using the CLOADM command. Included in the format is the load address of the binary as well as an execution address. They may contain multiple loadable sections each having its own load address. A section starts with a five byte long preamble of which the first byte is $00, the following two bytes specify the length of the data block to be loaded, and the last two bytes specify the start address in RAM the data block is to be loaded at. This is then followed by the actual bytes comprising ML code and/or any data. The data block can be followed by another preamble to a new section with more data/code or is terminated with a postamble. The postamble is also five bytes in length, with the first one being $FF, the next two being $00, and the last two forming the execution address for the ML program in the binary file, if any. Pure data blocks are typically 256 bytes long, whereas a ML program usually is a single block the size of the program, depending on how it was assembled.
00 | length | start address |
program/data block | ||
FF | 00 00 | execution address |
Loading from tape
Tape files have a slightly different format:
- A leader of 128 bytes of $55
- Namefile block
- 0.5 sec blank
- 128 bytes $55
- data blocks
- end of file block
Namefile block 15 bytes of data
- 8 bytes for name
- file type byte; Basic=0, data=1, ML=2
- ascii flag; binary=0, ascii=$FF
- gap flag byte; continuous=1, gaps=$FF - this byte may not be used
- 2 bytes; start address
- 2 bytes; load address
Block headers
- $55
- $3C sync byte
- block type; name=0, data=1, EOF=$FF
- block length byte; value 0-255
- data; 0-255 bytes
- checksum
- $55
EOF block
- No data bytes