Communicator Module Layout ========================== Module header ------------- 0x0000-2 BRL // &82, &nn, &nn 0x0003-5 -2 // Offset to CRC word at end of module 0x0006-7 dw 0x0100 // BCD version number, eg 1.00 0x0008 db flags1 // module flags 0x0009 db flags2 // module flags 0x000A dd 0x00 // module flags 0x000B db 0x00 // module flags 0x000C-D dw 0x0000 // reserved for expansion of module's own use 0x000E ASCIIZ module name and command table ... ASCIIZ help strings ... Module content zzzzzz Offset at 0x0003-5 points to here ... dw 0x???? // module CRC ... // &FF padding to page boundary The text strings are deliminated with '/', eg "MOS/HELP/CLOSE" with | used to escape the next character, eg "file WR|/wr" Module flags: MHCPOS &0001 position-independent code MHCBNK &0002 bank-independent code &0004 MHCODE &0008 &0010 MHCFS &0020 filing system interface support MHCDEV &0040 device driver interface support MHCBAS &0080 BASIC program MHCMEN &0100 module may appear in MENU MHCVPD &0200 VIEW printer driver MHCONE Module may appear only one on the main menu MHCMKL Module may not be killed once started from the main menu Service calls appear to be: XX=sevice number. Must be an even number as used as offset to JMP (addr,X) On return: SEC: not claimed, registers probably should be preserved CLC: claimed, registers may hold values XX=&007E: start a BASIC program in a module On return, CLC, AA=PAGE of program to RUN If module contains BASIC, scan for: xxxx db &62 yyyy dw offset zzzz zzzz+offset=>start of BASIC program ... dw CRC // 'length' is offset to this byte ... end of module Service calls appear to be: XX=sevice number. Must be an even number as used as offset to JMP (addr,X) On return: SEC: not claimed, registers probably should be preserved CLC: claimed, registers may hold values XX=&0000: run module XX=&007E: start a BASIC program in a module On return, CLC, AA=PAGE of program to RUN Entry points in MOS memory &00FF80 &00FF84 &00FF88 &00FF8C &00FF90 Called with X=something &00FF94 &00FF98 &00FF9C &00FFA0 High memory appears to be opposite way around to low memory FCxxxx - ROM 3 FDxxxx - ROM 2 FExxxx - ROM 1 FFxxxx - ROM 0 with MOS core FFxxxx appears to be paged into 00xxxx on RESET &mmAC00 MOS workspace in bank &mm Low memory: &00A5xx - equiv. of BBC &0002xx, vectors and OSBYTE variables &00A52A/B - INSV &00A52C/D - REMV &00A536 - OSBYTE 166 &00A58F - OSBYTE 255 etc. &00FFxx - Entry points to MOS High memory: &45xxxx - Electron memory map &450000 - screen memory &458000 - keyboard &45FE00 - ULA