Spectrofon #21
04 декабря 1996
  Железо  
  Scorpion ZS  

Designer - a monumental paper on the universal controller peripherals SMUC.

<b>Designer</b> - a monumental paper on the universal controller peripherals SMUC.
B0


(C) 1996 A. Larchenko


                   SMUC


    UNIVERSAL CONTROLLER PERIPHERALS


   October 26, 1996 on sale of a universal controller card for 
PC peripherals SMUC Scorpion ZS 256. Included with the 
controller board comes complete description of how hardware 
connection SMUC, and software software, which is implemented in 
the framework ProfPZU version 3.98 and above. This article

partially similar description, is intended primarily for owners 
of the Scorpions, who are already able to work with and SMUC 
hard drive. The release ProfPZU version 4.0, which will be used 
SMUC any scorpion-compatible computer, is expected shortly. 


  The article describes the program
Support the controller work with the operating system TR-DOS. 
In applications that are intended for programmers who are 
describe the challenges of the Shadow Monitor for the hard disk 
drive ("HDD") and nonvolatile clock, how to work with

these challenges - the text of the pilot
driver for the system IsDOS. And also an example program access 
cards IBM PC XT, be connected to SMUC.



  1. Work Hard Disk


   Perhaps the most important and anticipated
device on the universal controller peripherals SMUC is IDE
hard disk interface. This interface
allows you to simultaneously connect up to two
devices, and to date this
popular interface is not supplied
only hard drives, but some other devices such as disk drives, CD
ROM. Software Shadow Mo
nitora calculated so far only on the maintenance of one hard 
drive, but the hardware SMUC controller provides full interface 
IDE, whose implementation naturally be implemented in the 
future. 


   This section describes work with tough
drive connected to the controller SMUC.
Actually, the disk is not much
more complicated than a floppy disk and drive, and
Perhaps the main difference is "not
replacement of the "floppy" and an order of magnitude
greater than its volume.


   Begin work to naturally
to connect the hard disk (insert
floppy disk). Then you need to define the parameters of the 
device (remember that when working with TR-DOS diskette first 
tries to determine its size - the number of tracks, and sides). 
However, in contrast to the drive, this procedure for multiple 
hard drives difficult, but should only be done

once. At this stage, the connection ends at
ourselves to and need to partition your hard disk - that is to 
create information structure, share a large amount of disk

acceptable for the work part. I must say the concept of 
formatting for hard IDE disks missing, these

output devices formatted with
factory and more in his life ever format does not change. And, 
finally, actually work with the data on your hard drive. 


   The order of presentation of the material in this section is 
designed so that you maximize quickly and at the same time, 
correctly and consistently including drives to work. 


  1.1. Installing a hard disk


   Installing a hard disk interface IDE, consists of three main 
phases. Hard-wired connection, the software identification and 
testing of the disk. 



  1.1.1. Hardware Connection


   Hardware connection devices, perhaps the simplest and at the 
same time the most responsible action. When errors possible 
failure of not only the hard drive and controller, and a 
computer. So, be very careful.



   SMUC controller is inserted into the connector
motherboard of your computer so that the details of the 
controller looked "at the details the board. The controller 
connects to the hard drive, a special 40-wire ribbon cable, so 
that would be a contact coincided on the controller and hard 
drive (on cable extreme wire, corresponding to a contact, 
usually marked). Power is supplied to the hard drive via a 
special connector, similar to the same on the drive. 


   After all the connections can be included
food, on the computer screen immediately
should see the familiar inscription "fast

test of computer ", and then several reports found (or not 
found) device controller SMUC. After filing power drives of 
different companies and models behave differently. But the 
characteristic is small (less than a second) Pause, then the 
sound of aircraft taking off in miniature (in modern models, he 
almost inaudible), this promotion engine itself

disks ("pancakes"). Then, the "recalibration" and internal 
testing of the mechanism of magnetic heads, reflected in 
lightweight (and the old models - quite loudly) "pohryukivanii. 
The whole operation on self-test occurs at each

power (and, incidentally, no matter
from connecting to the controller), and lasts from
5-10 to 30 seconds.


   If after switching voltage hard "silent", then either he 
lacks the power source (it can be verified by measuring the 
voltage tester +5 and +12 B) or wrong (vice versa) is connected


cable connecting the hard drive and controller. Insufficient 
power source supply may cause an unstable disk (this is 
especially true for older models that may consume in a pulse up 
to several amperes to 12 volts, compared to new, modern hard 
drives can consume less than floppy disks).



   Now look at the screen. If, despite "attempts to" hard disk 
on the screen just appears "Hard disk not found ", then again, 
most likely" upside down "cable or malnutrition, for hard disk 
interface (interface part of any hard disk, usually works even 
when the identification error self-test and communicate them to 
the controller). Perhaps, but complete loss of the disc. 



  1.1.2. Software Connection


   If the interface part is in order,
during the process of self-test your hard drive "hangs", waiting
"Response" from the device, and after receiving
This response attempts to define the parameters of the disc. To 
obtain these parameters is a special procedure, which also 
takes some time. Total time when you first start your hard

disc should not exceed a few minutes. If the time longer, then 
do not drive in order.



   Successfully identified the hard drive issue
on the computer screen label of the form "IDE / AT
42 MB Hard disk found ", where instead of
42 will be a definite program
the amount of your hard drive. If this size is not
corresponds to the actual volume of the disc, then this disc is 
not properly inform themselves about the program and requires 
manual settings, as below. Yes

more displays three lines of information
producer firms. The first line, as
typically contains a meaningful name of firm
or model, two other serial number and
date models, but each manufacturer is free to enter what he 
wants. Monitor not include any delay for examining these 
inscriptions, if you are still interested, press (and hold) the 
"Reset", but After necessarily produce a "cold"

start your computer (reset with-held on
keyboard by pressing "Left").


   If the internal tests and Auto identification hard drive 
were successful, then the computer goes to standard menu 
running BASIC. Further action on the connection hard drive 
should be carried out in the Shadow Monitor (remember that the 
entrance to the TM by briefly pressing on

button Magic).



   If you have an old and slow disk, then
he may not have time to do all the internal tests to verify its 
start time monitor program, in this case on a computer screen 
instead of the above posts there any error message (most likely 
"Hard disk data not ready "or" Busy not found "). In

this case, try not turning off the power to make a second 
"cold" start computer. If it does not help (still receive error 
messages), then check your hardware connection

SMUC controller and hard drive. It is possible that such a copy 
of the disc requires manual setting of parameters, or it can 
not work at all. 


  1.1.2.1. Automatic Identification


   Thus, we have the menu of the Shadow Service Monitor. Choose 
menu item "Hard disk utility ", as it" Set Up ".




   As the name implies automatic
