3 editor's corner - cosmac elf · but judsins from the advertisements in byte, forth is...

42

Upload: others

Post on 29-Sep-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas
Page 2: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas
Page 3: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

3

Editor's Corner

I would like to thank the many Club Members who wrote letters and articlesin response to my last Editorial Comment. There is quite obviously agenuine desire by our membership at large to keep IPSO FACTO publishing.Thank you - and keep the articles coming!

Club BoardFinally, after a long, frustrating period, we have received all our back­ordered boards from our supplier. The prolonged delivery was causedentirely by his inability to find qualified people to work in his shop,after he was forced to layoff his original crew some months before. ACEsincerely appreciates your patience, and hopes you are aatLsfLed with theproduct.

Club SoftwareAt last, a monitor conforming to Club Standards is available to themembership. Located at COCO - the 2K monitor uses a fixed stack (currentlyat FEFF, but relocatable) and RAM I/O vectors at the bottom of the stackpage. The current version comes with software DART driven at 1200 baud. ANetronics compatible cassette I/O (callable from other programs) isincluded.

The Monitor - SYMON CSC is a re-write of SYMON 3, and includes allpreviously published routines. The modular design allows easy modificationfor your particular needs. The hardware I/O drivers for the ACE CPU Boardsare included in this issue and a parallel keyboard input and VDU driveroutput will be included in the next IPSO FACTO.

SYSDOSA companion to SYMON CSC is also available for purchasers of the ACE DCB.4K long, it resides at DOOO.

Chip VDUThe Chip VDU has been written by Tony Hill to allow users of the ACE VDU(ver. 1 or 2) to run the numerous CHIP 8 games provided for the 1861. Yourfavourite 1861 game is now available on the 6847 (in colour!). A listingwill be published in the next issue of IPSO FACTO (0.7 5K at 1000H). Dustoff your Chip 8 manuals and tune up your VDU!

Ace ConferenceThe second annual microcomputer conference for the 1802 will be held onAugust 20th, 1983 (Saturday) at Sheridan College, Oakville, Ontario. Lookfor details in future issues of IPSO FACTO - plan to attend I

BASIC 6.5Looks like we got screwed, folks. The author is no longer communicati.ngwith us, nor apparently, responding to enquiries. Sorry for anyinconvenience •

Page 4: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

4

Heabers' Corner

FOR SALE:

Neil Dennis, 7940 Cadwell Road, Bliss, N.Y. 14024 (736) 327-7596.

Super ELF Board.with all options.Expander BoadFu11y StuffedQuest Multi-Volt Power SupplyQuest CabinetDxtended Monitor & Tiny Basic in ROMLots of Documentation, including Source Code for MON & BASICS-100 Expander Board - Bare

I WANT:

Full Set of "ACE" Boards sufficient to build system w/S" discs,video and printer, or enough dollars to buy them.

EASTCON CONVENTION SCHEDULE

June 24 - 26, 1983

Glassboro State College, Glasboro, N.J. - The East Coastmajor gaming organizations, (that have sponsored Origins,GenConEast, and PennCon over the past ten years) havecombined efforts to bring you this year's EastCon, featuringseminars, demos, and tournaments by most major manufacturersand game designers. Official tourna~ents include GDW'sTraveller, A.H.'s Squad Leader, and TRS's AD&D. Alsofeatured are miniatures, boardgaming, coaputers, video, androleplaying events. This year, for the first time, sciencefiction events are being held including an art show, SFmovies, and dealers. There is a large, spacious open gamingarea. Food and housing are available on site in addition tohotels and restaurants nearby to host the 3000 + gamersexpected to attend. For a Pre-Reg form and moreinformation, send a SASE to: EastCon, POB 139, Middletown,N.J. 0774S.

Errata: Permutations and Combinations in Tiny Basir, IF 31, p.1S.Line 170 should end with ... Goto 130

Page 5: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

5

Robert Carr4691 Freeman RoadMiddleport, NY 14105U.S.A.

Dear ACE:

I agree with Wes Steiner and his comments in the Dec. '82 issue of IpsoFacto, about the Club Moni tor. A while back, I answered a Club Surveyabout memory usage and adopting a monitor similar to Steve Nies'. Sincethat time, I have been working to adapt my ELF II to meet the standardsproposed, i.e., EPROM at COOO, video at EOOO. To do this, I havepurchased the Club NAB and am awaiting delivery of the new VDU Board. Iam using a version of Nies' Monitor (I/O-parallel IN, serial OUT), formy operating system. The I/O was designed to make full use of Steve'smonitor with my Netronics VID Board (slow, but hard to beat for themoney). I have the monitor at COOO because that is where I have EPROM.

I have gone to a lot of trouble to try and conform to Club Standards(proposed) and I will go even further if the Club would adapt a monitorand standard for memory usage. At this point in time, it would beimpossible to satisfy everybody, but I would be happy to modify mysystem to conform, so that I wouldn't have to disassemble and reassembleevery damn piece of non-Netronics software I want to run. Yes, I wouldvote for the Nies Monitor because I have it up and running, but anymonitor that is easy to customize (one reason I chose it) and has I/Ovectors somewhere in RAM is acceptable as long as it is the only one.

Now for a more pleasant task. Thanks for the 1802 Micro Seminar. Itwas well organized and did offer a 11 t t Le hope for those of us "stuck"with the 1802. I especially enjoyed meeting face to face, the peoplewhose articles I have been reading for so long. Yes, Tony, the VDUBoard is for your window program, and Mike, I hope to see your system"up and running" next time. Darn it, though, I sure would have likedone of those 1805 micro chips.

One of the reasons I have stuck wi th the 1802 is that I have had to getinto the very ''heart and soul" of my ELF to have it do anything, becauseof the lack of commercial support. From this, I (and I'm sure most"Elfers") have developed a good understanding of this micro and microelectronics in general. Maybe this is one advantage we have over usersof other micros.

Editor's Comment:

Thank you for your letter and article. I think ACERS know moreelectronics and microtechnology than a guy who. buys a plasticbox, plugs it in and plays with someone else's hardware andsoftware. Who do you think would be able to get a new job or apromotion (or perhaps just keep his job) when his employerstarts looking at computerizing his place of work?

Page 6: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

6

NEW ADDRESS.! ---)Steve NiesRt 1 130 IroQuois TrailRuckersville, VA 22968Tel: (804) 985-7074

•M~ new address should be stable this time for a few ~eal'S. However,I've heard from a few friends that some letters the~ have sent menever made it to m~ new address. If an~one has sent me a letter andhasn't received a repl~, please tr~ a~ain with m~ new address.However, I would prefer that ~ou please call me at m~ home phone.That wa~ I can answer an~ Questions promptl~. I will tr~ to answeran~ letters that I receive, but usuall~ it takes me Quite some timeto ~et enou~h free ti.e to sit down and write a repl~.

---------------------------------------------------------------------

AN EXTREMELY BIASED OPINION OF FORTH

It seems that FORTH is a ver~ polarizinS lan~uaSe ­pro~rammers either love it tremendousl~ or hate it with the samevi~or. Well, count me as one of those addicted to FORTH! It surebeats proSrammin~ in 1802 machine lan~ua~e!! In fact, I preferFORTH to such heav~wei~hts as BASIC, PLI, and even F'ASCAL. However,I didn't alwa~s have this opinion. When I was first exposed to FORTHin an issue of B~te MaSazine, I thouSht that it was Just anotherwierd little lan~uaSe that someone created as a pet project. Thecr~ptic st~le of FORTH also did much to turn me off!

So, how was I converted from a disbeliever to a true FORTHfanatic? It all boils down to the extreme desire to be able toproSram .~ 1802 s~ste. in a hiSh level lan~ua~e. At one point Iconsidered BASIC (in it's true interpretive form), but promptl~

rejected it after decidin~ that it was too slow and cumbersome tobe able to proSram an~thin~ interestinS. A BASIC compiler wouldeliminate these restrictions, but a co.piler reQuires severalsoftware packaSes (i.e. linker, locater, run-time packaSe, etc.)that m~ s~stem doesn't have at this point.

That's when I discovered I could Set the FIG-FORTH packa~e

in it's entiret~ (interpreter, compiler, and operatins s~stem) insource form for fifteen dollars! Fifteen dollars for ANY softwarepackase for the 1802 is unbelievable! So, after receivin~ the FORTHsource listin~, I modified it so that it would execute out of ROM onm~ s~stem. After pla~in~ with it for awhile, I was amazed at thespeed and compactness of the lansuase. In fact, when a friend ofmine came over to look at m~ 1802 s~stem, I sat down at the ke~b~ard

and desiSn.d so••• raphic routines for the ACE VDU board in sli~htl~

over 20 minutes! Tr~ doins that in machine lan~uase!

So now I a. a true fiSSer (the term coined b~ the FIG-FORTHinterest .roup). Now that I have FORTH UP on m~ s~stem, I'm able todesiSn proSr••s for .w s~st.m in a fraction of the time it would take

Page 7: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

can use the FORTHAlternativelw, woucode one bwte at a

•7

me to do it in machine lansuase. Another important advantase ofdesisninS aw proSraas in FORTH is that the proSrams will run on anwswstem .!sinS anw processor!! Of course, the swstem must have FORTHUP and runninS. But JudsinS from the advertisements in BYTE, FORTHis available for most anw processor, as well as for several of theaaJor microcomputer swsteas (such as the Apple, IBM PC, and TRS-SO).Now I can desiSn proSrams for aw 1802 swstem without the fear thataw efforts will become obsolete if I ever decide to switch over toanother swstem. However, considerins the monew I have invested inthe 1802, that event will probablw never happen. In fact, if the 1802drops off the face of the earth, I'll still be able to run proSramswritten for other swstems on mw 1802 swstem.

I could probablw sins the praises of FORTH well into the nisht.However, in interests of finishinS this article sometime this wear,I am soins to separate mw opinions about FORTH into two cataSories ­advantaSes and disadvantaSes.

ADVANTAGES of FORTH

1) Software support - FORTH has a larse Sroup of people who promoteFORTH applications (FIG-FORTH interest Sroup).

2) Portable - proSrams developed on an 1802 can bw run bw aflW processorrunninS FORTH (theres even a FORTH available for a diSitaleauipment Sroup VAX computer!) More importantlw, proSramswritten for other swstems can run on an 1802 swstem!!

3) Fast - interpreter routine is rouShlw the same size as the standardmethod of callins subroutines (i.e. a D4 opcode followed bw thetwo bwte address).

4) Compact - each invocation of a routine uses onlw two bwtes.In fact, the entire forth swstem (interpreter, compiler,operatinS swstea, and some application software tools) residein as little as 6K of ROM.

5) Whoever still wants to proSram in machine codeassembler to create machine code proSrams.can use the CREATE routine to enter machinetime (which is verw tedious!).

6) Different 1802 swstem confisurations don't matter in forth.Therefore, no more convertinS a proSram to run on wour swstem.

D1SADVANTAGES

1) Crwptic proSramains stwle. However, this problem is due topeople choosinS names like .- instead of more descriptivenames such as PUTSTRING. This problem can be eliminatedif the pro.raamer so wishes.

