Skip to main content

Full text of "Australian National OS9 Newsletter (March 1989)"

See other formats



ATTR Syntax: Attr filename [permissions] Usage : Examine or 
chanee the security permissions of a file Opts: -perm = turn off 

ed permiasion oerm= turn on 



f-»^i- TT..„, 



specified permission -a = 

irms : d - directory file 
wner w - write permit 
read permit to public 
ermit^o public BACKUP 

Copies all data from 
error occurs s = 
ites BASIC09 Syntax : 
BUILD Syntax: Build 
om standard input 
working directory to 
sage: Change execution 
nlenamel filename2 
tax: Cobbler devname 
current boot CONFIG 
-» ■— ' disks COPY 

Gordon Bentzen 
8 Odin Street 

s - n< 
to owi 


one d< 











one fU 

Date [t 


: Checl 

for woi 

= save 







W [i] 

Display s c, 
: Dsave [-aj 

to CO 


using pa 
process b 
output E' 
text edit 
error messa 

Usage: Chain f1^^% 

<devname> Usage : Initializes an OS-9 diskette Opts ; R - Ready L 

- Logicsd format only "disk name" 1/2 number of sides 'No of 


py all files in a directory system Opts : -b make a sys 
by using 0S9boot if present -b=<path> = make system 

MARCH 1989 


re file 
do not 



Neuisletter of the National 0S9 User Group 

EDITOR : Gordon Bentzen 

HELPERS : Bob Devries and Don Berrie 

SUPPORT : Brisbane 0S9 Level 2 User Group, 

WelcoiTfe to the March edition of the National US9 User Group Neiusletter. I guess that one of the first things that 
you mill noticei is the new format for the cover page. No, we apclogiset it wasn't done using an 0S9 iriachine. For 
those of you who are interested, it was done on a XT clone using a frtouse driven graphics package called VPGi and 
printed on a Star NX-10 ? pin dot matri>; printer in hi-resoluticn inode. Final ly* tue had the black and uhite 
original photocopied using a red cartridge. We think that it is a quite spectacular result. 

We have also decided that it luas tiiite for a slight nasie change, and \sie hope that ycu agree that 'Australian OS? 
Neutsletter* is a better title. The change in title was necessary, because lu'e wanted to ensure that any 
international readers mill be aware of the source of the publication. Already, there has been a subscription 
enquiry from the USA, and we currently have a subscriber in Nugini. We believe that there are some very talented 
people within our group, and that they deserve all the recognition that they can get. Consequently, we want to 
ensure that the source of the material , at least on a geographic basis, is recognized. 

So, if you have something to say on the subject of 0S9, and want to reach an e>;treiTiely large geographic area, this 
is your forum. The articles and suchlike that have been submitted to us frcin cur contributors are greatly 
appreciated. However, we are constantly looking for further material to include, Refiteirtber, this is supposed to be a 
collective endeavour, and believe me, it gets harder and harder for the current sfTiall number of contributors to 
continue to produce articles which are of continuing interest, on a month by month basis. 

This months' issue is once again an interesting collection of 0S9 related material. 

We had an interesting letter recently from a person who had recently purchased 0S9 from Tandy, and had decided to 
try to modify the system slightly, to suit his own needs. We decided to include his tale of the trials and 
tribulations of an 0S9 beginner, and his pursuit of the mysterious ■0S9 BOOT - FAILED' problem. After you read his 
letter, we hope that those of you who are beginners in the world of 0S9, will have a better understanding of the 
intricacies of the 0S9Eoot file, and the bootstrapping system. It should also indicate the depth of knowledge 
available from the so called Tandy technical experts. 

Incidentally, for a really good explanation of the bootfile system and the 0S9Gen command and process, we recommend 
that you read the article on page 172 of the November 198S issue of the US Rainbow magazine entitled "Boot 
Mysteries Revealed' by Richard. A, White. It is an e>;cellent article. 

Also included in this issue of the newsletter, is a precis of the documentation that comes with Shell plus Version 
2.0, an extremely powerful replacement for the Shell command. 

Bob Devries has included the first installment of the source code for his simple database written in C, This is a 
very interesting programme as it demonstrates the true versatility of the C language. The source, with virtually no 
modifications, will compile and run on an MSDOS computer, as well as on a Color Computer! It is also an excellent 
demonstration of good open programming that will allow this cross compilation. 

John Usher, one of our Brisbane members, has kindly supplied the circuit diagram for his RS232 port for the CoCo. 
If you are interested in trying to make this interface, John will sell you one of his customized printed circuit 
boards. He also has information about internal mounting for the interface, therefore avoiding the necessity of 
having a (now discontinued) Multi-Pak, 

And, finally, Rosko has submitted another Chapter in his series 'Making the most of Microware C\ 

So, if we haven't included something in which you are interested, how about submitting something yourself? Or, if 
not that, at least tell us where your interests lie, so that perhaps we can try to include something just for you. 
Until next month, best wishes and happy 0S9-ing! 

Page 1 



The 0S9 Learner 

It i5 early a.iri, and I airi taking a break froBi endless CONFIGSi DSAVES and manual thimbingsi not to mention language 
which would trtake a bullocky blush. It occurs to m that you may like to hear a learner's trials and tribulations 
with 0S9. 

Firstlyi about myself. I have been using "greycase" CoCo 1 for five yearsi progranwiiing in Basic using Tandy DOSi 
Bodified by Brian Dougan to run 35 track double sided drives. I had some progranaDes published in 'Aust. Rainbow / 
CoCo' before I severed connections with thetrn and I belonged to the BrizBiz user group, I have had my eye on 0S9 
for a feui years, but done nothing about it. Now my chance has come; a mate has gone IBM compatiblei and offered me 
his CoCo 3 512k with Tandy FD502 drive, and a completely untouched 0S9 Level 2 package. The price is too good to 
resist and I buy it. 

hkjui my troubles commence. The computer won't mork, so off to Tandy with it. Nearly three weeks later it returns - 
connections shook loose in transit from Northern Territory. I fire up 0S9 and the TV screen scrolls like crazy. 
Phone Tandy - Brisbane can't help, but they pass it to Mt. Druitt (N.S.W. ), who ring back in ten minutes. Now, 
that's good service, and Tandy are to be commended for it. (The last bit of praise they'll get in this article I ) 
■Send the disk to me, and I'll patch it, 0S9 was sold in Australia for 60h: U.S.A. power supply". 

I have since found out that the disk could have been patched here in Brisbane, and I did at least have the sense to 
ask that question. "No, must come to Sydney", says Mr. Druitt. The service was quick, and there was no attempt to 
charge me - fortunately, as you will hear later. 

While waiting for the return of my system master disk I enquired of Olaf (Tandy Brisbane), and discovered that a 
user group exists. At this stage, I was looking for someone to marry my Teac 40 track drive to the Tandy FD502 
drive in the one case. I was referred to Bob Devries, and he whipped them together in no time flat. While he was 
working, I mentioned the foregoing saga, and found out that he could have patched the System Master with no 
problem. It did come back from Sydney however, and I began sweating over the manual to work out how to switch from 
35 track single to 40 track double. (I should mention that I had obtained back copies of this Newsletter form Bob, 
who, when he found I was interested in subscribing, covered his living-room in one second flat to get an 
application form.) 

CONFIG let me down - I got a "can't link Rel module' error. I tried looking for the cause, and couldn't find it. 
After a few hours of frustration (and learning - nothing like difficulties to make you learn), I picked up the 
Newsletter copies to read and, in December's issue, Bob's article on reconfiguring for different drives! But it 
still didn't work, so back to the manual. I discovered MDIR, and compared the results with the manual. No "Rel" 
module! And no documentation in the manual about this module (that I could find). 

This morning , I swallowed my pride, and revisited Bob Devries. The "Rel' module had been lost in Tandy's patching 
efforts, and Bob fixed it. And now after many problems this evening (all of my own making), my system is properly 
configured. Well, not quite all my own making, CONFIG doesn't copy the SYS directory, nor a couple of window 
files, and I originally DSAVE'd from my 'customised' Master, instead of from the backup of my System Master, and I 
had to do it ail again. 


1. 0S9 is a most challenging system, with great apparent flexibility, and I look forward to a lot of fun with it. 

2. The manual is good, but it has its deficiencies as mentioned above. Another deficiency is a warning not to use 
'list' for execution files - use 'dump' instead. Try to find any documentaton on 'dump' in the manual, even though 
it is listed in the index' 

3. Tandy Mt. Druitt would be well advised to revise their patches for 0S9, and Joining the National 0S9 User Group 
would be an excellent way to avoid the problems I have had with the System Master disk. 

More in future issues, if response dictates. 

Ian Clarke. 


Well Ian, we do thank you for your 'Letter to the Editor" and for relating your early experiences with 0S9 as Rost 
of us can relate to your frustrations. We have had, and still do have, many frustrations with this powerful 
operating systea, and agree with your conclusion that "059 is a challenging system, with great flexibility" 

0S9 differs froift many operating systems as it can be altered so easily because the user can get to each of the 
operating systeiri aodules and change or replace them, or add others. 

Owners of MS-DOS machines for exajfiple would know that a new version is often needed when new hardware is added to 
the system. Want a hard disk? Fine, but version 2.1 of DOS won't work with this, A vers. 3.1 will support a hard 
drive, so you purchase that. Want access to extended memory? Oh no - better buy vers. 3.21. And on it goes. As 
a user of DOS you are limited to the use of hardware supported by the version you have, or a version that is 

0S9 modules can be changed or modified. There is a distinction between "user" and "system" modules. While user 
modules are loaded and used after bootstrapping a system, system modules are normally included in the Kernel and 
Eoot files. Kernel files contain the programmes that start and manage the systeni's operation normally in the files 
0S9pl and 0S9p2. System I/O drivers and descriptors are used by the Kernel to communicate with attached hardware. 
Normally you cannot change the modules in the Kernel. 0S9Eoot should contain system modules, and of course user 
modules should never be there. 

Under Microware's Level II, the Kernel includes REL, Eoot, 0S9pl, 0S9p2 & Init. The first three are stored on 
Track 3A of the boot disk and are loaded when you type DOS to start up 0S9. REL resets the system hardware, 
prepares it for 0S9 and calls 0S9pl. 0S9pl initializes the system, and Eoot loads 0S9Eoot and the disk I/O 
managers, drivers & descriptors, 

C»S9p2, Init, CC3Go, Clock, must be in your 0S9Eoot file. Init is not a programme. It is a data module containing 
system constants. 0S9p2 handles meffiory management, the module directory and functions associated with module 
iitanagement, and process control. This is the heart of multitasking capability in 0S9, CC35o now loads "Shell", 
and "GrfDrv" establishes communications with Shell and starts the 'startup' file. 

Shell handles communication between you and the computer. The programme interprets commands that are typed in and 
calls the proper operating system code to execute them. Though not part of the operating system, it may be 
considered an application programme that interfaces with the operating system. Shell is designed to be loaded 
separately from 0S9Eoot as is GrfDrv. GrfDrv needs to be loaded at the start of an 3k memory block, and therefore 
must not be merged with any of the other commands. 

Well we are now getting into the depths and also off the track. Suffice to say that we can see why Ian had trouble 
with a boot disk minus REL. 

The other important modules to do with hardware communications are "System Managers' (SCF, REF, PipeMan etc.) and 
device "Drivers" and "Descriptors". 

The standard Drivers supplied with Microware's Level II for the CoCc 3 are CC3I0 - handles the terminal functions; 
CC3Disk - handles floppy disk drives; Piper - works with pipes; RS-232 - driver for Tl; etc. 

Under level II the Descriptors provide the characteristics of hardware to the appropriate Driver and this makes it 
easy to modify hardware characteristics. DB, Dl, D2 etc. are descriptors for floppy drives, and each of these may 
provide separate data to the CCjDisk driver. 

0S9 Level 1 is not quite as easy, as the Driver CCDisk is hard coded for 35tr. single sided disks and ignores the 
characteristics in the disk descriptors. In this case the driver needs to be modified or replaced. D.P.Johnson 
(U-S.A) has available "SDISK" which is a modified device driver which looks for a descriptor and its data in a 
similar way to Level II There are also many other sources for a modified disk driver for level 1. 

This is just one example of how flexible 0S9 can be. Just add or change device drivers and descriptors to suit your 
hardware. JUST! you say? 


Gordon Bent z en. 



Making the Most of Microdjare C - Part III 

NOTE: requires soine knowledge of C and asE-ernbler (6809 or 68(300) 

by —Rosko! 

This iTionth I think we' 11 look at EOfTtething practical... the developiifent of a (sifTtple) set of functionB for 
your C library, from the design to 6809 and 68000 implefiientation. 

The set of functions (tiuo in all) ar-G to handle string comparisons without attention to upper/lower case, i.e. 
we want to compare two strings (henceforth 31 and S2) but pretend they're both upper or both lower case. This can 
be useful when a string is typed in upper or lower case, and is to be coiripared to a string with mixed case letters. 

Step one: How do you compare two strings? 

By going through both strings arid subtracting a byte in one string from a byte in the other string, until 
either a difference is found or both strings finish. Remembering that we want to achieve something similar to the 
standard functions strcmpO and strncmpO, we want to subtract the byte from S2, from the byte from SI. There are 
three possible outcomes (of interest) from each subtraction: 

1. Zero, meaning the bytes are the same, 

2. Something less than zero, which means the byte from S2 is bigger than the byte from SI. 

3. Something greater than zeroi which means the byte from SI is bigger than the byte from S2. 

Once we have found a difference, i.e. the bytes aren't equal, we can stop looking and return the result. We 
need only return the difference in the two bytes as this tells the caller whether SI is (alphabetically) smaller 
than S2, or vice versa. 

When the strings are of different lengths, one of the bytes from the strings will be zero (end of string 
marker), so we can happily return the difference between zero and the other byte. 

When the strings s^re the same, the subtraction will give zero right up to the end so we have to check one of 
the bytes to see if it is zero already. We then return zero, meaning the strings are the same. 

Step two: how do you compare two bytes, ignoring upper /lower case? 

We must first convert both bytes to either upper or lower case characters. To do this, we must see first if 
the byte is alphabetical (we don't want to change digits or punctuation), then convert it to the other case. From 
upper to lower, we can either add $20 or OR it with $20; from lower to upper either subtract $20 or AND with $df. 

When both bytes are of the same case, one can be subtracted from the other. 

Step three: implementing all this in assembly language 

1. To go through two strings and compare a byte from each, the quickest and easiest way is to have a pointer 
to each string. We can have one register pointing to our current point in SI, and another for S2. For the 6S09, 
where we normally have only X free for this, we will have to push U on the stack and use it for one of the 
pointers. For the 68000, we can use A0 and Al. 

When we want a byte from one of the strings, we can bump the pointer along to the next byte as we fetch the 
current byte like 

LDB ,X+ or MOVE.B (A0)+,D0 

2. With one function, we must keep track of the number of bytes compared (to be compatible with strncmpO), On 
the 6809, this is best done by pushing Y and using U and Y as the pointers, and X as a counter, decrementing it at 
the bottom of each pass. On the 63000, of course, registers abound, and there is this really neat intruction called 
DBNE, for decrement and branch if not equal. It first tests for equality, and if so, compares the register you 
assign to -1, and if it isn^t it decrements the register and branches. It was just made for these loops! 

3. Since we will be writing two functions which will both need to convert bytes to one case twice (once for 
SI, once for S2) on each compare, we can code the converting bit into one common routine. We will pass the byte to 
be converted in B (6809) or D0 (6S003). 

4. To compare two bytes on the 6809, one must be in an accumulator and one must not. We shall push the 
converted byte from S2, then subtract it from the converted byte from SI in B. On the 63000, we can just move the 
byte from S2 into Dl, and subtract Dl from D0. 

PagB H 


Sot without fTiuch further ado^ here is the finished result. To derrionstrate that it doesn't iTiatter mhich case 
you convert alphabetics to for the cofTiparisonT 1 fiA\/Q used an upper-case conversion for 68(500 and a lower-case for 
6809. AIsot to show that setting/reseting the case bit is no different to adding/subtracting the difference, I have 
gone for setting the bit for lower case in 6809 and subtracting the difference in 68000. (Actually) truth be known 
I wrote them frionths aparti needing stricfiipO only recently on 68000). And as the 68000 systetiis generally can 'spare 
a few bytes' and run 'quick enough anyway' t and because I had been passing NULL strings to sofne of m functions 
(1)» I added a check for NULL strings to the 68000 version. 

I hope you find soirie use for these... and PLEASE tell me if I'id boring! 

nam strings!. a 

ttl liicrwoware C functions for case-ignored string coirtpares 

* — Roskol— 15/5/88 (3/6/88) 

* these functions Are case-ignorant equivalents of the e>;isting functions 

* 'strcmpO' and 'strnciTip'. Their use is identical with the exception that 

* upper/ lower case is irrelevant 

psect 5tringsi_ai0i0, 1,0)0 


* stricmp (si, 52) char *sl) #52; 
stricfTip: pshs u 

Idu A)5 