identification of the hard drive is
automatically. Actually, the first automatic identification has 
already occurred (see previous section). Or at least,

trying to happen. The results of the process
displayed in the menu items Cylinders,
Head and Sector, which show the "geometric dimensions of the" 
hard drive, respectively, the number of cylinders, heads and 
sectors. These parameters should ideally conform to the 
parameters of the passport hard drive. You can once again on

Just in case, follow the procedure Autoconfiguration hard drive 
by selecting item "Auto detection hard disk". "Geometric" sizes 
should remain stable and unchanged. 


   A small note - some types of
Winchester has a number of cylinders
more than 1023, and the software is not yet able to handle such 
values. Therefore, use the handles Noah parameter settings, and 
set number of cylinders in 1023.



   So, if all goes well, the data found agree with those 
expectations, then can allow identification at the start

(It is enabled by default, the menu item
"On start" in a state of ON), and immediately move to test the 
hard drive. In Otherwise, go to the manual identification of 
the disc. 


  1.1.2.2. Manual tuning "hard drive"


   Actually you should enter in paragraphs
menu "Hard disk utility / Set Up" the real
"Geometrical" size of your hard
disc. This is the number of cylinders, heads, and
sectors. These options sometimes lead to
case of the disks themselves, if they do not, contact the 
seller to shove it to you a miracle. "




   Is that the parameters read from the
hard disk is not true, although by all indications Auto 
identification was (quickly and without errors). 


   So, you entered the real parameters of the hard disk. Now 
you need to make sure that the launching would be the monitor 
has not undertaken Auto identification with the "cold" reset 
the computer. To do this, move the item "on start" to OFF. 


  1.1.2.3. Saving settings


   Any changes to settings in the menu of the Shadow Service 
Monitor only until the moment power is turned off, or "cold"

Reset the computer. After that, everything is restored to the 
state "by default". This fully applies to the parameters

hard drive and as a trigger "on
start ". However, not all so sad. On
controller installed SMUC nonvolatile memory capable of storing 
life Nenno important variables of the Monitor. However,

write them into memory, you must manually.


   Exit to the main menu, Service Monitor
("Main menu"), then select the submenu "Set
Up ", and in it the submenu" Monitor ". Now click" Save CMOS ".


  1.1.3. Testing of the hard disk


   After identifying the hard drive must be
check both the disk will work with the established "geometric" 
size. For this purpose, the submenu Set Up menu, Hard disk

utility, you can choose two tests, the first
designed to test the translation scheme
sectors within the hard drive and identify
unreadable sectors. In addition, the test allows you to 
visually estimate the speed of the hard disk, because uses real 
semiconductor driver, "wired" into the ROM of the Shadow 
Monitor. The second test is more complicated. It allows

check the data transfer mechanism, ie,
the circuit IDE "in the enhanced mode.



  Let us work tests. The first test
simple sequential reads all sectors of the sector from the hard 
drive. Checking content sector is impossible, and

estimation error test is satisfied by messages issued by a hard 
disk. On the computer screen displayed the current counter 
checked the cylinder and "running a stick, some animating 
picture abort the test can be clicking on BREAK. Actually, if 
"all good", then this case and limited - counter to doschityvaet

maximum cylinder on the screen is given
coordinate of the last read sector
and the test is completed. You can move to
second test.


   In the case of fixing the bugs on screen
I get a message about it, which presents the coordinate of the 
bad sector (number of cylinders, heads and sectors) and type 
errors. Here we should pay attention to "Frequency" errors. If 
they are few and they happen randomly, it is likely, given 
LIMITED copy of the hard disk is defective, and Further work 
with him is not recommended. If an error is followed by 
"groups", with alternating certain numbers, such as unreadable 
sector, starting with some a certain number on all heads or

on all cylinders, an error occurs, starting with a specific 
head, then it is likely that the hard drive are incorrect 
"geometrical" dimensions. It happens that on the disk "crashes" 
some one head, and all sectors, read it, are "beaten". In these 
cases you must return to the manual setting of parameters and 
try to "cut off" the defective, reducing a certain value. After

Why spend a re-test.


   The second test is more informative, but also more 
dangerous. Its algorithm is as follows - from the Gaza 
stityvaetsya stationed there, the information sector is 
recorded and then pseudo-code, after which new information is 
read and verified satisfies the recorded, and of the sector 
returns to its former value. Such an operation made for all 
sectors on the hard disk. As can be seen, the test is not only 
relies on diagnostic error output by the drive, but also 
objectively examines the quality of channel read / write. Why 
test dangerous - obviously. If there are write errors, then the 
sector can not come back, you had before the operation value to 
the same unexpected interruption of test (Power off, manual or 
random resetting the computer) can lead to similar effect. 
Therefore, first, a second test after successful completion of 
the first, and, secondly, interrupt the passage of the test 
only on command from the keyboard BREAK.



   Indication, which is issued on the screen similar to the 
first test. Just similar action in case of error - try

"Close" the bad sectors or heads manually specifying the 
appropriate parameters. 


   A few comments on the management of error messages, you can 
pause the output text (and test) by pressing press SPACE, in 
this state cancellation further passing the test - a key

EDIT / C, well and continues to test the ENTER key.


   At the end stage of testing, connect the hard drive, now you 
need to create a logical structure for data storage. 



  1.2. Creating information sections


   As for the floppy disk, hard disk space
need to create something like a directory
information from which the operating system will find it 
necessary files. However, the structure of such a catalog is 
much more complicated than for a floppy disk. Firstly, 
comparable volumes, stored on a floppy disk and hard disk

Secondly, I would like to be able to

run multiple operating systems and even different "classes" of 
computers within a single disk (good volume disk is completely 
allows). 


   Why use multiple systems? This
question should not be considered here, but
briefly, I note that none of the existing on ZX Spectrum disk 
systems are not fully covered by all the interests of all 
users. TR DOS de facto become the "general" system, including 
storage game programs, Is DOS - a system for record keeping, 
Micro DOS - the best tool for programming, etc. And none of the 
They do not have to date, say, mechanism for user-level use of 
additional memory. Except it is quite possible to combine the 
use of the same hard disk ZX Spectrum and IBM PC. To combine

All of these requirements was developed format
storage, which is sufficient
Shadow has been supported by Monitor.


  1.2.1. Global Partition Table (GPT)


   First, you need to separate
access the hard drive from the ZX
Spectrum and, if necessary, other OS
computers. To this end, the disk is created,
so-called master boot record (Master Boot Record, MBR), and in 
it primary partition table (Global Partition

Table, GPT). The idea is this: one section - one system.


   In the submenu, select Hard disk utility
Partition manager item and enter the partition editor. Note the 
name of a submenu, it must be "Global partition manager ", but 
if you're in "Local partition manager" means