2) File handins routines are verw slow. This is due to the wawthe file handlins routines are desisned. I.a pl.nninS onreplacin. aw file handler with some UNIX-like routines.The speed should be iaproved iaaenselw.

P.S. On aw latest trip to the local librarw, I've discovered a verwinterestin. article in the Februarw 10th, 1983, issue ofELECTRONICS maSazine. The article is entitled -Forth interpreteron microcomputer eases pro.raamins-. I recoaaend the articlehi.hlw to anwone interested in the future of FORTH.

Page 8: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

Actually, the title of this article should have been "ForthNotes 4". However, having recently moved house, I missed thelast issue completely and only barely made this one. By thetime I had this ready, the editor had already prepared thetitle page, and so had selected my title for me. So be It.

Well, people have started sending in Forth programs. I'll printthe ones I have tested so far in this issue. I read an interestingquote in FORTH DIMENSIONS (the Forth Newsletter) that said that thefirst two serious programs that every Forth programmer writes area disassembler and a full screen editor. So far I have receivedno less than four different disassemblers and expect to be swampedwith full screen editors in the near future.

by - Tony Hill

8MORE FORTH PROGRAMS

30-481 Pitfield Rd. , Milton, Ontario •

I was rather amused to read a comment in the last IPSO that ONLY70 copies of FORTH had been distributed to club members (the truefigure is closer to 100). To put that number in perspective, itmakes FORTH the most popular product distributed by the club. Morethan anyone PC board. Sure we haven't sold one copy to everymember, but I think that one copy to every 3.5 members is a prettyimpressive ratio (current membership is about 350). At any rate, Iwill continue to produce these articles as long as members keepwriting to indicate interest.

A' SIMPLE DISASSEMBLERIn the interest of being fair, I am going to print the first ofthe four disassemblers in the order I received them. If we havespace in the future, I will print any disassembler that offersimproved feature over this one.

A Forth disassembler prints a copy of the original text enteredwhen a definition was compiled. It basically converts the addressesthat make up a Forth word into the Name Field data associated withthat word. This allows you to look at words already compiled, inthe original Forth vocabulary for example, and see what they do.Simple disassemblers like the one below will not handle definitionswritten in machine code, and will not generate a formated versionof the original definition, but they are usefull tools anyways.

Fig Forth Definitions to List Out ather Definitionsby - Eric Tyson 4485 W. Bath Rd. , Akron, Ohio 44314

HEX

(TYNAME) NFA 1+ DUP 2 - @ 3F AND TYPE ;

(IFTYADD) 2 - = IF SPACES DROP DUP 2+ SWAP @ DUP U. ENDIF ;

(LIST) BEGIN CR DUP 2+ SWAP DUP 4 .R SPACE SPACE@ DUP 2+ (TYNAME)DUP , LIT (IFTYADD)DUP BRANCH (IFTYADD)DUP OBRANCH (IFTYADD)DUP • (LOOP) (IFTYADD)

Page 9: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

•DUP I (+LOOP) (IFTYADD)DU P , t ," ) 2 - •

IF DROP DUP C@ SWAP 1+ OVER OVERSWAP SPACE TYPE + 0

ENDIFI ;S 2 - •

END DROP CR ;

: DlIST [COMPILE] I DUP DUP 2 ~ @ •IF CR ;" MACHINE CODEI" DROPELSE (lIST)ENDIF ;

To use this disassembler type:DlIST definition

where definition is the name of the definition you wish tosee.

ANQTHER fi&-EQRTH BUGEd Redman wrote in to say that he had found something funny in the M*word. It didn't handle large numbers correctly some of the time. Oninspection, it became clear that the problem is actually in the U*word, which is called by M* • It seems that the fig 1802 version ofFORTH only handles a 16 by 16 bit mUltiply correctly to a 24 bitresult. So if the result is greater than 16777215, the answer maybe incorrect. Interestingly enough, they even comment their ~chine

code listing to indicate that they only maintain a 24 bit product.What I find strange is that it would only have required three moreinstructions to get a full 32 bit accuracy. The problem is thatthey do not propagate the carry bit across the full 32 bit productin their shift and add algorithm. It is possible to patch In a fix,but the end result is messy, as it adds two long branch instructionsto a loop that runs through 16 times, therby slowing down all FORTHmultiply operation and the words that depend on them. Write me Ifyou still want details.

A MEMORY DUMP PRQGRAMThe following program is a word to allow FORTH users to examine blocksof memory. This type of program illustrates how easy it is to replaceyour system monitor program with FORTH, and run a FORTH only system.I should point out that I factored the original (broke it up into morecompact and logical words) in the interest of readability and to allowmore simple modification to suit different terminal widths. In generalIt Is considered good Forth programming practice not to make definitionstoo long and complicated. I hope the original author will forgive myediting his code.

Memory Dump Functionby - Denis lambert 1457 Morlneau , Fleurlmont, Quebec JIE 3R6

HEX

MEMORY CUP 8 + SWAPDO I C@ 3 .R lOOP;

ASCII DUP 10 + SWAPDO I C@ CUP

20 < OVER 7E > ORIF DROP 2E ENCIF

Page 10: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

10

.,

DUMP

EMITLOOP;

BASE @ )R HEXOVER + SWAPDO CR I 0 6 D.R 2 SPACES

I MEMORY SPACE1 8 + MEMORY 3 SPACESI ASCI I?TERMINAL IF LEAVE ENDIF

10 +LOOPCR R) BASE

Use as follows:

addr count DUMP

For example HEX COOO 100 DUMP would print out the first.256 bytes starting at address CODO. This version of the DW~P

word also prints out the ASCII character corresponding to anymemory location that Is a valid ASCII character, or a periodIf the data Is not valid ASCII.

