mb02 English Manual
mb02 English Manual
Original documentation
© 8BitCompany 1994-1998
Contents
I. Introduction
Welcome!
Main features
Software description and its possibilities
Hardware description and its possibilities
Optional available accessories
How to set up the system
II. MB-02+: The system
Understanding BS-DOS 308
New BASIC commands
Commands to set up the path
Disk commands
Data storage commands
New BASIC functions
Understanding BS-ROM 118
What's new
An overview of repaired bugs
NMI Menu
NMI Menu Control Keys
Extended syntax of existing commands
New commands and their syntax
New system variable description
III. Error messages
BS-DOS 308 error messages
BS-ROM 118 error messages
IV. Programming under BS-DOS 308
V. MB-02+ BS-DOS 308 Assistant (the utilities disk)
VI. Hardware documentation
VII. Credits
I. Introduction
Welcome!
Dear Spectrum-addicted friend,
Thank you for buying a brand new product MB-02+ designed for your ZX Spectrum-compatible machine. Welcome to the world
of a perfect combination of your computer and a new disk system. This invention lifts the possibilities of your Speccy as high as
possible. This is the original documentation for MB-02+ developed by 8BitCompany. Please read these instructions carefully
before setting up your hardware. Thank you.
Main features
Here comes the list of the the best features implemented into your system:
• BS-ROM: classical ZX Spectrum ROM which contains BASIC and a software interface for a communication with
BS-DOS. There is also some extra software improvements that make the work with BASIC much more easier and
comfortable.
• BS-DOS: operation system software itself for a communication with disks assigned by BS-ROM or by a program
directly.
• BS-BIOS: system core that arranges the communication between software and hardware of the system.
After connecting the MB-02+, you will be equipped by all functions which are usually available on any other system and some
new features. The system’s concept is based on an idea of a tape emulation which means that you can communicate with disk in
exactly the same way as you did with a tape. Good thing about this concept is that you do not have to modify the software (no
matter if it is BASIC or machine code!). Obviously the communication speed is much faster using a disk. How does it work? The
core of data transfer are two routines situated in ZX-ROM at addresses 1218 (for SAVE) and 1366 (for LOAD). Routines for the
communication with disks (and tape as well) are attached to those addresses so that you can swap between use of any disk or a
tape. The system also remembers the position where the disk is "rewound" to (the virtual-tape pointer - compare to tape). The
system also recognizes headerless files. The utilities for data transmission from tape to disk are already available. In general, all
of it means that MB-02+ together with BS-DOS is fully compatible with tape.
MB-02+ also allows to switch ZX Spectrum into full 64K RAM-only mode so there is no problem to modify memory area
0-16383 (for example, you can load here original ZX-ROM, make any changes (like installing new font) and then write-protect
this memory area to emulate ROM).
The system also allows to perform disk operations and simultaneously run any other operation (using IM 2-e. g. music); none of
the processes will be interrupted. MB-02+ is also the only system for ZX Spectrum which allows the use of HD (high density)
disk format; that is caused by a programmable Z80-DMA chip.
• real time clock processor (RTC): real time/date measuring chip. There are plenty of things to do with RTC (timing,
measuring of a certain time period etc.). New BS-DOS 400 also supports RTC information in all files (so that you know
exactly when they were created). Of course, this chip is "awake" even when the MB-02+ is turned off so it will not lose
the track of the time.
• floppy disk drive FDD 3.5" HD: the best disk drive format to use with MB-02+; this is the most common format
used all around the world. We supply only the first-rate FDDs (Sony, Teac, Mitsumi) together with FDD cable to
connect to MB-02+.
• standard power supply: supplies power to MB-02+ and as many as 2 FDDs.
• PC power supply: supplies power to ZX Spectrum, monitor, MB-02+ and as many as 4 FDDs.
• Amiga-mouse: the most common mouse to use with ZX Spectrum.
DOS offers standard and the most common disk services together with some others. As already mentioned above, DOS can also
emulate tape using a floppy disk. A difference between disk and tape is that the tape is ALWAYS rewound to a certain position
(compared to disk). So if you type in LOAD "" (no file name specified) the first file available on tape will be loaded.
Therefore a special load-pointer was created in order emulate tape. Load-pointer points to a position where a disk is "rewound"
to. The above mentioned means that disk emulates 256-track tape (track=directory). Whenever you type in LOAD "", DOS will
use a load-pointer to determine which file is supposed to be loaded.
All tape functions work as usual: LOAD, SAVE, VERIFY, MERGE-they all call ROM LOAD/SAVE routines at #4C2 (=1218)
and #556 (=1366). That explains why all programs using ROM for LOAD/SAVE operations work correctly with disk as well as
with tape. No modifications necessary! It is also possible to interrupt any disk operation by pressing Q+W keys, simultaneously.
• if any parameter is put into <these branches>, it means that it is not mandatory.
• file specification as "data" is as follows:
item <,item> <,item> <,item>...
where "item" stands for:
number1 <TO <number2>>
or
TO <number2>
...where number1 signifies start of a range (if number1 is not given all files from the start of the directory are
considered) and number2 signifies the end of a range (if number2 is not given all files to the end of the directory are
considered).
Example:
Let ussuppose that directory contains 32 files:
TO 3,10,20,13 TO 15,28 TO
stands for these files:
1,2,3,10,20,13,14,15,28,29,30,31,32
• specification <local> sets a temporary path within a command; this specification starts by # followed by a numeric
expression signifying a temporary path; such syntax could be closed by , if there are data to follow.
Example:
Let us suppose that current disk is number 4:
CAT #2,66
will view a catalogue of the directory number 66 at disk number 2.
Further, wherever a number is expected it is possible to type in an expression that results in a number. Also wherever a string or
a name is expected any string expression could be typed in instead.
USR 15522 - setting a tape as a current device (LOAD/SAVE/VERIFY/MERGE commands will work with tape).
USR 15524 - setting a disk as a current device (LOAD/SAVE/VERIFY/MERGE commands will work with disk).
@ number
@ string
Setting a current disk drive. String signifies a disk name ("find a disk" function according to name is not implemented
though). Number stands for the disk number. If number=0 LOAD/SAVE rountines will work with tape (exactly the
same as USR 15522). If number>0, also USR 15524 will be performed-LOAD/SAVE routines will communicate with
disk.
$ number
$ string
To set the current directory on the current disk drive. Number stands for directory number, string signifies directory
name, but only 10 characters is considered.
? number
? string
To set the current file; load-pointer will be set to the required position.
Any combination of these 3 commands sets the path as the part of the commands listed below (or could be used all
alone as well).
Example:
@3$5@8$22$"games_a"?"arkanoid"
means that on disk in drive 3 will be set current directory 5, on disk in drive 8 will be set current directory 22,
then the first "games_a" directory found after directory 22 will be set as current, and the load-pointer will be set
to "arkanoid" file. Such sequence could be ended by ; if it is required by the command's syntax.
Disk commands
The list and description of commands for disk operations and file handling follows.
.FORMAT <path>
To erase all files and directories on the disk. It is possible to unformat disk using .UNERASE command (in case SAVE
is not performed after .FORMAT).
.PRESS <path>
To press, "shake down" the current directory.
.KILL <path>
To erase internal CACHE memory. The use of this command is not necessary because DOS manages all operations with
CACHE automatically.
These commands work as usual tape commands. Number signifies load-pointer position (exactly the same as the path "?"
parameter). All these commands perform operations in the current directory or in the directory specified by the path (which
becomes current afterwards). SAVE command always saves the file at the end of current directory. Characters ! and * are
ignored; they were impemented in order to accept commands that were originally created in BASIC 128 (LOAD !) or under
D40/D80 disk system (LOAD *). VERIFY command works as expected; if any differences are found during verification, a
message specifying a difference area will appear.
FN ?
Gives a DOS version number.
FN @
Gives current drive number.
FN $
Gives current directory number.
FN ?
Gives a load-pointer position.
FN #
Gives the number of files in the current directory.
FN %
Gives the number of empty sectors on the current disk.
FN *
Gives a 32 characters long string specifying current load-pointer item.
Example:
FN *(7 TO 16) signifies current file name
FN *(6 TO 22) signifies current file header (as on tape)
If load-pointer is not positioned within the files of the current directory, empty string will be given instead.
If load-pointer >= #FF00 (=65280), 32 characters long string will specify a disk name.
FN ©
A special function that results in a string that includes memory range 0 to 65535.
Understanding BS-ROM 118
There were few bugs, issues and problems with the original Spectrum ZX-ROM 48. All of them were fixed. There were
also some new features added to the original ZX-ROM 48. BS-ROM 118 is nothing but well-known ZX-ROM 48 on which the
following modifications have been performed:
• new commands
• extended syntax of existing commands
• search for tape lead-in tone is 4 times shorter
• program pointer has been changed from > to *
• faster error beep signal
• implemented co-operation with hexadecimal numbers 0-65535
• BASIC lines in range 0-16383 (editable)
• faster autorepeat
• when trying to enter error command, cursor will be moved to the error position right away
• can list programs without control codes (ignores colours, TAB and AT control codes-good for hidden lines viewing)
• NMI menu
• some errors corrected
• two new characters in a character set (CHR$ 30 and CHR$ 31)
• program pointer * is displayed only after autolist
• line editing is possible in 4 directions (left, right, up, down)
• super-fast reset/NEW (memory cleared using PUSH instruction)
• it is possible to interrupt autolist using a "Q" key
After reset or NEW, system will display the information about memory space available together with OK message. Please note
that neither reset nor NEW test memory-it is expected that memory works correcly.
NMI menu
NMI menu is executed by pressing NMI button or jumping to address #66 (=102). Fast flashing border indicates that system is in
NMI menu. If the stack pointer (SP) was in a memory area #0001-#4000 (1-16384), it will be changed to #5800 (=22528).
CONTINUE <expression>
If expression is not 0, machine code at address (expression) will be executed. After return back to BASIC, IY must be
set to #5C3A (=23610), but HL' does not have to be set to #2758 (=10072).
CLS <expression>
If expression is not 0, all colours will be set according to the expression (suppose expression stands for the attribute
value).
Example:
CLS 7=BORDER 0:PAPER 0:INK 7:BRIGHT 0:FLASH 0:CLS
GO TO
GO SUB
PAUSE
BORDER
Numeric parameter is not mandatory; if not given, 0 will be considered.
POKE address,byte
Usual POKE command.
POKE address;word
2-byte (16 bits) POKE command.
POKE address,string
Storing a given string into the memory.
VAL$ <expression>
DEC →HEX conversion. If the expression is numeric, the result of this function is a string 4 characters long in
hexadecimal form.
Example:
VAL$ 33023="80FF"
% or & <string>
HEX →DEC conversion.
Example:
%80FF=33023
VAL <expression>
If the expression is numeric, the result of this function is 2-byte (16 bits) number on (expression) address (i.e., 2-byte
PEEK).
, <expression>
Use to edit BASIC line which is given by the expression. If the expression is not given or equals 0, the first line
available will be edited.
' <expression>
Switches ZX 128K RAM pages; exactly the same as OUT (32765),expression. Expression must be in range 0-15. Please
note that during page switching, RAMTOP must be below #C000 (=49152). See 0..9 keys in NMI menu above.
©
Resets all system variables except of PROG, VARS and ELINE (also see B-command in NMI menu).
↑
128K memory reset (also see E-command in NMI menu).
?
Displays an information regarding program length, variables length and empty memory space available assigned for
BASIC.
*
Reads headers from the tape and displays the following information together with each header:
file type, file name, address, length
#
The same as USR 54885-executes MRS (must be loaded in the memory!).
===============================
Error message
drv/dir/sub: file_name
trk, sid, sec
Enter=ok/retry, Space=abort
===============================
Where:
Can't unerase
Cannot unerase due to sector damage or unerased directory never existed.
Error at N1-N2:N3
When verifying, a difference area was found; N1-N2 is a difference range, N3 signifies difference area length.
Disk full
File requires more space than available on the current disk.
Unknown disk
When operating a drive, the drive number specified does not exist.
Directory too long
Attempt to access more than 65279 files in a directory.
Directory full
Attempt to add new file into the full directory.
Seek error
FDC chip cannot find track 0.
Break
Q+W keys pressed simultaneously when operating the disk.
Ready error
Error when activating a disk drive.
Write protect
Displayed when writing to disk. Write protect switch is switched to the proctect position.
CRC error
When loading a data sector, CRC addition checks do not match.
Data lost
Data lost during transfer between FDC and DMA chips. Caused probably by a software that operates DMA under
interrupt mode.
Time out
Time ran out when operating a disk without a success.
Unknown format
Attempt to access a disk which is not BS-DOS format.
System error N1
Ususally some sort of damage found within a BS-DOS itself. It is recommened to reboot the system immeditately.
Invalid argument
Attempt to execute unexecutable file using NEW.
All other error messages have exactly the same meaning as in ZX-ROM 48.
V. MB-02+ BS-DOS 308 Assistant (the utilities
disk)
COPY-DISK-DISK ("cdd")
This program was created for files copying. Help page is displayed when "cdd" is executed. Help page will also appear if parameters are
not correct. For parameter specification, check out MOVE/ERASE commands, but use "'" instead of TO.
HARDDISK:
DMA:
FDC:
MEMORY:
PIO:
xx - A6, A5 REGISTER
00 PA
01 PB
10 PC
11 CWR
CANNON 37: CANNON 9:
VII. Credits
Copyright
MB-02+, BS-DOS, BS-ROM, BS-BIOS
© 1994-1998 8BitCompany Laboratories
© 1994-1998 8BitCompany Czech Republic Europe
All rights reserved.
Hardware
Robert Letko (Robo)
Jan Ku?era (Last Monster)
Software
Slavomír Lábsky (Busysoft)
Documentation
Slavomír Lábsky (Busysoft)
Martin Blažek (Blazko/systems)
Contact us
8BitCompany
Lu?ní 4570
760 05 Zlín
Czech Republic
tel.: +420 67 43424, +420 603 543256
e-mail: 8bc@mbox.mrp.cz, 8bc@publikum.cz