Index | wersja polska |
UPDATE: The data structures appear to be compatible with the RT-11 file system.
Address range | Contents |
---|---|
0x0000-0x03FF | Loader area |
0x0400-0x07FF | Directory area |
0x0800-0x27FF | Data area |
The MK-90 start menu gives you three options: BASIC, SMP0, SMP1. Selecting SMP0 (or SMP1) causes the calculator to read the loader code from the cartridge 0 (or cartridge 1) and execute it. Cartridges formatted with INIT contain code displaying message which means "cartridge without loader":
000000: nop 000002: jsr r7, @#153700 000006: jsr r7, @#120536 000012: mov @#034022, @#164000 000020: mov #104306, @#164002 000026: jsr r0, 000062 000032: .asciz "\016\r\n smp BEZ ZAGRUZ^IKA" 000061: .even 000062: movb (r0)+, r2 000064: beq 000064 000066: jsr r7, @#116542 000072: br 000062
Hex dump of an example directory (file MK90.BIN in the mk90prog.zip archive):
0400: 01 00 00 00 01 00 00 00 04 00 040A: 00 02 EA 27 00 00 BB 0C 01 00 00 00 36 89 ;1st directory entry 0418: 00 04 3A 14 A5 14 BB 0C 01 00 00 00 36 89 ;2nd directory entry 0426: 00 04 9B 54 B8 38 BB 0C 01 00 00 00 36 89 ;3rd directory entry 0434: 00 02 20 20 20 20 20 20 0D 00 20 20 20 20 ;4th directory entry 0442: 00 08
Each directory entry occupies 7 words (=14 bytes). Bytes in a word are arranged in "little-endian" order (the least significant byte first).
Offset | Size | Contents |
---|---|---|
0 | 1 | Attribute |
1 | 2 | File name (2 groups of 3 characters), padded with blanks |
3 | 1 | File name extension (group of 3 characters), default is BAS |
4 | 1 | Number of blocks (sectors) assigned to the directory entry.
The sum of these words for all directory entries must be equal 16. 0x0001 + 0x0001 + 0x0001 + 0x000D = 16 |
5 | 1 | Unknown |
6 | 1 | Unknown |
Code | Meaning |
---|---|
0x0200 | Deleted or free directory entry |
0x0400 | Occupied directory entry |
0x0800 | End of the directory |
The file names and extensions are stored in compressed form - 3 characters in 2 bytes.
| |||||||||||||||||||
|
|
|
|
For example, the second directory entry at address 0x0418 contains the file name CIRCLE.BAS. Each group of three characters is encoded following way:
These words can be found at address 0x041A to 0x041F.
This encoding scheme can be considered as numbers in base 40.
It's also known as Radix-50 (thanks to Alec Voropay for spotting this).
The data area consists of 16 blocks (sectors) of 512 bytes each. Programs are stored in plain ASCII (the keywords aren't tokenised). They begin with an empty line (CR,LF sequence) and are terminated with an end marker 0x00.
The system doesn't support fragmented files, i.e. requires a contiguous group of free memory blocks of sufficient size to store the file.