that the hard disk has been used
on the ZX Spectrum, and the MBR with GPT created.


   Look at the current main table
section, select Partition
information. This will display a table

which is displayed on the right partition type, and
left - the volume of the partition in megabytes. Refuse to 
watch the table you can use the button EDIT / C. Type Unused 
means "empty" space (the free account in the table do not 
correspond to any type). If your drive is not new, it is likely 
the entire volume will be divided into several (Or one) of 
sections of MS DOS or another. Use paragraph Delete partition

you to remove unwanted sections (the cursor on the screen to a 
busy recording and press ENTER).



   Now you can create a special "Spectrum" section. Select 
Create partition ..., appeared in a familiar table, select the 
line Unused, then press ENTER. Edit if you want the number to 
the right side of the line. As already mentioned, this number 
specifies the amount of new partition. If work with other 
computers is not expected to leave the number unchanged. 

Again, press the ENTER. Table
will create a section called MFS, and the specified volume. 
Item Create partition ... can only create a partition MFS, for

create other types of sections should be
use appropriate programs
other operating systems.


   If you intend to work with multiple computers, you can 
"break" the hard drive standard means, for example, on the IBM 
PC, for example, the program fdisk, leaving the partition MFS 
desired location. 


   A few comments. Spekrumovsky section MFS can be only one. 
Several MFS partitions allowed for future extensions of the 
system, but the current work is only the first of them. All in 
all the main partition table can contain up to four entries. 


   Note that all steps for editing the partition table is a 
parameter myati computer, you can delete and create partitions 
as you like, but in order that would have got information on a 
disk, select the Write to disk. And only after the confirmation 
key (Y) primary partition table is written.

Item Restore from disk, to copy in the computer memory of the 
current table from the disk. If you change anything, while in 
sub-editor, then when you try to exit the menu you will be 
asked or write the changes (again, the key is Y), or abandon 
the changes and leave everything as it was (any other key). 
Serious about changing the partition table, since format change 
Table violates existing relationships and can lead to loss of 
previously contained hard disk media.



   Notice that I did not say anything about the maximum size
Section MFS. Indeed, its size
virtually unrestricted. Although those
two-level monitor can have access to the volume
about 1800 mb, the volume of the partition can be
more, but the "extra" part just disappears
in vain.


   Once the section of MFS was founded in the main
partition table in sub-Global
partition table "open" paragraph Local
partition table. By selecting this option you get into a 
similar sub-editor of the local sections or subsections. 


  1.2.2. Local table (sub) partition


   Created in the main table, "Spectrum" section of MFS, 
should, in turn, be divided into one (but, rather, multiple) 
subkeys. Each subsection able to "carry" its operating system 
in the ZX Spectrum. In the current version Shadow Monitor 
provides the following OS types: TR-DOS, Micro DOS, IsDOS. 
Future versions may add other systems, if need be.


I note that only the TR-DOS until completely
supported by integrated software
Enablement Shadow Service Monitor. For
other OS should be the appropriate drivers in these OS.


   Immediately Noting the limited section of MFS -
it can contain up to 63 different sub-sections, up to 32 MB 
each. 


   In addition to topics such as different names, you can 
create several sub- the same type but with different names. The 
name can not exceed six characters. 


  1.2.2.1. Collection of floppies (Subsections
TR-DOS)


   The most important (and difficult) feature built-in software
is an attempt to emulate the hard drive disk-TR-DOS. Due to 
different circumstances and despite the glaring errors and 
shortcomings it is this system has become 

the most common for the Spectrum-compatible computers in our 
country. Therefore, it is the OS from the beginning given the 
most attention. 


   When comparing the amount of disk, which is oriented TR-DOS, 
and the volume of sub-section on the hard drive immediately 
catches eyes disparity proprietary information in the directory 
disk. Directory was not designed for large volumes. Attempt

somehow change the system itself, "fit"
its parameters to the hard drive will inevitably
would lead to incompatibility between the new and old versions, 
and finally - just to the new operating system, and with 
initially poor performance. Not trying to revive the TR-DOS, 
the Shadow Monitor, at the same time, makes it possible to use 
the hard disk to work with the old system. 


   The idea is very simple - the hard drive
is a collection of psevdodisket,

format which corresponds exactly to
real floppy disks. Special funds
allow you to "embed" such a floppy disk in the "normal" drives, 
and TR-DOS did not even realize that working with the emulator. 
Directly devoted to the work is integral part of this 
description, but here I will tell you how create a collection 
of ramdisk (sub TR-DOS). 


   First you need to create a sub-
TR-DOS. Select Create partition ...
(Remember, this should be done in the submenu
Local partition manager). Move the cursor to the line that says 
Unused (at the beginning a single line), press

ENTER. The line appears TR-DOS -
again, press ENTER. Now it is necessary
enter the name of the subdivision. This name will be in
subsequently used to access
stored in subsection ramdisk. It
can contain up to 6 characters. Fix a name to press Enter. 
Finally must choose the amount of sub-section - introduction

dite representing the number of ramdisk contained in this 
section. The minimum number of drives - one, the maximum - 51 
(of course, if you have enough free places). By default the 
maximum possible in this subsection number. Fix the number of 
ramdisk - press the ENTER. In contrast to the global partition 
table, to keep in mind all the changes associated with Local 
table troublesome, so the program immediately offered to make 
changes the hard disk. If the

answer key (Y) will be made marking the appropriate subsection, 
which may take some time. At the end of Markup control returns 
to the editor local subdivisions.



   You can create multiple collections ramdisk, it is only 
important that the names would they have were different.




   Bear in mind one thing. Collection ramdisk can
be removed as well as the section in the global table (just 
like any other subsection, paragraph Delete partition ...), but 
only in its entirety. Current software does not provide a 
decrease / increase the size of sub-section. 


   Now being developed program to support hard disk of some 
functions Shadow Monitor will require the hard disk of a 
certain amount of memory (Planned to 3-5 MB). Likely

sub-type to use should be
be Micro DOS. Therefore, it is recommended to leave a few 
megabytes of vacant. 


  1.2.2.2. The topics in operating systems


   Creating a sub IsDOS and Micro DOS
does not substantially different from the creation of 
sub-TR-DOS. Select Create partition ..., move the cursor to


free sub-section (Unused), then
ENTER. SPACE key to select the desired
type, fix the selection by pressing ENTER.
Then enter the name of the subkey (not more than
six characters), record the name, and finally set the volume of 
sub-section, in kilobytes. Volume subsection shall not be less 
256KB or exceed 32MB (or more precisely 32767Kb). 


   As for the sub-TR-DOS, you can create several sub-sections 
with one type of OS, but different names.



   Created a subsection - it's just selection (reserved) seat 