get si 

Idx 6)5 

get s2 


Idb )>;+ 

beq i cir!p20 

don't get caught on tw 

bsr to lower 

pshs b 

Idb ,u+ 

bsr tolower 

subb )S+ 

bne iciTip30 

different so look no f 

bra icfrfpl0 


Idb )U 

. . for s2 ending first 



puis U)PC 

return in d 

* lowercase conversion 

to lower 

cmpb tt'A 
bio tll0 
C!T,pb #'Z 

bhi tll0 

orb tt$20 

make lowercase 




* strnicmp (si) s2) n) char *sl) *52i int n; 

strnicmpi pshs y,u 

Idu 6)5 get si 

idy 8)5 get 52 

ld>! 10)5 get n 

beq incmp20 none to do 
inciTipl0 Idb )y+ 

beq incmp20 don't get caught on two null's 

bsr tolower 

pshs b 

Idb ,u+ 



bsr toloiuer 

subb ,5+ 

bne iricnip30 different sc look no further 

leax -1,>: 

bne incriiplO 


Idb ,u 


5e>; return in d 

puis y,u,pc 


* stringsi.a - string conipares which ignore upper/ loiuer case 

* -RoBhof— 16/01/39 for the 6S000 

psect 5tring5i_ai0i0]0,0f0 