A EIX FOR < AND>As mentioned In a previous Issue of IPSO, the FORTH words> and (do not work correctly for large numbers. What follows here is amachine code fix for that problem. I have used that fix In my ownversion of 1802 FORTH and so can vouch for the fact that It works.Peop 1e us Ing f Ig- FORTH wi 11 have to patch I tin. You will need38 bytes of free memory that does not cross a page boundary.

To find where the patch will go use HEX~ERE. If the resultis less than 38 bytes from a page boundary type HERE FF AND100 SWAP - ALLOT to move the dictionary pointer to the start ofa new page. Modify the underlined branch addresses (shown relativeto 0000) and use or C' to insert the patch Into your d l c t-l onary.

0000 E9 09 29 29 FE 119 38 JJl.0008 FE 33 11 F8 00 73 59 DC0010 FE 33 .1f. 49 19 F7 29 090018 29 29 75 FE 19 3B II F80020 01 73 F8 00 59 DC

To tell FORTH where the new patch Is, you must ~dlfy the CodeField Address (CFA) of the < word. Type -FIND < CFA • to findthe CFA. Using the start address you found, patch In tbe newdefinition as follows- address -FIND < CFA I • Updateyour FORTH pointers to Include the patch and save the new version.To update type ~ERE FENCE I HERE DECIMAL 28 +ORIGIN I HERE 30 +ORIGINt LATEST 12 +ORIGIN !

NEXT ISSUENext issue will have more programs submitted, tips on using FORTH with •cassette system and an article on a different threaded code application.

Page 11: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

11

40 X 24 VIDEO Display

-by Dick Thornton 1403 Mormac Road, Richmond, Va. 23229 (USA)

line 1 col 1­1 column.column 1 of

(CNTL/Q)

(CNTL/Y)

(CNTL/P)

(CNTL/L)

(CNTL/J)(CNTL/K)(CNTL/M)

(CNTL/: )

HEX 11

HEX 10

HEX 19

HEX OC

HEX 1A

HEX OAHEX OBHEX 00

The video display described here produces a 24 line displaywith 40 characters per line, which is easily displayed on anunmodified home television set. The circuit contains an 1802 CPUwhich controls the display, and simplifies its use by the hostcomputer. The display portion of the circuit uses the RCA 1869 and1870 Video Interface System (VIS) chip set. While the 1869/1870can be controlled directly from the host computer, they requireuse of the OUT3, OUT4, OUTS, and OUT6 instructions. In addition,the video control routines would have to be in the host computer.Finally, the idea of CPU-to-CPU communication appealed to me.

Interface to the host computer is parallel, using a standard1852 8-bit port and N-line decoder. The service request output fromthe 1852 is connected to EF lines on both CPU's. ~fuen this lineis high, the host computer is free to send a byte to the display.

The video display is completely independent of the host com­puter, and doe~ not use DMA, Interrupt, or any of the host memory.

The video display CPU places all data read into the page mem­ory for display if the hex value is hex 20 or greater. The charac­ters are placed in the location occupied by the cursor, and thecursor is then advanced one position. If the resulting cursor pos­ition is past line 24 column 40, a one-line scroll-up is performed,and the cursor is set to line 24 column 1.

Eighteen control characters between hex 00 and 1F providecursor, screen, and line control:

HEX 00 (CNTL/Sp) HOME CURSOR - curspr is set toHEX 08 (CNTL/H) BACKSPACE - cursor is set backHEX 09 (CNTL/I) LEFT MARGIN - cursor is set to

the current line.CURSOR DOWN - cursor is set down one line.CURSOR UP - cursor is movec up one line.CARRIAGE RETURN - the cursor is moved tocolumn 1 of the next line below. If thecursor is on line 24, a one-line scroll-upis performed, and the cursor is set toline 24 column 1.FORWARD SPACE - cursor is advanced by 1column.ERASE TO END OF LINE - the line containingthe cursor is erased from the cursor tocolumn 40.CLEAR SCREEN - the screen is erased to allblanks. Cursor is set to line 1 column 1.ERASE TO END OF SCREEN - screen is erasedto blanks from the cursor to line 24 col 40.INSERT BYTE IN LINE - a blank is insertedat the position of the cursor after shift-ing the characters beginning at the cursor•

Page 12: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

12

40 X 24 VIDEO Display

to the end of the line right one position.The last byte on the line is lost.

HEX OF (CNTL/O) INSERT NEW LINE - a new line is insertedby rolling all lines from the line contain­ing the cursor to line 23 down one line.The former line 24 is lost. The new lineis set to blanks.

HEX 12 (CNTL/R) DELETE BYTE IN LINE - the character at theposition of the cursor is deleted by shift­ing from the cursor to column 40 left oneposition. Column 40 is set to blank.

HEX OE (CNTL!N) DELETE LINE - the line containing the cur­sor is deleted by rolling all lines belowup one line. Line 24 is set to blanks.

HEX 13 (CNTL/S) SCROLL UP - the entire screen is scrolledup 1 line. Line 24 is set to blanks.

HEX 14 (CNTL/T) SCROI.L DOWN - the entire screen is scrolleddown 1_ line. Line 1 is set to blanks.

HEX 16 (.CNTL/V) ROLL LINE TO TOP - the screen is scrollerup until the line containing the cursoris at line 1. All lines below the formerline 24 are set to blanks.

HEX 18 (CNTL/X) REVEPSE VIDEO - the character roemory is re­loaded with reverse video characters. Ifissued again, normal video is restored.

A blinking cursor is used, which alternates between normaland inverse video, showing the character occupying the space con­taining the cursor.

Ordinary ASCII characters (hex 20 - 7F) are displayed in"normal" video, which.is that last selected by a reverse videocontrol character (hex 18). The entire character set is also avail­able in reverse video form using the hex values AO through 7F. Eachof these reverse characters is composed of the normal ASCII char­acter with the high order bit turned on. Thus, an upper case Awould be hex 41 normally, but a reverse video upper case A can bedisplayed by sending a-Cl. Hex characters from 80 through 9F area set of graphics symbols which are always displayed in "normal"video.

The video circuit requires +5 Volt power only. I measured thecurrent as 130 rnA during idle screen refresh, but am not certainof the accuracy of this measurement.

CIRCUIT DESCRIPTION:The program used by the video display CPU (VI) resides in a

2716 EPROM (U9), and uses nearly the full 2K-bytes. When the dis­play is first turned on, the CPU initializes the character memory.(U13) with the dot patterns for the normal (White on black) char­acter set, clears the page memory (VII) to blanks, and inserts ablinking cursor at line 1 column 1. 'rhe CPU then awaits a data

Page 13: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

13

40 x 24 VIDEO Display

ready strobe at its EF2 line. This will be present when the hostcomputer has written a byte to the video display circuit.

The host computer data bus is connected to the 1852 8-bitI/O port (U2), while host computer TPA, TPB, MRD, and N-lines areconnected to the N-line decoder US. The service request output fromU2 is connected to EFI on the host CPU so that it can determinewhen the next byte can be sent to the video display. As you cansee, then, U2 and US comprise an 8-bit output port for the hostcomputer. In use, the host computer would first test for a high(false) at its EFl line to insure that the port is availahle.Next, the host will write the byte to the video display by use ofan OUTI instruction. This causes the data byte to appear on thedata bus lines of the host computer, and at the data input pinsof U2. At the same time, the N-lines, TPA, TPB, and l1RD cause USto produce a high at its OUTI pin, which clocks U2. u2 respondsto the clock pulse by latching the input data byte, and making its~ (service request) output pi~ low. The host computer program willrecognize that the video display is busy as long as SR is low, sincethis is connected to the EFI line of the host CPU. I chose EFl andOUTl, since these were previously used by my 1861 video display.If another OUT instruction is preferable, it can he used by usingthe appropriate output pin from US, rather than the OUTI pin. Like­wise, if another host computer EF-line is preferred, the SR outputfrom U2 can be connected to the desired host computer E'F-line.These changes will only affect the host computer program, and willbe completely transparent to the video display circuitry.

The video display CPU, Ul, waits for an input byte by testingits EF2 line. When this line goes low (true), the CPU executes anINPI instruction, causing U3 and u4 to make the CS2 input to U2high. The high on CS2causes U2 to release the latched data byteto its output pins, which are connected to the data bus of Ul, andat the same time, the ~ output of U2 is changed to a high, whichpermits the host computer to write to the video display again. Asyou can see, U2 acts as an 8-bit input port to Ul, with some helpfrom U3 and U4.

Use of the 1853 for US pretty much forces the host computerto be an 1802. If another. CPU is used, the 1853 can be replacedby any circuit that will bring the CLK input to U2 high when a databyte is available on the data hus. The 8-bit i/o port can also bechanged if ,desired, perhaps using an 8212 or other port chip. Ifthis is done, be sure that the port will respond properly to theavailable read and write signals, and will' produce the correct ser­vice request output. If these differ, hardware and/or softwarechanges will be required in the video display circuit and program.

After reading a byte from the host computer, Ul processes it.in accordance with the program in U9 (explained later), and thenwaits again for data from the host computer •

Page 14: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

14

40 X 24 VIDEO Display

The EPROM containing the program for U1 resides in U9, whichis interfaced by U6, U7, and U8. U6 and U7 are used to latch thehigh-order address byte from Ul, while U8 decodes the memory add­resses so that U9 is selected only for addresses 0000-07FF. Ihad originally designed in a 1K-byte ~~, thinking I'd need it foruse by the program. After a bit of rewriting, I found that therewas enough scratchpad available in the registers, so later removedthe RAM. I did not change the memory interface circuit, however,and this area can probably be simplified. If nothing else, 4042latches, and an 1853 can be used in place of the 74LS75's and74LS138 with appropriate pinout changes.

The Video Interface circuit uses the RCA 1869 and 1870 chips,which are called the Video Interface System (VIS). These two 40­pin IC's perform all screen refresh and video signal functionsusing a dedicated page memory R~1 (Ul1) to contain the charactersto be displayed, and a dedicated character memory (U13) to containdot patterns for characters. Thus, the using computer and the VIScan operate independently. This permits the using CPU (Ul here)to run at full, speed, and timing routines can be used freely,since the VIS does not interrupt the CPU.

During normal screen refresh, only U10, U11, U13, and tJ14 areactive. The 1869 and 1870 communicate with each other using theirDISPLAY, HSYNC, CMSEL, and ADDSTB lines. Characters are formed ina 6X8 dot array, so each line is accessed 8 times, once for eachrow of dots, before advancing to the next character line in pagememory. U10 generates the addresses of characters in page memory,and sends them to the address inputs of U11, the page memory RAM.The data output from the page memory is the ASCII character to bedisplayed. This character is used as the high-order 8 bits of theaddress input to character memory U13, where the dot patterns arestored. The low-order 3 bits of the address are produced by U10(CMAO-2). U13 produces an output that is the dot pattern for thecharacter and row desired, and this information is sent to U14 asCCBO, CCB1, and CDBO-CDB5. CCBO and CCBl are used as intensity in­dicators, rather than dots. When the dot and intensity informationhas been received, U14· serializes the dot information at its IJm·!output for presentation to the video display. U14 also producescomposite sync signals at its COMP SYNC output to control the tel­evision set, and these are combined in an external resistivecoupling circuit composed of R3, R4, and R5. The resulting VideoOut signal'can be sent to a video modulator and thence to the an­tenna terminals of the TV set, or directly into the viceo amplifierof the television set is modified properly.

As you can see, Ull and U13 must be high speed devices, sincethere is only about 1 microsecond available to get each characterto U14. During this time, the 1869 and 1870 must communicate, apage memory address must be sent to Ull, U11 must respond with theASCII character, U13 must accept the character as an address andproduce the dot pattern at its output pins for use by U14. In or-

Page 15: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

•15

40 X 24 VIDEO Display

der to accomplish all this in one microsecond, the Ull and U13memories must respond in about 250 nanoseconds. RCA has writtenan application note (see PEFERENCES) which permits use of slowermemories by use of a staggered access, however. If this techniqueis used, or if a very fast 2716 can be obtained, the dot patternscould be permanently stored in the EPROM, which would save memoryin the CPU program EPROM (U9), and simplify the initialization.

U12 is used to permit the CPU to access page memory duringnon-display periods. When an address from F800-FRFF is receivecby UIO during a non-display interval, it subtracts F800 from theaddress and sends the difference to the address inputs of nIl,transfers the ~~R input to the R/W input to Ull to permit reac orwri te, and brings PlISEL high to connect the CPU data bus to theUll outputs to enable the CPU to read or write data to the pagememory. Character memory (U13) can also be accessed by the CPU,but this is a more complicated procedure I oon't pretend to under­stand in any detail. Frankly, without the example program suppliedin ICAN-6953 (see REFERENCES),' I doubt that I' a have been able tofigure out how to load U14.

U14 requires a dot clock, which is composed of 5.67 MHz cry­stal Xl, resistor R2, and capacitors C2 and C3. This is a multipleof the television horizontal line frequency, and must be nearlyexact for a stable display on a television screen. I obtainedspecifications for this crystal from F. M. Vaccarella at RCA. Theyare: AT cut; .001% at 25°C, ±.005% -30°C to 60°C; l5pF load;parallel resonant; frequency 5.67 MHz; case style HC18. This cry­stal can be ordered from ROLIN Distributors, P.O. Box 436, Dunellen,New Jersey 08812. I believe the cost was $6-$8.

The 1870 produces a CPU clock output at half the dot clockfrequency (2.835 lIHz) which can be used for the CPu, if desired.Since the VIS operates independently of the CPU, however, thereis no requirement to operate the CPU at this clock frequency.

The VIS can be used directly by an 1802 CPU using only thelogic shown on the VIDEO INTERFACE schematic (UlO, Ull, U12, U13,U14, and U3). If this is done, the driving CPU is connected to the1869 using its MAO-MA7, NO-N2, MRD, MWR, TPA, and TPB. The PREt'IS­PLAY output of the 1870 must be connected to an EF line of the CPU.The major disadvantage of this method lies in the method used tocontrol the 1869/1870, which use the OtJT3, OUT4, OUTS, and OUT6CPU instructions. This interfered with my computer, and I did notwish to modify my computer to satisfy the needs of the video dis­play. Also, if this method is used, the video control program mustreside in the host computer's memory. This last may not prove tobe a major disadvantage, since your programs will probably haveto include much of the code in order to mimic the display in thehost computer.

Construction is non-critical, though the dot clock oscillatorshould be located near the oscillator pins of the 1870. I built thecircuit on a 6"X9" perfboard using Vector wire pencil and solder-

Page 16: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

16

40 X 24 VIDEO Display

thru wire. IC's are widely spaced on the board, and a smaller onecould have been used. For video output, I use a six-foot lengthof RG-S8/U coax cable with BNC connectors, and tie directly to thevideo amplifier of a small transistorized black-and-white tele­vision set. While I haven't tried it, a video modulator should beusable for input to the antenna terminals of the TV set. You maywant to experiment with the video and sync levels for the bestvideo display. If so, try using SK pots in place of resistors R3,R4, and RS. These may later be measured and replaced by fixedresitors, or left in place.

During testing, I found that the dot clock oscillator wouldsometimes oscillate at double frequency without capacitors C3 andC4. CPU reset also caused a problem, since the reset signal wentaway before the clock was available from the 1870. I don't reallysee why this was a problem, but increasing the reset ~e1ay solvedthe problem. The symptom was an inactive CPU, and I first suspectedthe dot clock. For some reason the CPU requires a good clock sig­nal when it w~kes up until its 9-cyc1e initialization is complete.At any rate, it works without problem with the longer reset delay.The only other problem with hardware was caused by overloading theMRD signal in the host computer. I solved this temporarily by useof a pull-up resistor on the MRD line, but will probably have toincrease its drive before adding any more circuitry. This causedthe display to produce incorrect characters. When I touched theMRD line with a finger it invariably caused incorrect characters,while removing a circuit board and leaving MRD alone produced agood display.

VIDEO CONTROL PROGRAM:The program in EPROM U9 is used by U1 to control the display

and communicate with the host computer. The program begins ataddress 0000 and extends to location 07F3. No RAM memory is used,since sufficient scratchpad memory is available in the CPU regis­ters. The 1869 and 1870 require that the page memory he ad~ressed

at locations F800-FBFF, and the character memory at locations F400­F7FF. In addition, the page and character memories can only beaccessed during non-display times. Further, the character memorymay only be accessed when the character memory access mode has beenestablished via an OUT3 instruction.

Register usage by the program is: PO=main program PC; R1=FFFF(used as X for INP1); R2=PC for main routines called by the mainprogram; R3=cursor address; R4=PC for multiple-use subroutines;RS=cursor blink delay counter; R6.1=cursor set/unset indicator;R6.0=data byte at cursor location; R7.1=cursor blink indicator;R8=unused; R9=genera1 work; RA=unused; RB-RF=general work.

A general explanation of the program routines is given helow.The program itself is printed in hex following the description ofthe routines.

Page 17: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

Ie

17

40 X 24 VIDEO Display

INITI~LIZATION (0000-002C) PC=ROTurns the VIS on for 40X24 display, no sound; loads charactermemory with normal video character set; clears page memoryto blanks; inserts blinking cursor at row 1 column 1.Routines called: Character Memory Load, Clear Screen, Set

cursor.MAIN PROGRAM (0020-0093) PC=RO Changes R2, R4, R5, and RD.

Blinks cursor while waiting for data entry from the hostcomputer using a BN2 instruction; read data from input portusing an INP1 instruction; clear the cursor. If character isgreater than 1F, put it into page memory at the position ofthe cursor, and advance the cursor one position with scro11­up if at end of screen. If the character is 1F or less,search the Control Table to find the address of the process­ing routine, and perform it using R2 as the PC, also passingthe address of the Row Table Search routine in R4, and thecontrol character read in RD.1; finally, turn the cursor backon in its new location and await input again.Calls routines: Clear Cursor, Cursor Advance, Turn Cursor On,

Control Character Routines.LINE INSERT ROUTINE (0094-00CF) PC=R2 Changes: R3, RD, and RE.

Moves screen data down 1 line beginning with the first byteof the line containing the cursor; clear the line containingthe cursor to spaces; set cursor to column 1 of original line.

LINE DELETE ROUTINE (OODO-OOFE) PC=R2 Changes: R3, RD, and RE.Shift all screen data up one line, beginning with the firstbyte of the line below that containing the cursor; clear line24 to blanks; set cursor to column 1 of the original line.calls routines: Search Row Table.

ERASE TO END OF PAGE ROUTINE (00FF-0111) PC=R2 Changes P~.

Sets all screen data bytes in page memory to blank from thelocation containing the cursor to line 24 column 40; cursorposition is unchanged.

HOME CURSOR ROUTINE (0112-0118) PC=R2 Changes: R3.Sets cursor to line 1 column 1.

BACKTAB ROUTINE (0119-0121) PC=R2 No registers changed.Sets cursor to column 1 of the line containing the cursor.Calls routines: Search Row Table.

EP~E TO END OF LINE ROUTINE (0122-0137) PC=R2 Changes: Re and RF.Moves blanks to data bytes from the current location of thecursor to column 40 of the same line. Cursor position is notchanged.Calls routines: Search Row Table.

INSERT BYTE IN LINE ROUTINE (0138-0153) PC=R2 Changes RD, RE.Moves all bytes from the current cursor position to column40 of the same line right one position; current cursor pos­ition is set to blank. Cursor position is unchanged •Calls routines: Search Row Table.

DELETE BYTE IN LINE ROUTINE (0154-0171) PC=R2 Changes: RE.

Page 18: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

PC=R2 Changes: R3.the right. If the result­40, the cursor is set to

18

40 X 24 VIDEO Display

Shifts all bytes in the line containing the cursor left oneposition beginning at the cursor: column 40 of the line isset to blank: cursor position is unchanged.Calls routines: Search Row Table.

SCROLL UP ONE LINE ROUTINE (0172-0181) PC=R2 Changes: RD.Entire screen is moved up one line. The top line is lost. Line24 is set to blanks. Cursor position is unchanged.calls routines: Scroll Up.

CARRIAGE RETURN ROUTINE (0182-0197) PC=R2 Changes: R3, R4, RF.Cursor is moved to column 1 of the line below. If the cursoris already on line 24, a scroll-up is performed, ans the cur­sor is set to line 24 column 1.Calls routines: Search RoW Table, Scroll Up

SET CURSOR ROUTINE (0198-0lAS) PC=R2 Changes: RS, R6.Turns the cursor on at the current cursor address (in R3) •

CLEAR CURSOR ROUTINE (01A9-0lB6) PC=R2 Changes: RS, R6.Turns cursor off: repLaces original data hyte in page memorybyte which contained the cursor.

INCP~~ENT CURSOR COLUMN ROUTINE (OlB7-0lC7) PC=R2 Changes: R3, R4.Moves cursor to the next position to the right. If cursor isthen past line 24 column 40, a scroll-up is performed, and thecursor is set to line 24 column 1.Calls routines: Scroll Up.

FORWARD SPACE CURSOR ROUTINE (01C8-0lD7)Advances the cursor one position toing position is past line 24 columnrow 1 column 1.

INCPE~NT CURSOR ROW ROUTINE (01D8-0lFO) PC=R2 Changes: R3.Hoves cursor down one line, cursor column is unchanged. If theresulting position is past line 24, the cursor is set to line 1at the same column.

DECREMENT CURSOR COLUMN ROUTINE (OlFl-020l) PC=R2 Changes: R3.Moves cursor position to the left one position. If the result­ing cursor locati9n is prior to line 1 column 1, the cursoris set to line 24 column 40.

DECREf~NT CURSOR ROW ROUTINE (0202-02lA) PC=R2 Changes: R3.Moves cursor up one line. If the resulting cursor position isprior to line 1, the cursor is set to line 24. Cursor columnis unchanged.

SCROLL UP SUBROUTINE (02lB-0248) PC=R4 Changes: R3, RE, RF.The entire screen is moved up one line with the original topline being lost. Line 24 is set to blanks and the cursor isset to line 24 column 1.

SCROLL DOWN ONE LINE ROUTINE (0249-026D) PC=R2 Changes: PE, RF.Entire screen is moved down one line. Bottom line is lost.Top line is set to blanks. Cursor position is unchanged.

CLEAR SCREEN ROUTINE (026E-028S) PC=R2 Changed: R3, RF.Entire screen is cleared to blanks. Cursor is set to line 1column 1.

Page 19: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

•19

40 X 24 VIDEO Display

SEARCH ROW TABLE SUBROUTINE (0286-0297) PC=R4 Changes: RF.The row address table is searched to locate the entry for theline below that containing the cursor. Address of the entryfound is returned in RF to the caller.

ROLL ROW TO TOP ROUTINE (0298-02D5) PC=R2 Changes: R3, RE, RF.Screen lines are moved up so that the line containing the cur­sor is the top line. All lines above that containing the cur­sor are lost. New lines below the forrrer line 24 are set toblank. Cursor is set to line 1 column 1.Calls routines: Search Row Table.

INITIALIZE CHARACTER MEMORY ROUTINE {02D6-0382) PC=R2Changes: R7, R9, RB, RC, RD, RE, RF.

Loads the character memory with the dot patterns in the Dotstable. The Normal/Inverse indicator in R7.0 is used to deter­mine whether the normal or inverse set is loaded first. Theindicator in R7.0 is reversed at each call to this routine.To create the inverse (white on black) character set, thesame dots table is used, but each dot string is inverted be­fore storing in character memory.

ROW ADDRESS TABLE (0383-03B4)This table contains the addresses of column 1 of each screenline, and is used by the Search Row Table subroutine to locatecoluron 1 of the line containing the cursor. The entries eachcontain a 2-byte line address stored with the low-order bytefirst.

CONTROL TABLE (03B5-03ED)This table is used by the main routi~e to find the addressof a routine to process a control character. Each entry is3 bytes long, the first byte being the control character, andthe next two containing the address of the processing routine.

DOTS TABLE (03EE-07F3)This is the table of dot patterns used to load the charactermemory. Each character is displayed as a 6X8 dot matrix, andrequires 8 bytes in the table, one for each row of dots. Eachbyte in the table.describes the dot pattern for one row ofa character, with the high order 2 bits providing intensityinformation, and the low order 6 bits the dot information.If the two high order bits are both 1, intensity is maximum.

MISCELLANEOUS NOTES AND CO~~ENTS:

• Only lK of the page memory Ull is used by this implementation.I chose the 6116 due to cost, availability, board space, andwiring simplicity. A pair of 2114's could be used here, or 82102's if you're into heavy wiring.

• The 1869/1870 VIS supports a hardware scroll feature with a 2Kpage memory. Some software changes would be required to imple­plement this, however.

• The 1869/1870 VIS also supports audio output and color video.If either of these features is to be used, some software changes

Page 20: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

20

40 X 24 VIDEO Display

will be required. The color video will require the addition ofa 7.15909 MHz chrominance clock for the 1870, as well •

• I can supply programmed 2716's with the video display programif anyone is interested~ If you decide to do this, send a 2716with return postage and a note so I know what you want. I'd be

glad to hear from anyone who deciC'es to build the VIS, and willanswer questions to the best of my ability, though I'm no expert.

• I obtained my CDP1869CE and CDP1870CE about a year ago fromHamilton Avnet in Baltimore, Md. You can call to check prices,availability, and any shipping delay for no charge using thetoll-free number 800-638-1772. They will accept C.O.D. orders,and written orders which include a $2 handling fee. ~~en I gotmy VIS chips, the cost was about $32 for the two chips. Hamilton

Avnet also has other RCA IC's. Ask by part number, as the salespeople are not technical. If anyone knows a better source of RCAIC's, I'm sure ACE members would like to know about it.

P.EFERENCES:I found the following RCA pUblications to be of value in this

project. They can be obtained free for the asking by writing toRCA Solid State, Box 3200 Somerville, N. J. 08876.

1) RCA file #1197: CDP1869, CDP1870 Preliminary Data