for the selected operating system on your hard drive. For real 
the OS driver is required, written in Under this OS. In the ROM 
contains all the necessary tools (RST 8 calls) to maintain such 
a driver. There is no doubt that Soon the driver will be 
written for both systems. Text esperimentalnogo

driver (beta-version) for the system IsDOS
given in Appendix 2.

 1.3. Work with a hard disk for TR-DOS


   As already mentioned the work of the hard drive within the 
TR-DOS does not differ from that of the real diskettes.



  1.3.1. Virtual and physical drives


   Hardware and operating system support TR-DOS (Beta Disk 
Interface) has historically maintained for up to four real 
drives. In the system they are designated symbols A, B, C and 
D, respectively. Really well connected one, maximum two

drive devices C and D, as it were missing. Originally it was 
planned specifically to These are not used to assign symbols 
created on your hard drive psevdodiskety. These becomes virtual 
drives - for TR-DOS they are, and to Beta Disk

Interface does not. However, it turned out
possible (for consistency) predusmot
Ret such an opportunity for all four
devices.


   But the question arose - how to tell the system
that, say, drive B is now
physical (if it is connected to a computer) and not virtual, 
and vice versa? To exit from this situation, we introduced the 
notion of Communications and floppy disk image on your hard 
drive. If the connection is established - the drive is virtual, 
and when it receives a choice of physical

drive is not happening. If there is no connection -
physical drive.


   This rule has one exception -
this device A. When you work from TR-DOS -
it is never virtual.


  1.3.2. Connecting the floppy image


   Establishing a connection between the device and
ramdisk is carried out in sub-Hard
disk utility. For each device has

click Mount, followed by the name of the virtual drive. 
Selecting this item leads to the appearance on the Today screen

table of local chapters. From this it is necessary to select a 
collection ramdisk (the choice is fixed by pressing ENTER). 
After that comes Directory collection, move the cursor to the 
desired drive and fix a choice. 


   The name of the selected (connected) ramdisk appear in a row 
Mount. The name of the compound, the first is the name of the 
collection (sub-TR-DOS), and by the character "\" should be the 
name of the disk image. 


   Now, any appeal from the TR-DOS or
monitor to the appropriate virtual
drive will be "sent" to the hard
disc. You can "format" ramdisk
(I choose "quick" formatting in
Disk Utility menu item Quick format
disk), and copy the virtual disk
files with a real disk.


   The current target is automatically stored on your hard disk 
and restored when the "cold" start your computer. 


  1.3.3. Disconnecting from a virtual drive


   If you must break the link between
device name TR-DOS and ramdisk on
hard disk, for example, that would return
physical drive B, you must select
click Dismount ... submenu Hard disk
utility. In this case, all items are replaced by the Mount 
Dismount. Select corresponding to the required disk, for 
example Dismount B. All items Dismount again "turn" in the 
Mount, but the selected item disappears name ramdisk. 


  1.3.4. Features of the monitor and
TR-DOS


   So, plugging the hard drive, making for
its structure and sub-collections
linking the ramdisk and floppy drive, thus

create a virtual disk, you can proceed to the normal daily 
work. Now let's talk about some of the features this work.



   Prepare to be that some small portion of programs previously 
more or less worked with the floppy TR-DOS, now will not work. 
This applies mainly to the old programs that do not take into 
account especially the functioning of the disk system, or, by 
its very nature, very closely to "communicate" with the disk 
controller. You make the inevitable changes in the codes of 
TR-DOS, if possible not touched "bottom"

level of the system and vital functions.
But "there is no perfection in life, and
that, alas, those changes will affect.


   For the "softening" of the situation and help "wrong" 
program, left a loophole. This device A. If access to this 
"drive" is from the monitor (downloading files from the 
debugger, disco curves operation in the menu), then no 
restrictions. If running TR-DOS, then passing the all-purpose 
drive A is always a physical device. Made it deliberately to 
ensure that the work of those programs that use non-standard

TR-DOS, or can not work together with
Shadow Monitor. In the future we plan to make this property 
konfigurabelnym. 


   A few words on computer startup. If the menu "Disk Utility" 
item "Autostart" is in the ON, the

at any time the computer boots (after the "cold" or "warm" 
reset) will occur automatically run the operating system 
located on the device specified in paragraph "from drive" the 
same submenu. Do not forget to record the current state of the 
nonvolatile memory. For a system of TR-DOS, this means that the 
program will attempt to "Boot ", if any program on a floppy 
disk or psevdodiskete present. Fach cally as it is automatically

Pressing ENTER on the menu 128 BASIC,
and the system passed the command RUN "boot"
for device A, and RUN "x: boot" for the other (where x - drive 
letter). Thus, every time you automatically find yourself in a 
familiar environment for themselves. Note: not all file shell 
("butts") will automatically loaded from the device,

distinct from A. This applies to those of
them who are supposed to, firstly, a fixed allocation of memory 
after the start (note the two extra characters in the command 
RUN Device B. .. D). A Second, for those who do not check the 
name drive its load, such programs

trying to load your files are always
fixed disk drive (A).


  1.4. The work of other operating systems


   As already mentioned for the OS is different from TR-DOS 