* int stricmp (5I1 

52) char *5l 

, *52; 




Check for null 








Fiicvea. 1 


get SI 



get S2 


niove. b 


get byte from S2 



.,. unless end of string 



.Tjask case 



and save in Dl 



now get byte froiii Si 

bsr. 5 


mask case 

sub. b 


get difference 



keep going if none 

bra, 5 


else return it 




.. for when 52 ends first 








* local toupper routine 

dfl.upper cmpi.b #$61, d0 less than 'a'? 

blo.s d0u_10 

cfiipi.b #$7a,d0 greater than ':'? 

bhi.5 d0u_10 

subi.b #$201 d0 subtract difference m cases 
d0u_10 rts 

* int strnicmp (si, 52, n) char *5l, *s2i int n; 

strnicrop: tst.l 

Hiovea, 1 
iiioveq. 1 
strnicufpl move.b 












check for NULL 

check for NULL 

get SI 

get S2 

get count N 

adjust for use in DENE loop 

but trap nil or negative count 

get byte froii! S2 

but runaiitay if end of string 



bsr.B d0_upper mask case 

move.b dB^dl and save in Dl 

move.b (a0)+id0 get byte from SI 

bsr.s d0_upper mask case 

sub.b dlid0 get difference 

dbne dii^trnicmpl bail cut if different or n— == 