2) ICAN-6953 An Introduction to the Video Interface System (VIS)Devices - CDP1869 and CDP1870

3) ICAN-6889 Using Slower l-1emories with the VIS Display System

4) ICAN-7032 CDP1800-Based Video Terminal Using the RCA VideoInterface System, VIS

Page 21: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

•21

RCA lS69/1S70 VIS CONTROL PROGRAM

ADOR .0.1 .2.3 .4.5 .6.7 .8.9 .A.B .C.D .E.F0000 63S0 FSSO BFFS SSAF EF65 FSOO B7F8 FFA70010 B1A1 FS02 B2F8 D6A2 0234 19F8 005E B6FB0020 02B2 F86E A2D2 F801 B2FB 98A2 D297 3A4D0030 354D 9532 3S25 3030 9632 44FS 01B2 FBA90040 A2D2 3030 FS01 B2FS 9BA2 D230 303D 40FS0050 01B2 FSA9 A2D2 E169 FF20 3B6F 345C 53FS0060 01B2 FSB7 A2D2 FB01 B2FB 9BA2 D230 2DFC0070 20BD FS03 B4FS B5A4 E490 F714 32S7 FOFFOOSO FF32 6614 1430 7944 B204 A2FB 02B4 FB860090 A4D2 3066 S3FF 9893 7FFB 3B9D 00D4 2F4FOOAO A34F B3FB FBBE FB97 AEFB FBBD FBBF AOBDOOBO F79D 1F77 2F3B BF34 B70E 502E 2D30 AF2FOOCO 2FF8 0034 C35D 2DBD F79D 1F77 2F33 C1DO0000 D42F 2FOF B32F 4FA3 lFS3 AOFC 2BAE 93BDOORO 7COO BE34 E34E 5010 BDFF 9B9D 7FFB 3BE3OOFO FSOO 34F2 5D1D SDFF C09D 7FFB 3BFO D0830100 AF93 BFFS 0034 055F 1FSF FFCO 9F7F FB3B0110 03DO FSFB B3FB 00A3 DOD4 2F2F OF83 2FOF0120 A3DO D4S3 AE93 BE2F SEF7 1F9E 7733 37FS0130 0034 315E 1E30 27DO D4B3 AE93 BEF8 OOBD0140 3440 OEAO 9D34 455E 1ESD BD2F SEF7 1F9E0150 773B 40DO 04S3 AE93 BE1E 2FSE F71F 9E770160 336B 3462 OE2E 5E1E 1E30 5A2E FSOO 346B0170 5EOO S3AD 93BD FS02 B4FB 1BA4 D4SD ~39D