requires a special driver, which will provide access to poison 
RA OC to the selected hard disk partition. Currently, work on 
connecting the two systems Micro DOS and IsDOS. Micro DOS (the 
port of CP / M) - full fledged operating system, initially 
focused on the hard disk drive is needed above all to improve 
the functioning of the Shadow Monitor. The system will be 
completely transparent to the user - that is, if you want (or 
do not desire "), he did not know that such a system installed 
on his computer. The main objective of the project - Support 
for a programmer, I remind you that most of the TM was written 
programs that use CP / M.



   Popular System Is-DOS, in my opinion,
paradoxically, was not originally intended to use the hard 
drive. There is no lack of support in view of the disc itself, 
but the lack of a core system to boot from devices other than 
floppy disks. 

This creates certain inconveniences, such as when working with 
the controller computer KAY - booting takes place from floppy 
disk, then loaded the driver hard drive. Programmers or firms

Iskra Soft will make the appropriate adjustments (or be told 
how to avoid these difficulties), or I'll try to think of 
something. 


  2. Menu


   To service the hard drive to the main menu of the Shadow 
ServisMonitora made submenu Hard disk utility.



  2.1. Hard disk utility


   In this menu all operations for finding, connecting and 
maintaining a hard drive connected to the control of external 
devices SMUC. Log in This submenu is only possible if the 
testing equipment controller for SMUC 

"Cold" start the computer, was found
Interface IDE. Otherwise, the submenu
available, which means that no interface IDE, the controller or 
malfunctions in equipment (see "Installing a hard disk). 


  2.2. Hard disk utility / 0. Previous menu


   Return to the previous menu.


  2.3. Hard disk utility / A. Mount on A


   Create a virtual device - the appointment of ramdisk (disk 
image) on the device listed in the menu. From the table appears 
to select a collection ramdisk (sub-type TR-DOS), and then you 
want the disk image. Selection is control keys cursor or 
"mouse". In case of successful communication addressed to 
ramdisk (including the name of the collection) will be 
indicated in the menu bar. WHO 

You can change an existing connection without
prior removal of the current.


  2.4. Hard disk utility / A. Dismount on A


   Release the device listed in the menu, "breaking" link from 
the device ramdisk. A further appeal to the device will lead to 
the choice of physical disc.



  2.5. Hard disk utility / Z. Dismount ...


   Change the value of teams in points
Mount / Dismount the opposite.


  2.6. Hard disk utility / P. Partition
manager


   Back to the menu - editor tables
sections. If the hard disk failed
to find a special "Spectrum" section
MFS, will be carried out "direct" transition to a sub-editor - 
Local 

Partition Manager, bypassing the global table. Otherwise, the 
editor will be selected by the global tables - Global Partition 
Manager. 


  2.7. Hard disk utility / S. Set Up


   Back to the menu - the identification and
Test your hard drive.


  2.8. Hard disk utility / P. Partition
manager / 0. Previous menu


   Return to the previous menu.


  2.9. Hard disk utility / P. Partition
manager / L. Local Partition table


   Go to the sub editor of the local
Table subsections.


  2.10. Hard disk utility / P. Partition
manager / G. Global partition manager



   Go to the menu editor, Global
partition table.


  2.11. Hard disk utility / P. Partition
manager / V. Partition Information


   Displays the global or local partition table, depending on 
the the current menu.



   The global table is located on the left
the name of the partition type (MS DOS, OS / 2, MFS and
etc.), and the right - the volume of the partition in 
megabytes. In the local table, in addition, shows the name of 
sub-section, the amount given in kilobytes. Not occupied area 
on the hard disk shows the word Unused. necessary observation: 
there is a minimum volume, which can still be employed by the 
system and hence is shown in table. For the global table - is 1

MB, for local - 256 KB. Back to the menu - key EDIT / C.


  2.12. Hard disk utility / P. Partition
manager / C. Create partition


   Create a section or subsection in the global or local table. 
In the resulting screen, the current partition table you must 
select the free space (line Unused), then edit the field 
consistently. Fixing the values ​​in the field - key Enter. 
Recreate existing section or subsection is impossible, it 
should be previously removed.



   For the global table can only be
choice of volume created by "Spectrum" section of the MFS. This 
section of the current version of the program can only be one

The default is invited to take them all
free hard disk space.


   In the local table, you can create up to 63
subsections with different types of operating
systems. The choice of system type (first field)
by pressing Space, fixation

choice - press Enter. Next, you need
enter a unique name for the subkey that contains no more than 6 
of any character except a space. Finally, we must choose volume 
subdivision. For a collection of floppy disks amount specified 
in the ramdisk, the maximum number that can not be more 51. For 
the other subsections of kilobytes. 


   Incorrect parameters entered in the editor, rejected the 
program, while in bottom of the screen error message,

and invited to re-enter incorrect
field. Interrupts the operation of a section
Key EDIT / C.


   Real-time creation of sub-
different for different types. For TR-DOS subsections are 
prompted to write the changes to the table on the hard drive 
for others - this action is delayed until exit from the 
submenu, or to push 


records (see Partition manager / Write
to disk).


  2.13. Hard disk utility / P. Partition
manager / N. Rename partition


   Change the name of the subdivision. Chosen
only for the local table. Select
list and edit the desired sub-
name. Real account name change is delayed exit from the 
submenu, or to forced entry (see Partition

manager / Write to disk).


  2.14. Hard disk utility / P. Partition
manager / D. Delete partition


   Delete section or subsection of the global or local tables. 
Select a topic is carried out appears in the list. The actual 
recording altered table is delayed exit from the submenu, or to 
forced entry (see paragraph Partition manager / Write to disk).



   The current version of the software is deleted only from the 
corresponding entry in the table, no changes in the body 
section is not performed. Therefore, if in the future when you 
create a partition pointers in the table would be similar to 
the signs to the remote interface, then will "recover" 
information. K this feature should be approached very

caution, as in the case of any changes on the disk between the 
time of removal and "recovery" partition, it is possible the 
partial or total destruction of information in this section.



  2.15. Hard disk utility / P. Partition
manager / A. Delete all part


   Complete cleaning of global or local sub-tables. The real 
record "clean" the table is delayed exit from the submenu, or 
forced to write (see Partition manager / Write to disk).



   Cleaning the table does not lead to physical changes in the 
content sections. 


  2.16. Hard disk utility / P. Partition
manager / R. Restore from disk


   Loading into memory the current table
hard drive. All changes made to a table in memory (and not 
recorded on the disc) disappears. Note that

creation of sub-TR-DOS requires immediate modification of the 
table on the hard disk, and thus restore the previous state is 
meaningless. 


  2.17. Hard disk utility / P. Partition
manager / W. Write to disk


   Write table to disk. Usually, partition table editor makes 
changes to the copy of the table, which is in the computer 
memory. This choice leads to a recording of this copy on the 
hard disk. 


  2.18. Hard disk utility / S. Set Up / A.
Auto detection hard disk


   Setting up the disk (extract from the hard drive of his 
"geometric" parameters). Each disc equipped with interface IDE, 
there is a command whose execution makes the device "tell" 
about yourself. The result is, in particular, the size of the 
hard disk - the number of cylinders, heads and sectors. In 
fact, the parameters obtained may not have nothing to do with 
real "geometry" inside the disc, but the exchange on the 
interface occurs with the use of these particular

parameters.


   Read from the hard disk parameters
immediately appears in the menu
Cylinders, Head and Sector.



  2.19. Hard disk utility / S. Set Up / O. on
start


   Disable (or enable) the fulfillment of
"Home" settings on the hard drive. When
ON position, automatic tuning
happens every time from cold start the computer. If, however, a 
team of detection, the drive is performed correctly, then the 
dimensions must be set manually, record them in volatile 
memory, and disable this menu item (OFF).



  2.20. Hard disk utility / S. Set Up / C.
Cylinders


   Set the number of cylinders of your hard
disc. The line displays the current value.


   This and the following two settings define the "geometric" 
size hard disc.




  2.21. Hard disk utility / S. Set Up / H. Head


   Set the number of heads of the hard disk. ATA IDE interface 
specification is allowed a maximum of 16 heads. In line the 
current value. 


  2.22. Hard disk utility / S. Set Up / S.
Sector


   Set the number of sectors on the disk surface. The line 
displays the current value. 


  2.23. Hard disk utility / S. Set Up/1.Test


   Perform testing of all sectors
hard disk, the method of successive
reading. The screen displays the current count of cylinders in 
the event of an error is issued complete address (including 
cylinder number and head) bad sector. The test is relatively 
safe, there are no records to disk not performed. To stop the 
test 

need to press on the keyboard BREAK, and then
- EDIT / C to return to the menu. For more information, see 
"Testing your hard drive." 


  2.24. Hard disk utility / S. Set Up/2.Test


   Perform testing of all sectors
hard disk, method of successive
rewriting. The screen displays the current count of cylinders 
in case of error given the full address (including room and 
cylinder heads) bad sector. Performing the test potentially 
dangerous, as in Runtime sector may be

test data, whereas the actual data stored in computer memory. 
Abort the test is only possible with the keyboard, pressing the 
BREAK, and then on EDIT / C for return to the menu. For more 
information, see "Testing your hard drive." 



  2.25. Hard disk utility / S. Set Up / D.
Delete all part


   Removing the global (main) table
Partition (GPT). It requires confirmation. If yes, from the 
hard drive erased the first sector zero zero cylinder head, 
which store the partition table. In addition to GPT

destroyed the primary boot record
(MBR, BootRecord), the operating systems of other computers (eg 
IBM PC). 


   The operation is designed to re-plug hard drives, in case of 
erroneous entries in the GPT, remaining after partitioning with 
other "geometric" parameters. And if you do not want to use the 
hard drive on other types of computers.



   Removing GPT leads to the fact that the monitor will no 
longer finds the sub-MFS, 

this leads to an automatic stop
All virtual disks. Selecting
"Partition manager" will give a global menu
partition table.


   Despite the fact that so little is removed,
access to all the available hard disk space
data becomes impossible after this operation! Although the 
actual data are not erased. Therefore, re-partitioning the disk 
with the same parameters (partition, with the same

size as before to remove GPT)
would lead to "restore" old information. To actually delete the 
subkeys necessarily use the points

"Delete all part" in global and
in the local partition table.


  3. Terms


  ATA (AT Attachment Standart)

    Standard manufacturers to Connected
    of peripherals. By device
    properties include a variety of drives


    information (Hard dis
    semiconductors and CD-ROM). The standard defines an
    paratnoe connection of devices and prog
    rammno hardware and protocols work.

    One port can support up to

    two devices.


  Boot Record

    Start recording or start prog
    Ramm, usually stored at the beginning of time
    case. Primary loader reads

    the record and passes control to it.

    Assigning an entry - to download selected
    tem. The need BootRecord

    due to "ignorance" of the primary

    bootloader (stored in ROM) on the inner
    tic device specific system.

    The hard disk drive, where usually present
    corresponds to a few systems exist so

    called the master boot record

    (See the MBR).



  GPT (Global Partition Table)

    Home partition table is located

    the MBR, can contain up to four described
    satellite sections.


  IDE (Integration Drive Electronic)

    Standard external conditions
    ful to the computer. Historically, yk
    repivsheesya name for certain

    type of hard disk drives. At the present time
    name standardization of the interface holds
    preserves CAM Commitete (see ATA)


  MBR (Master Boot Record)

    Master boot record (see Boot

    Record). Proposed by IBM standard
    Dart on storing data on hard

    drive requires a major

    boot record on zero physical
    com sector of the disk. MBR consists of

    program start the computer (IBM PC)

    and the main partition table (GPT), from

    which loads the program selects
    muyu operating system (which occupies


    usually the entire section, ie, one entry in

    table).


  MFS

    Format developed by the MOA, for storage
    of information on hard drives spec
    room-compatible computers. MFS "snakes
    is called "standard IBM's storage

    data.


  Winchester

    See Hard disk.


  Virtual disk

    The name of the disk, when accessed from

    TR-DOS is "diverted" to the

    hard disk. Virtual disk under
    changing a physical disk. For cos
    denmark virtual disk should be

    "Connect" disk image on vincheste
    solution to the disk name.



  The geometry of the hard disk

    Maximum cylinder number, head

    and sectors used in the treatment of

    the hard disk. Virtually every

    model has its unique to her,

    geometric dimensions.


  Master boot record

    See the MBR (Master Boot Record).


  Global Partition Table
    See GPT (Global Partition Table).


  Head (magnetic)

    The device that reads the sector with one
    Noah disk surface. As

    Typically a disk is slightly
    surfaces, and each of them used
    uses its own magnetic head. But
    measures the magnetic head is of
    real part location indicator

    the desired sector on the disk.



  Hard drive

    Drive information with non-replaceable

    rigid surfaces. Differ

    interface used to connect

    computer (usually say "the type of wine
    Chester "), volume, geometric

    size.


  Peripheral control unit

    The first universal controller, once
    The developed Scorpion 'MOA, for the spectrum
    Terumah-compatible computers, prednaz
    The value for the hard

    drive with an IDE and any period
    feriynyh card computer IBM PC XT

    (Supported only by reference to

    I / O ports). In addition, the

    controller chip set

    volatile clock (CMOS) and energy
    gonezavisimoy memory (NVRAM).


. Num defl. Num + 1

        dw? a

        endm

. C macro? A;; placement team c absolute address

        loff%. num, <>
. Num defl. Num + 1
? A

        endm

. Ce macro? A;; placement prefiksiruemoy commands

                        ;; Abs. address

        loff%. num, <+ 1>
. Num defl. Num + 1
? A

        endm


.0 Dw macro? O;; the construction of the table

        dw. addr '? o'

        endm

ltable macro;; create table

        if. num eq 0; checking the existence of Address

         exitm;; exit from the macro, if there is no address

        endif

        dw 0ffffh;; signature
. Numct defl 0; counter tags

        rept. num;; cycle generation table

        .0 Dw%. Numct
. Numct defl. Numct + 1

        endm

        endm

; Macros to work with TM

DISKBIOS macro? C,? B;; call the disk subsystem

        ifnb <? c>

         ifb <? b>

        ld c,? c

         else

        ld bc, + (? b shl 8) or? c

         endif


        endif

        rst 8

        db R8DOS

        endm

string macro? t;; forming a line of text

        db? t, 13, 10

        endm


        subttl 'Code'

        page

;================================================= 
============== 

        ; Proper driver program


        cseg

        lofinit; initiate a counter table

                                ; Address

; Header drivers

        . Dw INSTALL; n / n instolyatsii driver

        . Dw BREAD; p / n Read Block



        . Dw BWRITE; semiconductor recording unit

        . Dw BINIT; n / n driver initialization

        db 0E0h; 0 .. 3 for virtual device number.

                                ; Drive

                                3 driver with buffer / buffer

                                , 5 ban / bit. reading for the 
RST 

                                , 6 ban / bit. records for the 
RST 

                                , 7 by email. CD / through it

        db 4, 0 request at a QVST

                                , 1 auto-flash

                                2 trdos / No

                                ; 7 does not / work out bugs

        dw 0; offset to IM2

        db 0FCh; type trdos?

        db 1, number of attempts to read / write

        dw 0; address of the buffer driver

        , The beginning of the modification of parameters

        db 0

        db 0


        dw 0

        dw 0

        dw 0

        dw 0


        dw 0

        dw 0

        dw 0

        dw 0

        db 0

        ; The end of the modification of parameters

        dw 0

        db 0

; Reading block from the hard drive
; Options for treatment:
; B - number of blocks
; DE - number of the initial block
; HL - address of the memory
BREAD:

        ld a, b

        or a

        ret z; invalid number of blocks
. C 
        ret c
. Ce <ld (stkold), sp; save stack pointer>
. C 

        jr nc, r_even; even block, located at the beginning

                           ; Sector


        , The processing of the first unit, located second in 
the sects. 

        push bc

        push de

        push hl
. C <ld hl, buffer; reading sector in the interim

                           ; Buffer>

        DISKBIOS $ hddrd, a

        jr c, rw_error; transition to generate an error

        pop de
. C <ld hl, buffer + 256>

        ld bc, 256

        ldir; transfer of power from the clipboard into the 
program 

        ex de, hl

        pop de

        inc de; the next sector in sub-section

        pop bc

        dec b; counter blocks

        ret z; this unit was the only
r_even:

        srl b; convert counter blocks

                        ; Sector counter

        jr z, r_end; was the only unit in the early

                         ; Sector



        , The processing core of the array of blocks that fit

        ; A whole number of sectors

        push af; preservation of the flag C - the presence of

                         ; Last sector


        ld c, $ hddrd; read command unit
. C 


        pop af
r_end:

        ret nc; all blocks read

        ; Processing the last block, located at the beginning

        ; Sector

        push hl
. C <ld hl, buffer; reading sector in the interim

                           ; Buffer>

        push hl

        DISKBIOS $ hddrd, a

        jr c, rw_error; transition to generate an error

        pop hl; address of the intermediate buffer

        pop de; address in program memory

        ld bc, 256



        ldir; transfer of power from the buffer to

                                 program

        ret

, Forming an error code, restoring the state of the stack,
, Since the output may be due to sub-
rw_error:
. Ce <ld sp, (stkold)>

        ld a, 10

        scf

        ret

; Conversion unit number in the number of sectors in sub-section
, CY-bit output indicates the position of the block in Gaza
; == 0 - in the beginning, == 1 - at the end
blk2sect:

        srl d

        rr e

        inc de; pass service sector section!

        ret



; Read or write blocks of sectors, the command type is 
determined by ; Contents of register C

moveblock:

        push hl; address in memory

        push de; number of first sector

        push bc; register B sector counter

        DISKBIOS; the operation

        jr c, rw_error; transition to generate an error

        ; Correction facilities sector

        pop af

        ld b, a

        pop de

        add a, e

        ld e, a

        jr nc, $ +3

        inc d

        ; Correction of address allocation

        pop hl

        ld a, h

        add a, b

        add a, b

        ld h, a

        ret


; Recording block on the hard disk
; Options for treatment:
; B - number of blocks
; DE - number of the initial block
; HL - address of the memory
BWRITE:

        ld a, b

        or a

        ret z
. C 

        ret c
. Ce <ld (stkold), sp; save stack pointer>
. C 

        jr nc, w_even; even block, located at the beginning

                           ; Sector

       , The processing of the first unit, located in the 
second sector 

        exx
. C <ld hl, buffer + 256; address the "second" unit sector>
. C <ld (addrbuf), hl>

        exx
. C 


        inc de; next sector

        dec b; counter blocks


        ret z; this unit was the only

w_even:

        srl b; convert counter blocks

                        ; Sector counter

        jr z, w_end; was the only unit in the early

                         ; Sector

        , The processing core of the array of blocks that fit

        ; A whole number of sectors

        push af; preservation of the flag C - the presence of 
the latter 

                        ; Sector


        ld c, $ hddwr; team record in the block
. C 


        pop af
w_end:

        ret nc; all blocks read

        ; Processing the last block, located at the beginning

        ; Sector

        exx
. C <ld hl, buffer; address the "first" block sector>
. C <ld (addrbuf), hl>

        exx

; Recording unit in the "part" of the whole sector through the 
buffer ; Buffer address is given from the outside change the 
command code write2:


        , Read the required sectors in the buffer

        push de

        exx

        pop de
. C <ld hl, buffer>

        DISKBIOS $ hddrd, a

        jr c, rw_error; transition to generate an error

        ; Change information in the buffer

        exx

        push de

        push bc
addrbuf equ $ + 1
. C <ld de, buffer + 256>

        ld bc, 256

        ldir

        pop bc

        pop de

        ; Record buffer pozdazdel

        push de

        exx

        pop de

. C <ld hl, buffer>

        DISKBIOS $ hddwr, a

        jr c, rw_error; transition to generate an error

        exx

        ret

; Driver initialization
BINIT:

        or a

        ret

; Installation of the driver (device selection)
; Number of the device in Akk (0 - A, 1 - B. ..)
INSTALL:

        or a

        jr z, installErr; A device is not supported

        cp 4

        ret nc


        ld d, a

        Calculation of the address descriptor table

        ld l, a

        rlca

        rlca


        ld h, a

        rlca

        rlca

        add a, h

        add a, l
. C <ld hl, partPtr; current descriptor table>

        add a, l

        ld l, a

        jr nc, stdrv1

        inc h
stdrv1:

        ld a, (hl); type previously connected sub-

                        , (Or ​​0)

        push de
. C 

        pop de

        jr nc, setOk; successfully

        , May change in the table of

        xor a; set "Auto-"
. C 

        ret c; subsection not found
setOk:

        ; Check the partition type

        ld a, (hl)


        and not RdOnly; to remove bits of read-only "

        cp IsDOS

        ret z; yes, this subsection Is DOS, the connection

                        ; Produced

        ld (hl), 0 to remove the "reference" section of a

                        ; Driver

        jr installErr

; Connect subsection (for all subsequent transactions through 
the RST 8) mount:


        push hl

        or a

        ld a, d; device number

        ld b, 10010000b; Auto-+ back into memory

                             ; Handle

        jr z, setcom; first connection (on the table

                          ; Auto-)

        , The connection has been - to set the saved settings

        ld b, 00100000b; connect from the handle

        ex de, hl; de - address descriptor
setcom:

        or b; add a command code

        DISKBIOS $ mount

        pop hl


        ret nc

; Error - IsDOS drive (section)
installErr:

        ld a, 9

        scf

        ret

; Verification operation is interrupted from the keyboard
testBREAK:

        ld a, 7Fh; test pressing BREAK

        in a, (0FEh)

        rra; pressed SPACE?

        ccf

        ret nc

        ld a, 7Fh

        in a, (0FEh)

        rra; pressed CS

        ccf

        ret nc

        ld a, 20; error code is' pressed BREAK "

        scf

        ret



        subttl 'Data'

        page

;================================================= 
============== 

        ; Working variables drivers

; Table of the current descriptors
partPtr:

        rept 21 * 4

        db 0

        endm

, The initial stack pointer, at the entrance of the driver
stkold: ds 2

; Buffer to accommodate the "not a" sector
buffer:

        version

        string 'driver for the IDE hard disk controller's SMUC'

        db 0

        ds 512 - ($ - buffer)


        ; The end of the hard disk drive
;================================================= 
============== 

; Table to convert addresses
; Automatically generated macro

        ltable


        end



   Appendix 3


   Description of access to IBM-card peripherals that are 
connected to the controller SMUC. 


   The scheme allows the decoding controller
choose any port I / O peripheral board IBM PC XT, connected to
SMUC.


   I / O ports IBM-deshifiriruyutsya devices with 10 address 
lines (A9. .. a0). In this case, the specification of IBM,

a9 line for "external" devices IBM PC XT
should be able to log. 1, which is a hardware obespetsivaetsya 
in SMUC. The remaining 9 lines, but put them all in the address


ZX Spectrum space is difficult - it is necessary to provide 
decoding and other devices of the controller. Therefore, the 
two older line (a8 and a7) are multiplexed - their

state in the I / O operation is static. The value of these 
addresses should be written in a special control register 
controller. Register address in the space of TR-DOS ZX Spectrum 
- 0ffbah. Since the other bits control register is used for 
internal purposes the controller, it is necessary to ensure

their correct installation.

Quest bits a8 and a7:
D7 D6 D5 D4 D3 D2 D1 D0
 0 1 1 1 0 a8 a7 1


   Another installation is in bits D7, D6, D5,
D4, D2 and D0, except as shown above, is unacceptable and may 
lead to the controller inoperable. Rather, in final version to 
support the controller (4.0) will be provided for special 

Call RST 8, correctly sets the address lines a8 and a7. The 
final information for the software you can from the author (see 
end of article). 


   The remaining seven address lines directly
transferred to IBM-slot. To select the IBM-device is necessary 
to ensure full shestnadtsatiznachny address I / O port ZX 
Spectrum, which should be set line choice of the slot and 
addresses in it. Address to the address should be made in

address field TR-DOS.

Selecting IBM slots:
C0A15 A14 A13 A12 A11 A10 A09 A08 A07 A06 A05 A04 A03 A02 A01 
A00  0 a4 a3 January 1 a2 a1 a0 1 1 1 a6 a5 1 1 0

B0
AN symbols denote address lines
I / O ports on the cards IBM PC XT.



   Example card access serial COM1, connected to
controller SMUC. Base address of COM1 device specified in the 
IBM-compatible cards - 0x3f8h. At the beginning of the content 
is determined by the control register (address lines a8 and 
a7). To address 0x3f8h a: a8 = 1, a7 = 1, and hence in the 
control register must write 7bh: 

D7 D6 D5 D4 D3 D2 D1 D0
 0 1 1 1 1 0 1 1

Next, calculate the address of the external devices in the 
field of TR-DOS, substituting in the appropriate table address 
lines, obtained 78feh: C0

A15 A14 A13 A12 A11 A10 A09 A08 A07 A06 A05 A04 A03 A02 A01 A00
 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0
B0
To access the I / O ports ZX
Spectrum, addressable in the TR-DOS, in


Shadow Monitor, there are two routines that are located in the 
part of TR-DOS ROM. 

 org 3ff0h

        out (c), a
 ret
 org 3ff3h
 in a, (c)
 ret

Example of reading a byte from the data register
COM1:

 ld a, 7bh
 ld bc, 0ffbah
 call wrtrdos
 ld bc, 78feh
 call rdtrdos
 And the data in the accumulator
 ;....

wrtrdos:; entry into the port I / O
 ld hl, 3ff0h
 push hl

 jp 3d2fh

rdtrdos:; read from the port I / O
 ld hl, 3ff3h
 push hl
 jp 3d2fh

                 *


   On all matters of policy support
Controller SMUC, raised in the article,
You can contact the author via e-mail FidoNet 2:5030 / 25.1, or
InterNet: Email moa@ddeeds.spb.su, or
phone: (+7-812) -130-1995. About
acquiring controllers and ProfPZU please call (+7-812) 
-524-1653, (+7-812) -251-1262, (+7-812) -172-3117,

(+7-812) -298-0653. For a detailed directory of the services 
provided by the "Scorpion" by mail, send a request to address: 
199048, St. Petersburg, PO Box 083, Sergei Zonov.



                 *





Other articles:

Debut - "Dark Scepetre" - representative of the genre RPG. The game has amazing graphics, large, carefully traced sprite characters, excellent sound effects, great variety of commands, user-friendly interface.

Review - New Games at Moscow markets: Square Head, Sex Xonix, Dr.Mario, Crack Down, RAM, Satan 2, Shadow Dancer, Mountain Bike Simulator, 10 Fingers, Trivial Pursuit, Space Gun,

From the world of bat - a small scandal involving the KSA, a letter on ports kompyuutera Profi.

From the world of bat - readers' letters on the topic of games.

From the world of bat - "ELITE: The Great Mysteries of the Great Game?" otkpoveniya former pilot, gone on a holiday.

From the world of bat - an analytical article on the topic of games, "I you had never seen?" (Plagiarism).

Mirror - an interview with Mike Singltonom, author of such well-known games such as "Lords of Midnight", "Doomdark Revenge", "War in the middle earth", "Dark Scepetre ", etc.

Premiere - Music Player Intertia Player, Game Last Hero of the Light Force, sistemki Supercatalog and Text-Designer, a game DUNE 2.

System - great stuff on the computer ports PROFI.

Designer - a monumental paper on the universal controller peripherals SMUC.

Workshop - a new section specifically for those who love to draw. Section about the artists and for artists. Presented several papers.

Secrets - A special section for fans of "eternity." We will talk about secrets of games. Tricks of the Trade, POKES, passwords and secret codes.

Warm greetings - Visiting magazine Sinclair User - Sir Clive Sinclair. Conversation with K. Sinclair Spectrum on and around it.

Advertising - directory of software and obyavleniya.



Similar articles:
Thoughts - Worthy Is NEMO (Vyacheslav Skutin) respect?
Presentation - Presentation Games: Where Time Stood Stile, Craps, Poker, Libra.
Mosaic - Passions around any kind demopati.

В этот день...   2 May