bra. 5 strnicmp3 go again 

5trnicmp2 move.b (a0)+,d0 ,. for when S2 ends first 

5trnicmp3 ext.w d0 

ext.l d0 
strniciTipA rts 



SHELLPLUS Version 2.0 

The following is a precis of the documentation which comes with a newly released version of the CoCo shell module 
(shellplus)i a public doi&ain programme written by Kent Myersi Kevin Darling and Ron Lommardo. 

Shellplus will now unload (unlink) the correct module name. Previously, if the module name did not match the 
command filename you typed, shell would not unload the module, and it would stick in memory until manually 
unlinked. This shell reads in the actual module name and uses it instead of whatever was on the command line. For 
e/iample, when a command Euch as VdO/cmds/bob" is executed, the module which shell will attempt to unlink will be 
the module named "bob". 

To prevent attempted execution of a write-only device as a procedure file, and to help with use of L-II window 
startup, this shell checks modes and atten.'pts write of a null to std out when shell starts up. 

Ydu can redirect >» to a write-only device. Before this, the shell would open the path in UPDATE mode. 

The quote Dug is fixed. That is, leaving off the second quote ;i(ark in lines like - format /dO r "Disk - will not 
crash the shell. 

The EX bug is fixed .. if you type ex with no paraiTiPtprb (to kill a sheil) it will not attempt tc fork ap^^ ircidule 
or return an error to tb^ parent proceEs, 

Standard error path is nQiij 'un-reriirected' dfter issing a pipe. 

The shell ncii! runs m yhat is cGfurnQnly called no Diock fiiOdB. UndPr previous versions of shell, it you had a sheil 
running on say 12, and another user uias running on lem^ therE iiid^ no convsniBnt \i^^u to send HiBSsages back and 
forth yithcut waiting for keyboard input frGirs the receiving shell, In this version, sheU puts itsalt to sleep 
while ii^aiting for keyboard input. This 'noblock ^lode' can be turned oU u^nng 5 supplied patch fils- 

Pdth= allows you to specify alternate directories tc search for co^Ti^tandSr If the ru>-i'-snt e::scutir::i {i.rectcrj ooss 
not contain the desired module? the alternate paths will be searched m the G^der specitiedr ^or Hxarriple, you zo-'lc 
have your commands directory spread across two or more disks. 

Settable and useful prompts. Shelipius adds user-settable pron^pts: 

P=prGmpt The prompt may be up re 21 chars, extra ignoi'Pd. 

A space, return, or semicolon terminates the prompt. 
Options include: 

^ - show shelTs decimal proc id # (BB-99). 

S - show device name cu'r^rent std out 


More than one # or 3 is ignored. 

Examples: Proirtpt Resulting: 

P=0S9/a: 0S9/Term: 

P=Hi_There' Hi .There' 

P=0S.#.3: 0S.S6.T2: 

P= <use5 default setup in shell heacier) 