0180 B3DO D40F B32F OFA3 B3FF C093 7FFB 3B970190 FS02 B4FS 1BA4 D4DO 963A A534 9B03 A6FBolAO S053 FS01 B6FS 1BB5 D096 32B3 S634 AD5301BO F800 B6FB 1BB5 D013 S3FF C093 7FFB 3BC701CO FS02 B4F8 1BA4 D4DO 13B3 FFCO 937F FB3B01DO D7FS FSB3 FSOO A3DO B3FC 2BA3 937C 00B3OlEO B3FF C093 7FFB 3BFO B3FF COA3 937F 03B301FO D023 S3FF 0093 7FFS C302 01FS FBB3 F8BF0200 A3DO 83FF 2SA3 937F 00B3 S3FF 0093 7FF80210 331A 83FC COA3 937C 03B3 DOFS FSBF FBOO0220 AFF8 F8BE FS2B AE34 274E 5F1F SEFF C09E0230 7FFB 3B27 FSOO 3436 5F1F 8FFF C09F 7FFB0240 3B34 F8FB B3F8 9SA3 D2FS FBBE FS97 AEF80250 FBBF FSBF AFEF 3456 OE73 2ESF FF2S'9F7F0260 F833 56FB 0034 6573 9FFB F832 63DO F8FB0270 BFFB COAF EFF8 0034 7773 9FFB F73A 75F802S0 FSB3 FSOO A3DO FS03 BFF8 S5AF EF83 F7lF0290 9377 3B97 1F30 SDD2 B3FF 2893 7FF8 3BCF02AO D42F 2FOF BE2F OFAE FSFS BFFB OOAF SEFF02BO C09E 7FFB 33BF 34B6 4E34 B95F 1F30 AESF02CO FFCO 9F7F FB33 CFFB 0034 C95F 1F30 BFF802DO F8B3 F800 A3DO S7FB FFA7 F8F8 BEF8 OOAE02EO 34EO OEA9 F8BO BEF8 89AE EE65 FSFS BEF802FO OOAE FSF4 BDFS OOAD FS03 BFFS EEAF FSOO0300 ACFB OOAB 672E 662E S73A 4A30 1CFS F4BD

Page 22: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

22

RCA 1869/1870 VIS CONTROL PROGRAM

AOOR .0.1 .2.3 .4.5 .6.7 .8.9 .A.B .C.O .E.F0310 F800 AOF8 03BF F8EE AFF8 80AB 8B34 lOSE0320 3420 4F5D 1C10 8CFB 083A 20F8 OOAC 1B8B0330 FB80 323B 8BFB E13A 1C30 71FS F4BO F8000340 AOF8 03BF F8EE AFF8 80AB 8B34 4B5E 4FFB0350 FFFA 3F32 57F9 C034 5750 1C10 8CFB 083A0360 4EF8 OOAC 1B8B FBE1 3271 8BFB 8032 OD300370 4AF8 80BE FS88 AE65 F8F8 BEF8 OOAE 89340380 7F5E 0000 F828 F850 F878 F8AO F8C8 F8FO0390 F818 F940 F968 F990 F9B8 F9EO F908 FA3003AO FA58 FA80 FAA8 FADO FAF8 FA20 FB48 FB7003BO FB98 FBCO FBOO 0112 0801 F109 0119 OA0103CO D80R 0202 OC02 6EOO 0182 1001 2211 013803DO 1201 5413 0172 1402 491A 01C8 OFOO 940E03EO 0000 1900 FF16 0298 1802 06FF FFFF 000003FO 0000 0000 0000 C4C4 C4C4 00C4 0000 CACA0400 0000 0000 0000 OOCA OFCA OFCA 0000 CE050410 04CE C505 CEOO 01C2 C4C4· C801 0000 CE010420 CC04 02CF 0000 C4C4 0000 0000 0000 C2C40430 C8C8 C4C2 0000 C8C4 C2C2 C4C8 0000 D1CA0440 OFCA 0100 0000 00C4 C40F C4C4 0000 00000450 0000 00C4 C800 0000 OOOE 0000 0000 00000460 0000 00C8 0000 OOC1 C2C4 C800 0000 CE010470 0505 01CE 0000 C4CC C4C4 C4CE 0000 CEDI0480 C2C4 C8DF 0000 CE01 C6C1 DICE 0000 02020490 OFC2 C2C2 0000 OFOO OEC1 C10E 0000 C2C404AO C806 01CE 0000 OFC1 C2C4 C8DO 0000 CE0104BO CE01 01CE 0000 CE01 COC2 C4C8 0000 600004CO C400 C400 0000 0000 0000 C400 C4C8 C2C40400 C800 C8C4 C200 0000 oFOO DFOO 0000 C8C404EO C2C1 C2C4 C800 CE01 C2C4 00C4 0000 CEDI04FO 050A 04D1 CEOO CEDI 01DF 0101 0000 OED10500 0601 01DE 0000 CE01 DOOO DICE 0000 DEr10510 0101 010E 0000 OFOO OEOO OOOF 0000 DFOO0520 OEDO DODO 0000 CE01 0007 01CE 0000 D1010530 010F 0101 0000 CEC4 C4C4 C4CE 0000 C7C20540 C2C2 02CC 0000 0102 oC04 0201 0000 00000550 0000 OOOF 0000 010B 0501 0101 0000 01090560 0503 0101 0000 CE01 0101 01CE 0000 OED10570 010E. 0000 0000 CE01 0101 05CE C100 DE010580 010E 0201 0000 CE01 C8C6 01CE 0000 OFC40590 C4C4 C4C4 0000 0101 0101 01CE 0000 0101oSAO 01CA CAC4 0000 0101 0105 OB01 0000 01CA05BO C4C4 CA01 0000 0101 CAC4 C4C4 0000 DFC205CO C4C4 C80F 0000 OCOO 0000 OOOC 0000 OOEO0500 OOCS c4C2 0000 DCC4 C4C4 C40C 0000 C4CE05EO 05C4 c4C4 0000 0000 0000 OOFF 0000 000005FO 0000 0000 0000 OOCE C1CF 01CE 0000 00000600 OE01 010E 0000 OOCE 0000 OOCE 0000 C1C10610 CF01 01CF 0000 OOCE 01DE OOCF 0000 C3C40620 CEC4 C4C4 0000 0000 CE01 03CO C1C2 0000

Page 23: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

23

• RCA 1869/1870 VIS CONTROL PROGRAM

AOOR .0.1 .2.3 .4.5 .6.7 .8.9 .A.B .c.o .E.F0630 OE01 01D1 0000 C400 C4C4 C4C4 0000 C4000640 C4C4 C4C4 0800 0002 0408 0402 0000 C8C80650 C8C8 C8CC 0000 OOCA 0505 0505 0000 00060660 0901 0101 0000 OOCE 0101 01CE 0000 OOOE0670 0101 OEOO 0000 OOCF 0101 CFC1 C100 00060680 0800 DODO 0000 OOOE OOOE C20E 0000 C4CE0690 C4C4 C4C4 0000 00D1 0101 01CE 0000 000106AO 01CA CAC4 0000 0005 0505 05CA 0000 000106BO CAC4 CA01 0000 0001 olCA C4C8 DOOO OOOF06CO C2C4 C80F 0000 C4C8 C800 C8C8 C400 00C80600 C800 C8C8 0000 00C8 C8C4 C8C8 0000 000006EO 0009 F.600 0000 CADS CADS CADS CAOO 000006FO 0000 C7C7 C7C7 0000 0000 F8F8 F8F8 00000700 0000 FFFF FFFF C7C7 C7C7 0000 0000 C7C70710 C7C7 C7C7 C7C7 C7C7 C7C7 F8F8 F8F8 C7C70720 C7C7 FFFF FFFF F8F8 F8F8 '0000 0000 F8F80730 F8F8 C7C7 C7C7 F8F8 F8F8 F8F8 F8F8 F8F80740 F8F8 FFFF FFFF FFFF FFFF 0000 0000 FFFF0750 FFFF C7C7 C7C7 FFFF FFFF F8F8 F8F8 FFFF0760 F3F3 F3F3 FFFF FOFO FOFO FOFO FOFO CCCC0770 CCCC CCCC CCCC C3C3 C3C3 C3C3 C3C3 FFFF0780 0000 0000 0000 0000 FFFF 0000 0000 00000790 0000 FFFF 0000 0000 0000 0000 FFFF C1C307AO C7CE OCF8 FOEO EOFO F80C CEC7 C3C1 FOF807BO CCC7 C7CC 08FO C3C6 CCF8 F8CC C6C3 FFFF07CO F3F3 F3F3 F3F3 F3F3 F3F3 F3F3 FFFF FFFF07DO C3C3 C3C3 FFFF FFFF FOFO FOFO FFFF E10207EO D2CC CC02 02E1 OOCC OEFF FFOE CCOO ceDE07FO FFFF OECC 003C 09FF 15BO E14E 1590 5407

Page 24: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

CPU &. INPUT PORT

13

l\)~

TPA 118 tl2. til N~ MR D I1

}& 1>1 1>2 ~3 P+ ~5 116 "P7INTeRFAce:EFt

MA7 I~,- ... """7"" I

C.LOCK MAl, 1'\1 ... MAl.,13'MAS ~MA5"

1~ 2.11- m MA4 29~ MAlf

MA3 2.8 .... 101"3MAZ. 27 .. MM_

I~t...,.

MAl .. MAl

U\ MA~ 2.S '; ~A~

'602.. TPB ~3 TP,B+sv TPA ,At )--TPAI~.5'JI' M'WR ~ MWR

2. WAtT 17 ,. tl2..N218NI ... tJ I

3' 19,- N& ; N~/NT

'])7 6'...:~ ~J)7q3

~f\our Db ~Dl>U3])5 1& >-bS38 )MA.IN D4 II !J :)

>-])&1-D3 I~

~ ])321 EF+ D2. 1.3

~D2.III- t2..\.. 13"2.2

l)I15

IULl-J?'])I

Wi D~ >])~

MRD 7 ;. RRi11 2./ /'1 I., 15 I~ 8 , 4 II

~

.~ RIE"F'2 23 23 CSI ~ 01 02. 03 0405 (J~ 07 13. SR

C52.J.L CE• 3 CL~/l>.R r 1MOPE UL 1852 US 1853

ItI- eLI< II 50 UT t U3

+ -- C.LEARI~ II 12 13 14 15 l~ 17. CLK cgc W1. NI 110 12)

-C.I 22 2& 18 16 q 7 5 3 I 15 Ilf 3 1-Ir- - - - ._- - -- - -- - - - - - -- - - - - -- - - - - -- - -,I HOSi II

,Co~H'UTr:.l I- J' 'I' , " \ J J\ I " I

PREl>lSPLA'

c.PU CLOCK

e e -

Page 25: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

e eVtDEO INTERFACE +c-" •

ViDeOour

RSi

7

LU.wlIZI ~lT

C2J)OT KTAL[£!7~

Xl -

DOT XTAL hIe C3 -:'

COMP SYNc 12.1 ww.

UI't,8;~RoD'" JrrALI!i-.

ccs. N'fSC.~__fiB" CCSI\ R:BU

ebBS.........._taII__"z CJ)B+

~_.•'-,4 cnB3~_tV~1Cl>82.

r----:/."B I CD81C~8&

I .7l1-LS2.4-5 -

87 a IS 8fS'12 81 811"I ,21 /31 1'1 lSI 1'1 11\ lSI

3M'Ri>

TP8.... to-,~ nlul InTPB iI=3 2.1 2.\ N=3 TP8

. lllSpu.y '7 2. j), SPLAY

""iiSYiC '6 3 I'ISYNC ~E])'sPLAyl' ~PR';-D/.'JPIA'tI

cHsal~7 . 32. CMSEl

"~])STB 18 3S 1\1>65T5 CPu CLDc~ ~CPIJ CL.DCkUfa CJ#tWR I~"

c~Z2..18bq ,,"12.3

CM~ I

CMA2. 211-

pMWIl 58TPA I T~

;.oo:>----..I.f

N~·.)l.---=i

NI ~....:.;I.I

N2)....-.l:¥l

MAlS?~~

MAI~~zt

~A2.~-~

MA3~-.:i=4

MA4>--~

MA5~~

MAIo~..-:..L.+

MA7 >--:..=.f

I... I 1 J~~ .._~

b~~ I)1) . ,...b2,. . >-- _. Ib3) .. ,...~4/ ,....b5/ ,D'~ . ..])7~

Page 26: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

CPU EPROM

~

m

"~~(:(.~

:~'1'I','"

"J" .3 .2 7 I.. .. ,

])1 )2J"3JI'f D1~ ll!ll9

te Uo ",1£ U7 2 - 71.1-LS7S 8 1\0"J'!til I:l'll t:l CI'" 13 t:. I:t Q!t QII

7 AIq r. 1j --. q .. IJ " " A2.S A!>~ Cf q. A...

3~

~ U9~

2- AI> 27'",A7

" 2.3 A9, .3 ~, 2.3 ActIQ6' Co S A AID.- I#; 18 B!. Uti)U~ U8 y~~ OE71.fLS'38 ~"l 1l~ l:~ ll~M~ 17- 628

Cf /0 II 13 /II 15 M nS~

"-" ,-,~

~......-, ""0;;

~<;'< ._--_... - --

oJ

I~

''-'"

MWI

-MRDD~

J>DD

MA~.

MAMA2.M~

MA4MASM~MA:

TPA

e e e·

Page 27: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

•27

40 X 24 VIDEO Display

PARTS LIST

In addition to listing parts, the list below shows the number ofpins for each IC, pins connected to ground for each IC, pins conn­ected to +5V for each IC, and pins not used on each IC. This infor­mation is not shown on the schematic drawings, and must he gottenfrom this list when building the video interface.

PART TYPE DESCRIPTION tPINS GROUND +5-VOLT t",,!uf;ED

2, 16, 21, 4, 5, 6,22, 36, 37, 3938, 40241414 4, 10

16 4, 6, 7,9,10, 11, 12

5 1, 8,11, 14

5 1, 8,11, 14

16 7, 9, 10,11, 12,13, 14

U1 CDP1802ACE

U2 CDP1852CEU3 4001U4 4081

US CDP1853CE

U6 74LS75

U7 74LS75

U8 74LS138

U9 2716U10 CDP1869CEU11 6116

U12 741.s245U13 6116

U14 CDP1870CE

CPU 40

8-Bi t Port 24Quad NOR 14Quad AND 14

N-1ine Decod 16

Quad Latch 16

Quad Latch 16

Decoder 16

2KX8 EPROM 24VIS 402KX8 RAM 24

ry"ransciever 202KX8 RAM 24

VIS 40

20

2, 1275, 6, 7,8, 98

12

12

8, 5

122012, 18,19, 201012, 18,203, 20,24, 39

21, 244024

2024

40

19

22, 23, 24,26, 27, 3031

R1 47 K-Ohm resistorR2 22 M-Ohm resistorR3 470 Ohm resistorR4 1500 Ohm resistorR5 1 K-Ohm resistorXl 5.67 ~~z crystal (see text)C1 4.7 uP capacitorC2 15 pF capacitorC3 15 pF capacitor

NOTE: 6116 RM~'s must be 250 nSec or faster •

Page 28: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

28John Swofford, 2382 N. Fairview Ave., Decatur, II 62526 USA

EPROM ·D:J:SK" •After Using QuestPs BASIC for quite some time, I thought that it wouldbe nice to have it in EPROM since loading from cassette takes anagonizingly long time. In order to avoid problems with EPROM vs. RAMdecoding, inaccessiblity to the BASIC interpreter and having a majorportion of memory dedicated, I decided to treat the set of EPROMs as akind of disk system that could be loaded into RAM. Of course, unlike adisk system, the data is not easily changed. However, there are a fewadvantages to consider:

1). cost - very low2). software/hardware - simple3). speed - very fast4). memory usage - only 4 locations

My system uses a 8255 memory-mapped at FF3C to FF3F. The 8255 acts toaddress an EPROM, fetch data and present it to the CPU. Ports A and Bare the 16 bit EPROM address lines. These lines are decoded by the74LS138 and the data at that EPROM location is fed into Port C whichpasses it to the CPU at FF3E. All 14k of QuestPs BASIC loads, ready forexecution, in 3 seconds or so (using a 3.579/2 clock). I had some roomleft over so I placed Dirk JorenPs handy Code Editor behind BASIC. Thiscircuit can handle 32k of EPROM. For 64k, use a 74LS154 instead of theP138.

Sample program to transfer data from EPROM to RAM

Run at any page boundary above BASIC (i.e. 3600, 4000, etc.)

if ~o, go start new pagego to YYXX (BASIC is 8818)

0100 •count

be loaded

pointersEPROM high addrEPROM low addrEPROM data buss8255 controlstart of RAM to

R(A)=34FF end of loaded RAMset up 8255

DATA XFER ***************address EPROMSretrieve data byte from EPROMsstore in RAMincrement RAM pointerX -) R(D)if not done, continue loadingdone with page - increment bankX -) R(C)last page?all done.

SET UP POINTERS **************X -) R(B)InitializeR(C)=FF3CR(D)=FF3DR(E)=FF3ER(F)=FF3FR(B)=0000

*************XX00 EBXX01 F8 FF BF BE BD BCXX07 F8 3C ACXX0A F8 3D ADXX0D F8 3E AEXX10 F8 3F AFXX13 F8 00 BB ABXX17 F8 34 BAXX1A F8 FF AAXX1D F8 89 5F************* STARTXX20 9B 5C 8B 5DXX24 0EXX25 5BXX26 lBXX27 EDXX28 8A F3 3A 22XX2B 22XX2C ECXX2D 9A F3 3A 20XX31 C0 YY II

Page 29: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

£PRCM /)ISK

... "o :IUl /II

Z ~P z: 0· .· .· ,I •

: :· .· .· .· .I •

i bi ;'II II •· .I :I •

• II II •

• •: c:i ~: /II

i ~: :· .: :! :~::COi

! I! !: :: :· .! l: :· .: :: ii i· .! i• I: :I I

n Ul:I -<" :~ :Ul :-< :· ., .· .· .· .· !" ":. :.-4 -4

'" /II: ,· .i :I •: :I II 1· .

;:, ...... ez's

~1 ~

+s.""'"C\..f C.ttlClil" 'TD ~Ct'W FF~·F':3":

'~HAJ cw~rri>2D /-2e; -83 ---I------- ...._.- -

~5" ";

74~ 1"Tb AlJY(StHf~

/.'JL$~ 2.'~

$~F ~7" 138 '1

Iv> j' :: IS .,~ IIJIill ~ ...... 14C , c: IS

t1.( ~ 1)'8 .J") 16 1\16 ,\'8

8 I 21

e:r 2- let

3 ZZ.... 2~

"/ 2S ,

ZA 2-

-rtZ, s 2731- 2'7~2 2J~2 27;2

?PJ 'z 4--~ vf!> 1..1 S

~to fD

;,l

let 7 , 2-~

18 8 3 4-~

)4-

q

t10..

\$14

8255. ,4;

It..rJ

~-

( '..-• '70

I] Zoo ]20

I~I£' -~ -::Ir'11

-:!-

~~isIt. A~=~II :~.'l" ~'0 : =..-

... : ...~; 7~__ _ &.550

...

P7

~,

/4IJ

f)~

C5~"''WIt

-R.esET

Page 30: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

30

An 1861 Address/Data kaIrlue/Load luaction- by J.G. cayer, Box 2034, Blnton, Alberta. TOE leO

Being the owner of a TEC-1802 (lK RAM and Neutronics monitor), I oftenwished to have a better way of displaying data and addresses than with theLEDS provided with the main board. I've toyed with the idea of addingseven segment LEDS to my system, but finally opted for software - cheaperand more fun than a soldering iron.

This display uses an 1861 and operates at the bottom of the page it'swritten on, page 3 in my case. The hi and 10 address bytes are to theleft, followed by a space and the memory content byte. To run the program,enter 00 (examine memory) or FF (load into memory). Enter hi address, then10 address. If on examine, keep pressing input for each consecutiveaddress location. If on load, enter new contents, then press input foreach consecutive location.

The program can be run on the page of your choice as long as 10 addresses01 and 7E are changed accordingly. It will also run on an Elf if location1D is changed to 69.

0300 F8 03 B1 B2 B3 B4 B5 B7 B8 B9 F8 76 Al F8 73 A20310 F8 1D A3 F8 68 AS F8 50 A7 F8 3D A8 D3 61 E2 7A •0320 D5 32 24 7B D5 BE D5 AE F8 D8 A9 3F 2B 37 2D 390330 33 6C 5E 9E D8 8E D8 19 4E D8 30 28 D3 BF F6 F60340 F6 F6 FC co A4 D7 9F FA OF FC CO A4 D7 30 3C D80350 04 A4 F8 06 AF 2F 8F 3A 5F 89 FF 27 A9 30 4F 440360 59 89 FC 08 A9 30 55 D3 3F 68 37 6A 6C 64 22 300370 67 00 00 00 72 70 22 78 22 52 C4 C4 C4 F8 03 BO0380 F8 00 AO 80 E2 E2 20 AO E2 20 AO E2 20 AO 3C 830390 30 74 FO 80 FO 80 FO 80 80 80 FO 50 70 50 FO 5003AO 50 50 FO 80 FO 10 FO 80 FO 90 FO 90 FO 10 FO 1003BO FO 90 FO 90 90 90 FO 10 10 10 10 60 20 20 20 7003CO B2 BB A4 AC B4 A2 A6 B6 A8 AA BO 9A 96 9E 92 9403DO TO 03FF ARE ALL 00 (DISPLAY AREA)

Page 31: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

- by R. Carr, 4691 Freeman load, Middleport, N.Y. U.S.A. 14105

A couple of years ago, after I purchased Netronics VID, I wanted to use itwith Tiny Basic, but was unable to use the cursor position sequence becauseit starts with "ESCAPE", which is the line erase in Tiny. A call toNetronics provided no help, but after studying Tiny's manuals andexperimenting a bit, I was able to use this feature. The following programdemonstrates this.

BetroniC8 VID Plot for Tiny Ba81.~

•This program is for a Netronics VID using 64 character mode. It is writtenfor Netronics Tiny Basic. It allows you to use the Escape sequence forcursor position. This is done by outputting the Escape sequence throughthe long branch to the character out routine. This is necessary becausethe escape key is the line erase in Tiny. The "Plot 12" in Line 20 outputsa form feed to the VID. A little study of the program will reveal how itworks.

10 REM" PLOT FOR TINY BASIC BY R. CARR"20 PLOT 1230 REM" JUMP TO MAIN PROGRAM40 ooTO 200

100 REM" "PLOT SUBROUTINE"110 LET P-USR(265,27)120 LET P-USR(265,61)130 LET P-USR(265,V)140 LET P-USR(265,H)150 RETURN200 REM "MAIN PROGRAM"210 PRINT"ENTER V(1-15, H(0-63) ";220 INPUT V,H230 IF V-oTHEN END240 ooSUB 100250 PRINT ".";260 LET V-O270 LET H-26280 ooSUB 100290 LET P-USR(265,5)300 ooTO 220999 END

Cassette Copy Progra.- by A. Boisvert, 4830 des Pervenches, Orsainville, Que.

Here is a small program to copy cassettes from one recorder to another.The program allows direct recording from one recorder to another byregenerating the ELF tape wri te tones. If the input recorder invertsits output, reverse the 7A and 7B instruction.

ADD. CODE

• 0000 3500 EF2-l?0002 7B0003 3D03 EF2-0?0005 7A0006 3000 RETURN

Page 32: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

32

A Software Clock Lock- by K. Bevis and P. Muir

The ACE Front Panel contains a "Port Assist" memory map decoder on the realtime clock circuit to minimize the risk of an accidental write to theclock's buffers, which would reset the clock's time functions. The purposeof the "Port Assist" is to require two actions, which would be nearlyimpossible to reproduce accidentally, before actually accessing the clock.The problem with the "Port Assist" is that it consumes one whole port.

The "Software Clock Lock", however, utilizes two unused memory addresses inthe 32 byte buffer reserved for the clock, and in the case of the FrontPanel - addresses FFDE-DF in the FFCO-DF area. The lock requires theprogrammer to read, then write to the buffer in two different directions ­an improbable action to reproduce accidentally.

The 74LS138 address decoder enables the 4518 binary counter upon a read toaddress FFDE or DF. The binary counter is incremented by TPB and outputs a"0" to the OR gate to the clock. After a brief period - 4 executioncycles, the binary counter resets and outputs a "I", shutting off the ORgate so no further MWR pulses can reach the clock. In that way, only oneor so memory addresses could be operated by a run away MWR action - Le., aprogram loop writing into memory before the gate would be closed off.

The MRD pulse, or reading the clock is not affected by this circuit.

Parts required: 1 - 74LS1381 - 4518 or 45201 - 4071

re-use 1 gate on a 4011 on the Front Panel

The program "Timeset" and SYMON routine "Timeread" found elsewhere in thisissue utilizes the Clock Lock and provides the appropriate software.

A1;r

I 7 7 52

2 L4S B 3 8

Mri , j 16CS 5 e 7

A4 A16 e

TPB+ t:. -:-....

~

Page 33: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

•33

ACE Hardware Drivers for Syaon- by M. Franklin, 690 Laurier Avenue, Milton, Ontario, Canada • L9T 4RS

The following two routines provide you with software for the ACE FrontPanel Real Time Clock (using the Bevis/Muir Clock Lock) and the hl'ROMBurner. Monitor located at COOO - C7FF.

)069006920693069506960699069C069D069E0691"06Al06A206A306AS06A606A906AC

)06AF06Bl06B206B406BS06B706B806B906BC06BF06C2

<06CS06C6

06C906CA06CB06CC06CD06CE06CF06D2

1"81"1"B9F8FEB7D4COOCD4CS94383300F8C8A7A91"88357D4C6C6D4C6C6D4COOC

1"81"1"B9F8FEB7F8CSA9A7D4C6CBD4C6C6D4C6C6D4COOCDSD4CS94

3A0029270957D4C668DS

83

LDI 111"1"PHI R9LDI liFEPHI R7SEP IICOOCSEP IICS94

LDI IIC8PLO R7PLO R9LDI 1183STR R7SEl' IIC6C6SEP IIC6C6SEP IICOOC

LDI 111"1"PHI R9LDI liFEPHI R7LDI IICSPLO R9PLO R7SEP IIC6CBSEP IIC6C6SEP IIC6C6SEP IICOOCSEP RSSEP IICS94

DEC R9DEC R7LDN R9STR R7SEP IIC668SEP RS

TIME READCALENDAR ENTRYSET R9 = MEMORY MAP "1"1" C8"

SET R7 = WORK PAGE "FE C8"

CR/LFTEXT OUT

83

STORE "83" IN WORK PAGE CLOCK BUFFER

READ CLOCK - MONTHREAD CLOCK - DAYCR/LFTIME ENTRYSET R9 ~MEMORY MAl' "FF CS"

SET R7 z: WORK PAGE "FE CS"

READ CLOCK - HOURREAD CLOCK - MINUTEREAD CLOCK - SECONDCR/U'EXIT

READ CLOCK ROUTINE

OUTPUT COLONSET BUFFERS TO REGISTER

READ CLOCKSTORE IN BUH'EROUTPUT AS HEXRETURN

Page 34: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

34

)06D3 D4COOC SEP 'COOC06D6 D4CS94 SEP ICS9406D9 S3 S06DA S7 W06DB 49 I06DC S4 T06DD 43 C06DE 48 H06DF 2006EO 4F 006E1 4E N06E2 3F ?06E3 0006E4 D4CS3E SEP IICS3E06E7 D4CSOO SEP IICSOO06EA 9D GHIRD06EB 3AFO BNZ fIFO06ED 8D GLO RD06EE 32FS BZ #FS06FO E1 SEX RI06F1 6A INP R406F2 2D DEC RD06F3 30EA BR flEA06FS EB SEX R106F6 64 our R406F7 36F7 B3 #F7

<06F9 D4CS6F SEP #FS6F06FC E1 SEX R106FD 6A INP R406FE 30FS BR IIFS

EPROM BURNERCR/LFTEXT OUT

CALL START ADDRESS OF SOURCECALL PROGRAM LENGTH & EPROM START ADDRESSES

TEST IF ENTRY AT 000

INC COUNTER TO ENTRY IF NOT

SET RX - SOURCE (R8)our DATAWAIT SO MSTEST IF DONE - EXIT IF RA-OOOOINC COUNTER

LOOP TILL DONE

Tiae Set Real Tiae Clock Driver- by M.E. Franklin. 690 Laurier Ave., Milton, Ontario, Canada. !AT 4R5

The following program is a callable routine to be loaded at 1000H from astorage device when required.

1000 F8FF LDI flFF1002 B9 PHI R9 R9 = MEMORY MAP1003 BA PHI RA RA = CLOCK LOCK1004 F8C8 LDI flC81007 D4C594 SEP IIC594 TEXT OUT100A OC100B 4D M100C 4F 0100D 4E N100E 54 T100F 48 H1010 3F20 ?1012 00 lDL1013 D41080 SEP fl1080 SET CLOCK1016 D4COOC SEP tlcooe CR/LF1019 D4CS94 SEP IICS94 TEXT OUT101C 44 D10ID 41 A101E 59 Y101F 3FOO ?1021 041080 SEP 111080 SET CLOCK1024 D4COOC SEP IICOOC CR/LF

Page 35: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

35

1027 D4C594 SEP #C594 TEXT OUT102A 57 W102B 45 E102C 45 E102D 4B K102E 44 D102F 41 A1030 59 y

1031 3FOO ?1033 D41080 SEP f/1080 SET CLOCK1036 D4COOC SEP flCOOC CR/Llo'1039 D4C594 SEP #C594 TEXT OUT103C 48 H103D 4F 0103E 55 U103F 52 R1040 3FOO ?1042 D41080 SEP #1080 SET CLOCK1045 D4COOC SEP flCOOC CR/U'1048 D4C594 SEP #C594 TEXT OUT104B 4D M104C 49 I104D 4E N104E 55 U104F 54 T1050 45 El051 3F\)() ?L053 D41080 SEP tl1080 SET CLOCK1056 F8D5 Lor #05L058 A9 PLO R9 SET MEMORY MAP TO1059 F8DE LDI fiDE CLOCK WRITE IN R9105B AA PLO RA SET CLOCK LOCK IN RA105C OA LDN RA UNLOCK CLOCK105D D4C680 SEP flC680 READ CLOCK - DISPLAY1060 D4COOC SEP flCOOC CR/LF1063 D4C594 SEP flC594 TEXT OUT1066 56 V1067 45 E1068 52 R1069 49 I106A 46 F106B 59 Y106C 3F20 ?106E 00106F D4C003 SEP #C003 CALL CHAR IN1072 FBOD XRI HOD TEST IF CR1074 3AOO BNZ #00 LOOP IF NOT1076 COCOOO LBR flCooo EXIT TO MONITOR1079 FFFF107B FFFF107D FFFF107F 00

• 1080 D4C5C9 SEP flC5C9 CALL DATA IN HEX1083 F8DE LDI fiDE1085 AA PLO RA SET CLOCK LOCK IN RA1086 OA LDN RA UNLOCK CLOCK1087 29 DEC R9 DEC COUNT1088 8D GLO RD1089 59 STR R9 GET DATA108A D5 SEP R5 LOAD CLOCK BUFFER

Page 36: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

36

1854 tWlT Operation on the ACE CPU Board- by K. Bevis

•The ACE CPU Board utilizes an 1854 programmable hardware UART and a COM8116programmable baud rate generator. with the RS-232 circuit to commuut catewith external serial devices. All standard baud rates from 50 to 19.200and bit patterns of 5 to 8 plus parity. etc•• are available. and undersoftware control. The CPU Board is presently configured with the followingassignments:

Baud Rate SelectData In (read)Data Out (transmit) ­Control RegisterStatus Register

Instruction 636E66656D

These assignments may be changed by cutting the traces near IC 16 andinstalling straps to match the desired I/O codes.

The following article will provide a guide to the codes and some of theprogramming that could be used to operate the UART in this configuration.Table A identifies the different baud rates. the upper nibble is thereceive speed and the lower is the transmit speed. Table B describes theword length and stop bits which must be combined in the UART programmingcontrol word to set the communication format. Table C describes the restof the control word. The complete word must be made up of the appropriate •selections for bi ts 0 - 6 to sui t the application. Bi t 7 is set when youare ready to start. and it locks in all of the others.

OUTPUT CONTROL BYTE TO UART - SEE TABLES B AND C

At this point. the UART and baud rate are set and awaiting use.

R3 IS ALSO REGISTER XOUTPUT BAUD RATE BYTE TO COM 8116 - SEE TABLE A

300 BAUD REC AND TRANSRECEIVE 1200 BAUD TRANSMIT 50 BAUD

•7 DATA BITS. NO PARITY. NO INTERRUPT7 DATA BITS. NO PARITY. INTERRUPT IS ENABLED7 DATA BITS. EVEN PARITY. NO INTERRUPT

test program will make use of some of these values.CPU will jump to this routine with program counter =

The following typicaland " assumes that theR3 and stack = R2."

ADDRESSSET UP ROUTINE

00 SEX R3 E301 OUT 3 63

02 EXAMPLE 1 55EXAMPLE 2 70

03 OUT 5 65

04 EXAMPLE 3 11EXAMPLE 4 31EXAMPLE 5 12

Page 37: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

37

To send data, continue with this program:

• SEND ROUTINE

05 OUT 5 65 REQUEST TO SEND (RTS) MUST PRECEDE.06 DATA BYTE 80 THIS IS DONE BY WRITING AN 80 INTO THE CONTROL

REGISTER. THIS LOCKS THE PREVIOUS DATA IN.

07 LDI PAGE F8 pp)09 PHI R7 B7 ) POINT REGISTER 7 TOWARD DATA BLOCK TO BEOA LDI 00 F8 00) TRANSMITTED.OC PLO R7 A7 )

OD SEX 2 E2 SET X REG. TO SCRATCH AREAOE INP 5 6D READ STATUS REGISTERIF SHL FE SHIFT LEFT10 BNF OE 3B OE BRANCH IF DF=O (WHEN UART IS READY IJF '" 1)12 SEX 7 E7 R7 = RX (DATA BLOCK)13 OUT 6 66 LOAD UART WITH DATA BYTE14 LDN 7 07 LOAD NEXT BYTE FOR CHECK15 BNZ OD 3A OD LOOP BACK UNTIL 00 IN DATA BLOCK OR OTHER STOP REF.17 SEX 3 E3 R3 '" RX18 OUT 5 65 OUTPUT CONTROL BYTE WITH "REQUEST TO SEND" CANC~LLr.D

) EXAMPLE 3 1119 ) EXAMPLE 4 31

) EXAMPLE 5 12lA SEX 2 E2 RESTORE R2 STACKIB LBR MONITOR RETURN TO MONITOR

To receive data, continue into this program:

RECEIVE DATA ROUTINE:

20 LDI PAGE F8 pp)22 PHI R8 B8 ) SET R8 TO RAM SPACE TO STORE INPUT DATA23 LDI 80 F880)25 PLO R8 A8 )26 SEX 2 E2 R2 = RX = SCRATCH27 INP 5 6D READ STATUS REGISTER28 SHR F6 SHIFT RIGHT29 BNF 27 3B27 IF NO DATA REPEAT READ OF STATUS REGISTER2B SEX 8 E8 R8 = RX2C INP 6 6E READ IN DATA BYTE2D GHI 8 98 )CHECK IF DATA PAGE FULL OR OTHER REF'hRENCJ:: LOCATION2E XRI PAGE+l FB PAGE +130 BNZ 26 3A2631 SEX 2 E232 LBR MONITOR WHEN DONE GOTO MONITOR

• The receive and send programs may be combined by reading the statusregister and checking the receive status and send status concurrently, andbranching to the appropriate section of the program.

Page 38: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

38

The status register in the UART provides additional information. Takenfrom the data sheet on this device, the following is a description of thisbyte of data:

Bit 7Trans. HoldingRegister1 = Emptyo = Full

Bit 3Framing ErrorNo stop biton receivedcharacter= 1

6Trans. SendingRegister1 = Emptyo = Full

2Parity ErrorRec'd. Char.did not matchparity progrm'd.=1

5PeripheralStatus. Hito 10 trans­ition on Pin37 = 1.

1Overrun errorRec'd. Char.was not readbefore a suc­ceeding char.received.= 1

4Ext. Statusinverted onPin 38

oData availableA completechar. is readyto be read= 1

Further control word examples:

1. Kansas City tape interface. Example 3 in setup program - Q "lA"would provide even parity with 8 data bits. Example 4 in setupprogram - a "18" would change the above to odd parity.

2. 5 bi t baudot codes. Example 5 in setup program - a "02" would sendonly 5 bits at even parity.

3. To send a break condition for a test. Since the normal condition isa 1 (or +5V) condition from the UART and a negative from the RS-232interface, send a "40" to the UART if the opposite condition isdesired. (address 06)

4. To use interrupt, bitS must be programmed to 1 and the followingconnections made via the RS-232 interface.

1 RTS would be connected to pin 42 CTS would be connected to pin 53 PSI would be connected to pin 8

This will generate a low signal on pin 13 of the UART (Interrupt Pin)whenever the following events occur:

1 Data available, (received and waiting to be read)2 Transmit holding register empty3 Transmit sending register empty4 Peripheral status pin 37 receives a hi to 10 transition

Following an interrupt, the status register must be read. This actionresets the interrupt. Interpretation of the results would decide theaction to be taken. •

Page 39: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

39

• COMBINED SEND/RECEIVE PROGRAM:

00 E3 13 FE SHIFT LEi"T01 63 SET BAUD RATE 14 33!lF IF DF=1 GO LOAD TRANSMlT R~Gl~'l'.bR

02 55 16 F6 F6 SHIFT BACK AND03 65 SET CONTROL WORD 17 F6 SHIFT RIGHT TO05 65 LOCK IN 18 3B12 CHECK RECEIVE REGISTER07 F8 pp R7 = SEND DATA lA E8 R8 = X09 B7 R8 = RECEIVE DATA IB 6E READ RECEIVED DATAOA B8 BUFFER ON SCRATCH lC 64 OUT TO DISPLAY s INCR.OB F800 PAGE ID 3011 GO BACK TOOD A7 IF E7 R7 = XOE F880 20 66 TRANSMIT A CHARACTER10 A8 21 07 IS THE NE~r DIGIT A 00

22 3A11 IF NOT GO LOOK FOR MOR~ DATA11 E2 R2 = RX 24 E3 ) CLEAR RTS BY12 6D READ STATUS 26 65 ) REWRITING THE ORIGINAL

27 11 ) CONTROL WORD

28 CO )29 CO ) JUMP TO MONITOR2A 00 )

•The data page should contain several ASCII characters starting at addressppOOH. The above program will send this data and receive data and writeit at pp80H. There is space for only 128 characters in t h.is buffer. Ittesting and the send and receiye are looped, this program will not receivethe last two characters as they will be left in the UART.

When receiving or sending, data transmission is relatively slow since itmust be converted to serial. You normally have time to do many machinefunctions between characters being received or sent. At 19200 baud, youhave 65 complete fetch and executes, and at 300 baud, you can get 4090fetch and executes, based on a processor speed of 1/2 color burst 0.758MHZ.).

The advantages of interrupt in this application is significant. Arelatively small interrupt routine to "nurse" the UART would allow you tocarryon other processor functions. This is the real advantage of ahardware UART over a software UART. ---

Page 40: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

HEXo123456789ABCDEF

BAUD RATE5075

110134.5150300600

12001800200024003600480072009600

19200

40TABLE A

SELECT THE SPEED TO SUIT THE SYST~M ORAPPLICATION AND MAKE DUAL HEX DIGITWITH THE HIGH NIBBLE = RECEIVEAND THE LOW NIBBLE = TRANSMIT

TABLE B

NOTE 1 - To use interrupt, an interrupt routine must exist in software tohandle this routine. See 1802/5/6 programming instruction to prepare thisprogram. When not in the interrupt mode, the UART must be polledcontinuously to determine the stage of operation.

BIT 2o1o1o1o1

BIT 0o11

NOTE 1

BIT 3oo11oo11

BIT 1Xo1

BIT 51o

BIT 61o

BIT 71o

BIT 4oooo1111

5 DATA BITS 1 STOP BIT5 DATA BITS 1.5 STOP BIT

. 6 DATA BITS 1 STOP BIT6 DATA BITS 2 STOP BITS7 DATA BITS 1 STOP BIT7 DATA BITS 2 STOP BITS8 DATA BITS 1 STOP BIT8 DATA BITS 2 STOP BITS

TABLE C

NO PARITY GENERATED OR CHECKEDODD PARITY GENERATED AND CHECKEDEVEN PARITY GENERATED AND CHECKED

INTERRUPT ENABLEDINTERRUPT DISABLED

TRANSMIT A BREAKNORMAL

TRANSMIT REQUESTREMOVES TRANSMIT REQUEST

Page 41: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

J

Rev. 83.04.01

DATE:---------•

NAME:--------------PIlODOCT ORDER.

CPU BoardBackplane and I/O Board, Ver. 2Front Panel (with EPROM Burner, Clock)I/O Adapter for Backplane, Ver. 164K Dynamic (4116) BoardEPROM (2716/32) BoardKluge (wire wrap) BoardNetronics - Ace Adapter BoardDMA Adapter Board (ELF II)VDU Board, Ver. 2

Software

Fig FORTH - Netronics Cassetteformat (6K) OOOOH

Tiny Pilot - Netronics Cassetteformat (2K) OOOOH

SYMON - Netronics Cassetteformat (2K) COOOH

Back Issues

"Defacto" Year 1 - 3 (Edited)Year 4 ReprintYear 5 Reprint

lleabersbip

QUANTITY UNIT PIlICE

$40.0040.0035.0020.0050.0040.0025.0025.00

3.0040.00

$10.00

$10.00

$10.00

$20.0010.0010.00

TOTAL

Current Year - Sept. '82 - Aug. '83includes 6 issues of Ipso Facto

CanadianAmericanOverseas

PRICE JIOTE

$20.00 Cdn. ----20.00 U.S. ----25.00 U.S. ----

•Prices listed are in local funds. Americans and Overseas pay in U.S.Funds, Canadians in Canadian Funds. Overseas orders: for all items add$10.00 for air mail postage. Please use money orders or bank draft forprompt shipment. Personal cheques require up to six weeks for bankclearance prior to shipping orders•

SM.B POLICY

We guarantee that all our products work in an A.C.E. configurationmicrocomputer. We will endeavour to assist in custom applications, butassume no liability for such use. Orders will be shipped as promptly aspayment is guaranteed.

Page 42: 3 Editor's Corner - COSMAC ELF · But JudsinS from the advertisements in BYTE, FORTH is available for most anw processor, as well as for several of the aaJor microcomputer swsteas

NAME:

MAILING ADDRESS:

PHONE NO.:

Note: Ensure mailing address is correct, compl4te and printed.Please ensure payment is enclosed.

-----------------------------------------------._-----------------------

ASSOCIATION OF COMPUTER-CHIP EXPERIMENTERSc/o M.E. FRANKLIN690 LAURIER AVENUE,MILTON, ONTARIOL9T 4R5