It's easy to start up new shells mith custofT) prompts. Just pass it as a paraiTieter, 

To start a shell on say, /W4 with a special prompt, you might type: 

'shell p=039/S? i=/w4& ' ... results in shell on W4 mith prompt m:iS9/W4?' 
'shell p=''[3]'' i=/ili4& ' ... gives prompt of 'Hello.07[W43' 

Shellplus allows global shell scripts to be placed in your e>;ecution (CHDS dir). Siniply build or copy a shell 
procedure file to your cmds dir, then set the execution permission bits on it lattr script e pe). This makes it 
easy to add soffie commands that you can access almost all the time. 

The shell search path becomes: memory, execution dir modules/scripts, data dir scripts. 

Uses include printer setup cmds (using display >/p), window commands, and program startups. 

For example, you could use a shell script called "fsm" m your commands directory to open a VDG screen on W6, and 
start Flight Simulator. After exiting from FS, it could reset W6 back to a standard windoiLi and everything is done 
in the background): 

* FSM - Procedure Command File in CMDS that starts FS-II, 

xmode /lub type=l; display c >/ili6 

chd /dd/ games/ fs 

if 5 <»>/w6; xmode /iLt6 type=8B)&- 

A common complaint, and perhaps the reason why more people don't write packed Basic09 commands, is that Runb 
requires any passed parameters to enclosed in parenthesis and quotes. For example, to execute a packed command, you 
might have to type: cgp2205d ("/term","/?'). A royal pain. This shell recognizes pecked procedures, and will do 
this automatically for you. Using the same example, you can Just type: cgp22Ssd /term /p . 

Similar to OS9/6S000. Great for appending to logs or help files, or merging modules. Or for using the seme 
temporary filenatrfe by overwriting. 

>+filename - also >>+ and >»'!-. Appends output to end of [filename]. 
>-filename - also »- and >»-. Overwrites contents of [filenafrte]. 

CD and CX may be substituted for CHD and CHX. PWD and PXD are now built into the shell as shell commands .PWD and 

Other features include memory scripts, command line logging, shell variables and processing, similar but more 
powerful than MSDOS variables, wildcard expansion, command priority modification, and much, much more. 

If this material whets your appetite, we have the new shell module plus an expanded version of this documemtation 
(about 12 pages), available for distribution from the National User Group files using the normal arrangements as 
far as costs are concerned. 

F'age 8 


RS-232 Interface 












CN 1 








13 = 


















































C2 R3 




















4 ^^ DSR 






DTR 20 
RX 3 
CD 8 


TX 2 RTS 4 
CTS 5 DSR 6 


Rl 47K 

Ul R6551 

CI lOmfd 16V 

R2 3K 

U2 MAX232 

C2 22mfd 16V 

R3 lOK 

U3 1489 

C3 22mfd 16V 

U4 74LS133 

C4 22mfd 16V 

XTl 1.6432 MHz U5 74LS04 

C5 22mfd 16V 

C6 O.lmfd 16V 

Page 9 


RS 232 Interface Board. 
Introducpd by Bob Devries. 

WARNING ' This project is only for e;;perienced hardiuare hackers' 

On the previous page you will find a circuit diagraiT! for an RS 232 interface beard suitable for installing into 

either a Coco 1^2 or 3, or uith a suitable card edge connector, it could be plugged into a MuitiPak interface. 

The circuit uses a 6jj1 ACIA chip as its heart. It requires only +5 volts and ground for a power supply, as the 

necessary positive and negative supplies are generated by the I1AX-232 chip. 

The ACIA chip is addressed at $FF63 and can be used with the ACIAPAK driver frorri 0S9 (/T2 or /T3)- There seems to 

be some problems with some of the public domain terminal programmes which run under RSDOS, but this problem can be 

overcome with a switch to disable the interrupt line from the interface. 

Those of you who would like to build this boardr and would like the added ease of using a circuit board, can 

purchase a PCE from :- 

John Usher 

47 Polaris Avenue, 

Kingston. OLD 4114 

The price is $20,00 plus postage. A component overlay will be included which shows all the connexions and straps 

and component orientations. 

I have successfully used this board both in my Coco 2 (internally) and in my Coco 3 (in the multipak) and have run 

prograffimes like XC0li9, DeskMate under 059, and Ultimaterm and GETerm under RSDOS, If running GETerni with the 

interface installed internal lyi the interrupt line from pin 26 of the 6551 chip must be disconnected. 

Any technical queries can be directed to John Usher or me. Remember, however, that the National 0S9 User Group 

takes no responsibility for the circuit, nor are we in a position to find faults and get things working if you make 

an error. As I said, it worked OK for me, I hope it does for you, too. 

Bob Devries. 

A DataBase in C 
By Bob Devries 

Here is the first installment of my prograirime 'DATABASE'. It was originally written as an assignment for my college 
course on C programming. The programme is a very simple name and address type database, allows no sorting to be 
done, but does allow most other database features such as edit, delete, insert and find. The database is disk 
based, and no records (except the currently displayed one) are kept in memory. If a record is deleted, it is set to 
'null strings' and its position becomes available for future insertions. The first part of the source code is a 
header file 'ansi.h'. While this file could have been included in the main source file, making it separate nade it 
suitable for porting to other machines. By changing this file I was able to compile the programme on Microsoft 
Quick C with only one modification in the irtain file. 

The functions in this section were the ones that were completely different for the MS-DOS machine and thus made a 
separate file necessary. The values for doing the various screen manipulations were obtained from the 0S9 manuals. 
(They're there, take my word for it!) The programme was written for the level II 80 column screen, and I have not 
tried it on any other system. However, with small changes it would probably work OK on level I systems with either 
Opak or a Word-Pak 80 column card. I will examine those possibilities and perhaps mention patches to the code in a 
later article. Now here's the source for..,.. 

/* ansi.h */ 

/* header file with routines for database programme */ 

clsO /* clear screen function */ 



F'age lO 


cursor ( col irom) /* position cursor at col and roui */ 

int col T row; 



revonO /* turn on reverse printing (Level IJ only '!) */ 


revotfO /# turn off reverse printing (Level 11 only M) *.< 


getchO /* special unbuffered keyboard read routine */ 


char ch; 

5etbuf(5tdin,NULL); /* set stdin to unbuffered */ 
set but (stdout, NULL); /* set stdout to unbuffered */ 
ch = getcharO; /* get the character #/ 
return (ch); 

getarrowO /* get arrout keys from keyboard */ 

char ch; 

ch = getchO; 

return (ch); 

eraselinO /* erase the line the cursor is on */ 


Please Note :- This file will net compile by itself) you'll need to wait for at least the ne>it part before you can 
do that. Just type it in and save it in your C source directory for now. Also, not all the functions printed here 
are actually used in the database programfTie, but the header file uias written for use as a general purpose header 


Page 11