devoted entirely t,o tite co-smac 18024 advertising,i" policy members my still ecver t ise...
TRANSCRIPT
--~~~~~~~~~~~~~----~~~~~~~~~~~~~~~~~~-~~~~---
•
DEVOTED ENTIRELY T,O TItE CO-SMAC 1802
Ar~T ICLF.5
~UGqST 1981
ISSUE 24
•
1802 LOGIC ANALYZEr? by HArley Sh a ri'coUE::.iIGN YOUH PROGf~AMS TO rW~1 ATMIY PfJ,i}!:
l;OUNURY hy Ken BevislH02 CODE EDITOR by lJirl( JorensODDS and ENDS by MAlcolm CoyneHEX to Or:CIMAL CONVERSION by DAvid P\lslt'eXOR TESTING by Ken ManteiII I iJr:o I NTERFACE for MC6E,347 by TorI') Jon psCENTRONICS PRINTER INTERF.ACE by C."I. Vl"llnBASEBALL by Gilbert Hertr8ndPROGRAM YOUR SOUNDS by Eddie Sh,"lffr>r
UEPARTMHITS
1981 ExecutivePubli shers PageEditorial ListinqExecutive FileAdvertisin9 PolicyHELPTreasurer's NotesI~ew dues rateMembership QuestionaireClub Order FormVote For Best ArticleMembership FormMai l e r
I
:2 I)
:2,')
J3tl,1
(,::i
I)
61.1. ,:,
, -'
•IPS.O fACTO is published by the ASSOCIATION OF COMPUlLR IXPERIMENTERS(A.C.E.), a non-profit, educational orqanization. Information in IPSO'FACTO isbelieved to be accurate and reliable. However, no responsibility is assumed by IPSOFACTO Of the ASSOCIATION OF COMPUTER EXPERIMENTERS for its use; norfor any .nlringcments of patents or other riUhts of third parties which may result fromits use.
2ASSOCIATION OF COMPUl'ER. EXPERIMENTERS 1981 EXECurIVE
ProgramPresident: Co-ordinator.
41 fl-643-1578.John Norris 416-239-8567 Jeff Davis
Past President:Training
Ken BevIs 416-277-2495 Co-ordinators:Fred Feaver 416-637-2513
Secretary/Treasurer;Ken Bevis
Mike Franklin 416-878-0740 SoftwareCo-Ordinator;
Hardware Co-ordinator: Wayne Bowdish 416-388-7116Anthony Tekatch 416-957-7556
Editor:Hardware Production Fred Pluthero 416-389-4070,and Sales:Fred Pluthero 416-389-4070 Editorial Staff:
Publishing Committee:416-385-0798 Sharon SwindellsDennis Hildon
John Hanson 416-637-1076 Consultant:Bob Silcox 416-681-2848
Membership Co-ordinator:BernLe Murphy 416-845-1630 Draughtsman:
Don MacKenzi€ 416-676-9084 John Myszkowski 416-529-0250
ARTICLE SUBMISSIONS: •We can always use lots of software and hardware related articles of all types.Inasmuch as editing consists of taking the path of least resistance, 'cameraready' articles stand the best chance of getting in. Camera ready meanstyped, single spaced, reasonably error free and done with a dark ribbon.Diagrams should be large and clear (we can reduce them) and clearly labelled.Don't let camera ready scare you off. If you don't have access to a typewriter,by all means send in what you have, we still want to see what you've been up to.
Some important notes: First, please send us your original manuscript, nota photocopy. The quality of most photocopies is invariably poor and sucharticles get pushed to the back of the editorial 'stack'. Second, makesure your diagrams and programs are accurate. We have enough trouble witherrors on our part; there's no way we'll ever catch yours.
MEMBERSHIP RENEWALS:This is a bit pointless; if you got this issue, you're fully paid up. To helpyou keep track, a note designating the status of your subscription shouldappear on the mailing label of your issue. This will most probably takethe form of '2 of 6'.
US MEMBERS:We understand that a number of our US members are having trouble obtainingCanadian currency. Don't bother, send in your membership renewal (or orderfor DeFacto, hint, hInt) in US funds. This also applies to overseas members,if you can't come up with Canadian money easily eno~,by all means send •cheque or money order in US funds.
SEND ALL A.C.E. CORRESPONDENCE TO: Bernie Murphy,102 McCraney Street,OakvIlle, Ontario. L6H 1H6Canada.
EDITORIAL LISTING3
My last issue as editor. I have strived tn publish mAt~riAl for All nur
•members needs. It is somtimes diffiCUlt if you dn not have C' wi devariety of material.Material is needed for th8 beginner. Simple proarAms tn stimulateprogramming skills.Hecause of the mail strike I can not nAme the winnp.r nf the hastarticle in issue 23.The winner will be announced in the ()ctoher issue Fllnnq with t.hr>winner of best artical of the year.The reason for the latenes of issues 23 and 24 is Fllso the mail strike.lhfs editorial listing finishes the bulletin. Now I can get back to expexpanding my system at last.
All
EXECUTIVE FILE--------
the hest ..;.V~
•
•
Introducing the 1982 Executive.
Presiaents John NorrisVice President: Ken BevisSecretary: Toney HillTreasurer: Mike FranklinMembership: Bob Silcox
Ear 1 e. La yc oe kCommi tteeman at Large l . !;). RU99Seminar Leaders: Ken Bevis
Fred FeaverProgram Organizers: Bernie ./llurphy
Bert deKa tHardware R&D and Production: Ken 8evis
Don 1Aa eKen z i eFred PlutheroDave Bel or av e
Draughtsman: John MyszkowskiSoftware Co-Ordinator: Wyne BowdishProduct Distribution: Ec Leslie
IPSO FACTO STAFF---------Managing Editor: Mike Franklin
Technical Editors: Fred Feaverst eve Ca rterRob SiddellToney Hill
Advertising Manager: Fred Pluthero
Publishing Committee: Dennis MildenJohn Hanson
4 1f,-23~-856141 fl-277-249541f>-523-136841f;-87R-0740416-681-284841f:-823-1345
416-277-249541 (\-637-251341 6-845-163041 6-f;4 7-3Y 3141 fJ-2/7-24Y rj
416-6/{)-Y084416-38y-4070
41n-3R8-711f;41 fl-528-3222
41fl-878-0740
416-637-2513
416-523-7368
416-3R~-4070
41 ti-3R 1:)-07911416-fJ37-1076
4,I"
ADVERTISING POLICY------------Members my still e cve r t I s e their DArsnY")Al p.(/llipmr-'!nt r r ee ,
Advertisments for multiple items nf software. hardw2re. andcomponents will be clased AS cornme r c i e l and will hA charoed thecommercial rate.
•RATES
type of nub I i ca t i on ,circulation and$ 100.00$~)O. 00$25.00
Our rates are based on our1 Fu 11 page1/2 page1/4 page
Minimum of 1/4 page.All copy must be caera ready and be accompanied by a certified
cheque or money order. Ennyone requirinq more information may contactour Advertising manager.
FRED PLUTHERO
ERRATA IPSO NO. 20 page 44 ch anoe "0" ,A. 1 f r om d l-~.I\<J~) to 81 32f1O tomake. cassette routine work.
HELP •
SEND DUES NOW
We need the money
•
•••
••
1802 LOGIC ANALYZER
by Harley Shanko
INTRODUCTION
This hardware design provides the 'inforDation capture' section of a
simplified logic analyzer. The interface to the display forDatter (-your
1802 system) is via I/O ports; this provides a relatively simple interface.
Author's analyzer 'external interface' was designed for interface to 1802
based designs; however with an appropriate 'personality interface' adapter,
this design should be usable with other microprocessors or hardware logic.
HARDWARE
This design was built onto a (Vector, dual'22-pin edge connector) wire
wr-ap board which plugs into the ROM cartridge connector of a Studio II games
unit. Also contained On this board is a monitor (in Studio II language) in
EPROM, 1 K of RAM, and an audio cassette interface. The analyzer has been
used to bring up several designs, and has been a valuable tool for debugging
both hardware and sot'twar-e problems. By displaying the addresses of the
syst~n-under-test, the location of the imnroper operations, instructions, or
hardware can be determined relatively fast.
THEORY OF OPERATION
7
The functional diap,ram of the analyzer is illustrated in Fig. 1. The
interface adapter portion normalizes the inputs to the analyzer; thu~, for
an external interface to an 1802 system, required is a high-address latch,
with TPA as latch strobe, TPB for the analyzer CLOCK, and SCO and SC1 used
as instruction fetch QUAL[FIER.
Capture Mode - Initialization of the analyzer requires setting the
'trigger word' and 'arming' the control section. Then, when the input wor-d
matches the trigger word, the comparator outout allows the control block to
write 256 input words into the store RAn. T\'10 LEDs provide visual indication
of the analyzer's state. Once armed, the ARJ;I led is turned on. When the
input word matches the triGger word, the ARM led is extinguished and the
TRIGGER led turned on while the 256 input words are stored. The TRIGGER led
is then extinguished.
Display Mode - Readout of the captured words is now possible. Since the
display of 256 4-nybble values was not possible with the Studio II, only 15
.• words at one time could be read out, formatted and d i noLaved ; thUS, required
is readout 18 times to show all 256 words. Other conf'Lgur-at.Lcris capabI.e of
larger display capacities, eg: ADN-3 types, could possibly sh01l1 the entire
contents on screen.
8
'1\'10 1852 I/O port devices hold the tri,:''',er word ; ,tn ()\I'[' L1 lm-;truc;tion
lal.chcf; the hir.h-8 bi.t~, and an OUT :, the lOVJ-n ])1 Lu , ;,rrli n c , the control
s ect Ion is done via an OUT 6 instruction; thi~, reset" ';~hc c,tore W\Y.] "'·.:dross
counter, a 4040, and sets the Am..; f'Li.n-cf'Lop , t.ur-n i nr. on the Am.: Lerl and
enabling the comparator. I'our- 4-bit compar-at.or-s , 40C;~')-F,lil'child, 74CU~)
National, etc, AND the qualifier (le02 fetch == :=:CO and SCl both low, a
quarter of a 4001 NOR gate used as an active-low AND) enar.Lcs the control
scction. This' enable' when clocked, sets the "accurnu l.at.o ' flip-flop,
ACCm'l, and turns on the THIG led; subsequent c l ock s "fill keep the ARB f1io
flop reset and the ARM led ext.Lngui shed ,
vJith the ACCUM flio-flop set, tliO input CLOCK ')roc:llcCf~ 1-:Joth store HAl,;
, write' pulses and address counter c Locl: pu} s es ; ""he trail inp ec1;:;c advances
the counter. The rri.ne t.h stap;e of the counter, :,COUITU:, siernifies comul.ct Lon
of the 25G word storage, resets the ACCUN :Clin-i'lOD 3,:1(; t.er-m i.nat.cs the
capture phase. Via a 3-state gate, an ':'.OC)7, ACOUH1.E ,;ta'cuf, can be r-ead by
an INP 7 instruction by the display f'or-ma t t cr- for automa t i.o read/display
of the captured words.
ReadiNg of the stoC€ HA;·; is accomo l ished via a se:!iwncc of two im,ut,.
n:p 4 and HIP 5, instructions to transfer the 16-bi J, ' , ':!Ord~3 to the d i.spLuv
formatter; thus 512 bytes must be t.r-anaf'er-r-ed to read all 2:c,G wor-ds f'r-orn
the store 1\A].1. The separate data-in/dc.i.ta-out lines of' the ;,UI1 CimS RAj·iS
simplifies the hardware (16-bi t vride duri np 'iJri te, but L,-bit during rea ,,1 ) •
Durin,'. transfer of data, the address counter is advanced by use of an OUT 7
instruction after reading each 2 byte pair. f\ 1,'':,;:'3 &nd several 2-input f'ates
arc used to generate the I/O strobe/enable sirnals.
Interface - External. A 16 pin connector and rihhon cable has been
used for the 'system-under-test' Lnt.er-f'ace , Furthcr, by virinE in a GeT'3r~'d;t:
connector for the Studio II address, TPh/-B, SCO/-1 sianals, this hardware/
aoftwar-e design was easily madc operational by us i n« i ~:f'; own ,,;ir~n31s. Fi".;~
illustriJtes a generalL:cd 'personality' ,)danter s cc t t on , '~'hp b Locks can
r anrze f'r-om direct wired, to buffers with nv s tel'c~;is, to nrobe pods ',\;jt~; cable
drivers in the nods, and typic;::,ll-I includes variable ti1rc~,;lold &djustr:lent
control for those instances when non-TTL Or c:'m:; device,,> ar-c interfaced.
Block ill additionally may require latches, ..fith accououn in ,. s t r-obc , Block ~)
typically includes clock nCl>lari t:l selection control.::loc:: ;'::) r.:a:r ~')rovide one
or mor-e qua Lt fLer- inputs vrit.h control of nol.ar-i.t.y , and :')rov' '~ion to sw i t.c l;
i.n or out: the qualifiers. 'I'hi s anaLyz cr- providc:;:-~ the r:lin::.I~:-.:l l~:u;! Lrrt.or-f'ac c ,
by just latching t.h o mul.t.i.p Lcxoo ,lddrcr;G Li.nor: , and ;kr.odinr, the "\'Jt,c'\ I
state for the qualifier. 'l'PL ic~ usee' <1irecl:lv~l:-; the c Locl: •
•
•
•
•
•
•
SOFTWARE
The flowchart for control/disnlay of tile analyzer h: shown in Fig. 3.
Even though the author's system software was written in Sturlio II interpreter
Language , it is included; for those who have a Studio II or VIP (a very similar
Language ) the Studio II program is listed in Fip-. ~1: the subr-out ines are avail
able from the author.
The author's SystCE1 also has a monitor usinp: Studio II language: read, write,
execute; cassette save and load (Netronics format), plus LIFE game (Ben
Hutehinsen's version, with Cursor control for pattern entry) in machine
language.
flJOD IFICAT IONS
Several signals must be wired to the Studio II car-t.r-Ldge connector, as not
all of the 1802 signals were provided; HeAl boo-booed by only using a one sided
connector; the front side 'contacts' are only for equal nressure. 30 ,0UHge
wire wrap wire was carefully tack-soldered to the top of t~1C front contacts
for the added signals. The body of the connector is of thermosetting n12sticj
so care is required, or the contacts will become fixed if the body melts •
Several areas can be simplified. To reduce cost, one may use tog.f~le
switches in place of the 1852 I/O port devices for manual bit selection/
indicat(bDn; use of 3-position toggles can provide "ONE, ZERO, 'DON"T CAlmS""
selection. Or, if the ap~lication warrents, memory width can be reduced to 8
bits, which also would haJrve trip;ger 'Nord and comparator requirements.
Fancier directions; one could include ARIl and THIG s irme.Ls as status to the
80C~7 inputs, via software, video display could indicate those signals states
Ln English, along with qualifiers, clock polarity, etc. ~':ords CG.n be
formatted in binary, octal, hex, or via a disassembler, if additional BAl.} is
provided.
SillWIAHY
For those who design systems or are involved in bringinr: up much hardware
Or software this may be a very helpful tool. 'i'he author bas found this
hardware to be very useful. Hopefully others will find a use for this design.
Author recently has used it to acquire the viOrd/nhrase addresses of the TI
Speak"" Spell ROMs. ~This subject \'Till be reported on soon •
9
-=
1.,.,
_........ --- t- t~---i- ~ .
r"
-]I
I;
. t .•
1J\ ~P~~'t . yq)\~~ATTER\iUTa.l=J~(.E
, ..~. .... __, .l
-8
£'
z:'Ni:ITE:
T\MI~" 4CDM'jROL
"j J, . I . ~.
t
'--J:;.. i ' . C'" .. ,...
: _: " i.. (~OUIR' :-~~!
li P,'NiN \eo'Z. I
. ' . ~'I:S"fM) ; ,, .1
N-L\N' • II
\:: "S o -.: __, \ 1 L I
____J 1 . i T?A I B
I r- -';'1 \lDC, Of F· I, AR ~.~~- I (hernIa '(~ s: ,i~J'l~C!JWV ,-j h 00- "'.ETH usa)
IWO\LATDR5 ' U.. _,I , IB' '. 'R J .. D \D' I.• k_. .,....,.. r-,
-( ... !·.A RL'S
I I~1..-.-
; '5TOR~ .RA.-'
l,-,X, ZSC.WORP
CDMF
A-l?i~'\
j'
'meLI<--:. :>l
- l Ia >
I~OZ.\L ' It:-P~R~ONALTV: I'r\Ol>ULE
II . .
j ITR~[L w~~-_·I I (DU T_ l"Ol<'rl
I L-. II -.~I l---'-
i *W I ---"-"'-'~ .... .' T( I 2 L I ~(JALIFIE'R, !I --. .------.-.---------....-.-._._..._---\" II .
I ._. i
T./F
-"-t! --[,.. . 141!' AtliH? \-.. ..,.,.....,-.
i; 8~. ~A1LM .. ,
, i , tu.l I i ~..., I,' .... i I \
( :, I, i . 'J~ r-
, ; B. I
lr T1I . I ,"D/ , I
"
II(QM".\<~TORL-... 'A' .. ~
I ••-_._---
II1
i 'MU1.;"D.,
All"DF.
TPIlI"
TP"B
5[0,1.
E~7tlUJP.L,
:tW~A-Lk*i -
i.
F. ~ 1ST~ 'D \,0 .::rr: \:l ~"E.'D LCI(1 \ (. (:\.~~ t Y7.f;R r \..It.~eu. \Pr"[i . •
; .-+ - , •.•••_ .• __••
-t-
TO I A-'NAL VeE R.!
'-'-1"" --_....•--...... -
III
TWD"R~~ !
!
IIjj~-
I CLOC.'KI ~IIIj
IIIj,. . ··T----··; ...
I ~U~L\FIEllZ L -.
I-----t"j-__=_
II
-I
-I+ ---
~ II I
jI
- -"'1i _
r : I) I I
...I
fl5~ 'T'" -. •!
\lj. l~P\l,. , I
0 : UNEI , ... II r- -
&E I I.~- .".... 'r- .... . . ... f
I!
.......- ..j .i I
iI,... ... ~,._~.+. ".-.-•......~ ...,-~II
sec 5 CI Ir1&~):I) . ~: "I"I I
I
iiI
I
II
.' -... ~ .... ·,t,···.. .... :,' -- ..,.•.J.•.•. ~.'" 1'---'---------.~~4IBll#y+~,.....: -+;---1 ~ ,~
.J. _.,,,,....j.
.... !••
,-e
M01::) \J L E
12
•
MONOHpn
"C10TD •~~... M:DK ITO.i'
•
LO IHJ'TR\ (,/
'II{)un \ 'ARYl'
CDl\\\llDlr:>
TESi t=bR
K~"1 V:RESS
("0 K~"U)
ARMDAIS
MlrlNOA-IA
DlSYLA't YDA31...
RI2 A-D )}J (I S)
~~ WORD~7rOl{N\f4;
. ~ \)'~ l'LA\(
I
,"PLU~L~~
WP$U) '-.uP\=
5LMtl .. l'CaD.',
(C~LL 1"QiJ'b)j ,
LEF1 ~"\Fi~--f LO A-P Ilfi\JFFEK
Wrtlf~E:1{S I 'til.
FlG '3 ~ . ANAL Y"l.E.R Fl()W C\-\F\R '\
LOGIC ANALYZEH SOF'l'VJAHE
studio II Interpreter Lan~uaf'e
by Harley Sho.nl.::o
13
(Kbd 13,9)"
Ccmmon"en
Upd:=l.te address buffer
To Studio II 1:10nitor
If Display
For ''1'=' display
Show i,lode and Addresu
Scan Kbd's
Save Kbd
Jrnp ( is l<bd A)
Jmp ( is INPUT key)
Fix, make HEX +
" VB=Ol if )HEX F
Back to scan
Set trigger and arm analyzer
To [:lain
Select B Kbd
If Trig selected (Kbd B,7)
If Mon. selected (Khd B,5)
**Call
Operation
VB~V8
If VAfOO
If VB=OO
VO=F9
VO+V8~,>!-VO
If VBtOO ~rnp if not HEX
V8+09 Make Kbd B 1 thru 6 = A thru F
*Call
VA=OO
oJtJmp
*Jmp
*Jmp
*Jmp
~Jmp
~Jmp
*Call r·1L
Exit
Arm
Main
Newbuf
Getkb
Trig V3=OO
*Call
Label
22 1A1A
24 1400
C 601"9
OE 8084
10 3B1A
_-2 7809
14 2AB5
61~
18 Om.1A 6AOO
C D700-1E"D524
20 D932-
ADD/{ Instr--OAOO 6300
2 2i&r
04 2ill
6 9B81
8 3A14-A 4B18
•
'-I •
*-Authors psuedomnemonic for Studio II 'Do Subroutine' or 'Jump· •
**-Call to Monitor subroutine
ML-a subroutine written in machine language•
OA32 A9FF
4 02F2
6 6907
8 6309
A~
c 630C
3E 2M§.
40 630F
2 2A46
4 1~
Display A=09FF End of TV page
*Call m, Clear "V9=07 Use RAill nattern ihV3=09 Init Col 1 @ 0909
*Call Do column display
V3=OC Init Col 2
*Call Do Col. display
V3=OF Init Col 3
*Call Do Col Display
*"Jmp To bla i.n
14
dA46 6605 Column V6=05 Ilwords/column
'- 8 62D7 V2=D7 Store col. low address •I\ 3324 V~M(08V2) r:iove to RAl',) @address
4" OAD,Q, Acq *Call j,1L Get info from analyzer HAl;)'J
4E 2518 **Call Get input buffer,......-....;
SO 2A6E *Call and display it-2.62D7 V2c:'D7 Increment by i'30
4 9322 M(08V2)~V3
6 7330 V3+30
8 9324 V3~g(08V2)
A 76FF V6-01 Deer VG by 1
C 36$. If V6~00 Jr.1P
5E CO *Return
OA5F 6904 Pattern V9=04 Use HAt<! pattern #4
61 A9fF A=09FF Prepare to erase
3 02F2 *Call m, TV page-5 EO Erase '19 pattern
(; 2AAC *Call Convert non-HEX •-8 2~ *Call and show it
OAGA 6905 V9=05 Use RAl.: pattern /t~)
rv2914 **Call Get info\,
6E 6282 V2=82 Store pointer
70 2A8A *Call Do lIexpr- for hi-byte of address--2 7201 V2+01 Iner nointer
4 9541 V~V4 Transfer lO-by·tc
6 2fjaA *Call Do Hexpr- Lo-bvtc
8 EO nodified
9 6003 Studio II
13 6C06 Subroutine to
D 2ABO 'Convert n ShQl;l V9'"7F E4
80 E2
131 E2
82 E2.'- •83 E2
<1 707].
G 21\130 *Call Do Show I-lEi:
8 1384 *Jr;~p into interpreter Gut-routine
-
ON1A 9·l~n llcxnr V4+V3 ~~~~JVC byte in V"I
C ClOO4 VO=04 Set shift count to l-r
,~. ?,E 323(3 Shift V~i/2->V'3 1'0 rirht sh i f":
r,o 708E If VOfoo Jr:1]! until done
2 'n21.l V2-,)oI,l( OZW2 ) f::tor2 ms nybb lo
tl 7201 V2+01 Incr Tlointer
13 F4DG V4·:0F l,lr-:.:.sk and
8 9424 VL1->i\'1 ( OS\'2 ) Store 1s nyhble
II CO *Heturn
OAI\C 1\D10 Special A::= OD10 OiTset ['or non-hex cllar
.I\E 1AB2 Jmp around
01\];0 ABOO Hex 1\==0800 iIcx table entr,; addr-ess
2 13(38 *Jmp into SIJ: ' )lEi.ttcrr. convert' subr.
OABS 2514 BufLoad **Call (iet burfel'
7 21\CO ~·C3ll Shift/load buffer
'01 252') -l'<*Call Load buffer
~-.B 24D8 **Call Er-ns.c
D 1/\61\ *Jnr into subroutine
OI\CO 6004 Shi:ftLd VO==OL'. ::ct shift. ccunt to f\
') 844E 2*V.1~VLi 3hift hi,1 j, and
4 855f. ;::*V!)~V5 10vI b~ltes
C 8484 V4+VB+V5 Add car-rv bit
8 7OC2 If VofOO Jmp until done
1\ 8581 V5 /Vf3-?oV!') Add in nC'J nybblo
C CO *;:lcturn
•
15
LDA G; STXD j u»: C j 8TH 2 t'ord goes to stack
IMP 3jANI [01;81R C Save statlls, test
'arT;]' strobe j return
Output wor-d
Turn 18G1 off;outrut
•
and return
=c.ddress buffer
analyzer
EG=OSf8
Hcstore X=2
Get 2 by tes , step
acquire bit
Turn 1861 on; incr ])tr
=status buffer
i3et X=C
RC=OfJFA
Comnerrts
OUT ,S;OUT 4 DEe 2
INP 6;OUT G; DEC~ .'2
-lfl'lct
LI)I "i/F8: PLO C
HlP 1; Hre r'_.'
HIP 4; Ir..Jv. TriP ,~
1 \..t~, ,-'
OUT 7
~~EX 2
LDI+08;PHI C
LDI /,'1"1\; PLO C
SEX C
LDI ,:,'08 j PIlI C
13Z ACnX
:,inemonic
(arm)
'frig'/rd
ACQX
Label
Acquire
16ADDR OBJECT CODE
OADn F8 08 BC
3 Fe FA AC
fj EC
rr 6B 5C FA 01I
B 32 E3
D 69 1C
D17' 6C 60 6D
E2 67
3 E2
4 D4
OAE5 Fa 08 BC
D F8 F8 AC
B 4C 73 oc 52
EF' 65 64 22
F2 6E 66 22
5 D4
•
•
17
ClIAR
C D E II
FOI'·rr :.=
-l(.
*
***
Loor-u» table forFern' boLov
For /\.=OB18
P.DDH CODE
OB~;2 70" ,)r!,:) ../
4 205 276 20
2 3
6 7 For
A 1-3 A=O!;OO8 9
o 1
4 5
ADDR CODE
• 01300 3C 25 30 2A
I~. 20 2E 32 23
3 34 36 3A 49
OC 44 40 40 42
01310 52
ADDil CODE CHAR---0020 10 * 4
1 50 * '*2 50 * *3 70 *** 74 10 ..~5 20 * 16 20 *7 20 *8 20 *9 20 *A 7() *** 3n 10 *J')
f' 30 **,.'
D 10 *,., 70 *** 5
2F 40 *
• :30 70 *** 21 10 *a 70 *** 63 40 *4. 70 *** Br- 50 * *,)
r,' 70 *** 9u
7 50 * *r: 70 ***u
9 10 *A 70 *** Ai3 50 * *C 70 ,,~** 0D 50 * *E 50 * *
:)F 50 * *,10 70 ~** E
1 40 *2 70 *** F~~ 40 *
r;~: 7<2£41> *** Cit'
o 110 ••7 40 *S 70 ***J GO ** 13
• A 50 * *" 60 **1. 1
C 50 * *D GO ** DE 50 * *
Ill" ~)O * *50 50 * *
'I1 CO **
:rz I18
/ , :r I IARM 11<1(, LFtJEL0-0-0-
U:.UI ,-2 -'''3
-- - -- .-.... _... -- --.~ .- ..,. ,_. ...- -....I,,I
II,
•
•US5
\NT1 ~!
CDWVU~\ I
U3&
U'5\
16011 F
<..oNNU'l,
Uc2.
1852.
UZ.3
C.A';)S."D\~,
\-\D"U\~
,- - 1 t- - -, f - 1
I I' I I I
I I' I I :1-- - - 1- I c--
r - - -,-- - - - -- - -, - - 1 -,1- I I :L - - ..__.1 I I I
I I I
1- __ I
1~52 g~
U3~ ru~.,
",as T~oo, 'l.ll~
I~n.g~~
UIS
V\"!
SOC~1
I~~
u.,
"bZl
--•
fl~
L>IL>
SIDI 5101
V31. Ul.lO
'::1101 , ':1\0 I
U 45
US6
2.7\ (., 21l1l
tI
. ... J •R'E" ~ I,~8'
1~ AT"~ a:;,
_. Z. i\~--\-S-.- ..-.. ~-------.~;----,-,
U ZQ_..__a-3__~,.-'-i__-+--.,---.~-.---4-
:--~.....+_.~-_._~-~-~--~--, ,
--_..--_. -_._---_._...g.---*--..~--'-- .. _-+----_...;...----~
, , \ l)
---------------------.-:--__ --=. __~ ~_._l_._~_i-lI -. .t-...--~---- _~-4_.
_.- 1----
l60'Z. iA:LONN - U 't.1~lN_
-"'}- +--------...-........._--+A'l:•rz.
I:\-~~._._-_ ..
12
:YOY'Z.:\4
_-.S -).,_--l~_1_-r-....;..----.;.\...::!)_+--J...A.."'ll..\.l--- 1 1 -- -----+3---+------:.----' :_:s·
\tII -, ~ 5 Lt- "'j-'-- ---..IS-
15
, ,, -,... _----_.:_- ' ._~-+---- ....... -..,~ .._.; i
-------_ .. ~.'"--_-:.~--~~-_:--'_.....:.
! : I
- 1---:----:
1.n i .-r,r---.- -i-I
..,-_",; I ,. __ ...__.. _......
I
...__; .. _.i • --'--'-'-- ~--.--t-.--.--.f.
. . ,
--._., -----'1'-- ---;--i'-~---~~--"-'~---r---+-7
J_kAT'-B.._..
i, I.. . ..----. ... ----. -.- ..----.-~----.,....-.-+- --.-"7--.--+-.-.-----t---,..-....
-- .---~ .. _. '"~--.--~--- -"t'._--;---,--~- -__.__..<U.2a~ __._D_----...~..-..l----i-_._"_.-t----.-..,-_.---+_~-~---l,
,~ ~! i, .:"~~.--'r------:---;-.---1--'-r---r---;
1.-Hj.,Q·---t··-;--·----L----:-~-:1"5 ; .'.:! ::'
.-·~.,-·S·--I-...--.--..--'-..·--·-..+-a-.-·---1:·.--....;.---...-~:l-=~~t .•~.·~-·-.=---.~:J--_h.- .;! : : I: :::!
__ ._ .. .~. ._l__ ...;. __+- ..i..___-_:__-I_.__.-+\1 '!!' i
! , I-·-c--- ..·-.....-·..· ,._...--. -- ..--, -..- J----r----J..---....
I .I ! •
-_._- ...--'1"----._--t- ..-----*------- --_. ~- .. -_. __ .~.___i..... __,__._..._.~ ._..__• ---+--..-~
~ \' I, , 'I, I I'-.. -.. --~ .. ---i---T -- -t-·..- ,-- :--'--1"---;--;
._.._, ._; . _...~_ .. 1 ._.....;. .~_._-'-__~_.---;__....:.
.. r
GUAl... \ F'E1<'
-.;-. --0-i E'TLl:l-:::: ~eta-.. 5L-L-
, " !
t- -
.~_-+-~_.J.- -'---1-- .. -;~DH.z:..~
3:
II
T'PlSf-·· . --l;Z- -)
i':)~-ol \"3
I
St- I,
), 1'-1
\ i,.,
'j'
AD; \:0
IN •t 0,. ,..,,
"TfA : -·--~ft
..- ...~ ..-.. - ---~-.-2;~._._._-..-~-.~---+----,------------f
•
-- -.--.---...----~---.-_r
,. I.1-.. J +... ~....
,~.--- .-.-.- ..--------r
\"2 I
--S-C-i--'- t- -'---'j-
\II
j_._ .._.i .... L , •__ ..... _~_ ..__ .~ _
"Z j~:J_ ...
3 - ..-F~.L! '. -.,,0-~---l--:..:..;..........e,,~&7-..........+-----'-- -I
1"'£5) lOt i"T1~,
.- .,---- AEY_.;_l!2.MAR:.EUL __ ;._.__ ..~
-.--- -.-..... -- •• -_. - ... ---._. j .. - _.---'..21-A~-~~~o!......-J-I ::'
'S~.C.r\ I b ~ i
/Jr. \.
p; I 2i
1'-1 ..- ~A..,--;--·~- fl-.-.s\"3 ':7:LOi.__ ~.. _ _. __ ._ ' •.L.\
:~--T-PW.--- ~---------,--~.T;-PA; .~- ... t e
10 .-AO- ·----.. ,-4=1-
AI
.]: Z ij.~T
? __ ...~¥r:'_l./ .. -t..P.Nl-J·t:14Ii (I'aD'f)..--l:-S-·- ._..-_.-- -_. __ ..-......-.~.-
! '" U2-:).• I ,-u,
-Pt, .., "7
I::JWl)'if
_....
"--r---
,
• I,
I......_._._M._....._.._._._,~. ,._ ... :_. __...._.;._._~_~_._4.- .....~ __.... _
'"
10
.
,.
I
If .- _.
I
CJ
"
1-1IY
- ~_.
:I
~
1/
~VALI ~\E.R
1-..... "15- "b-- .....----_....._- ..r--~---L--"---4---...."__'i 1Y
.......--+----r-~--fI
,!
I,
JI
, I
...
; !
s~ \.L1. 3 ··ll~ :, '
Fl: 3-
IS+-\-._ ...l
tQ-1
~-
a~
It.!
2'0
.. -"-~-+--r----I, '
- -r-rr- ----,._. --_..~_._~_.-+-~--
, ,, j r
.~. ,-.--.-.",--, -- ----+-----4--+--II
---1'-
i
, 1..,..----~-.------r-~-, ..I 'i~ i
-'--'-~~-.-·';-1...~~11--'---
--~- .-:.,--- "1" "- .--'---.~,-,,-...:..--._..;._--'..._.-I . ,
I " , iii-·-t·-··-+---.c·-·- :--r---~
I " \ I.+-.-.-t ......:_-l--:-_-I-,_...L..-_--_.~~_._--_.+- _._~. ---~--t-----t-~. 'I'
, .ilH......-r--+··-····,·-,·-------,--,-/
... ~_ .._~-+-~..:,-. _..... __+_....i- ~--_--~-.-.-+-.+--' _
... -i---+-.----
~. -..------·-..~--i--~·---:=t : ,, -t . --1- -: --+- '-', ---+-._-,--
, !! I : ! ' J ,
-:·---~--;-; ..l--! -r--,-'-.-,----- .-- ..--+-----'--.--L-------~-_...J__+--__r_-
--- .---.-...--.-...----,-~+i--'---~-!---+---'--
Ie..
ID
11.1'
1'2:
10:
I (..
\0
----. l=1---·
Ii: ;.. -- ---.-.._.. --_"_"_'----+--1-. I ,'--"!\--,--
1 i j ; ;__~_......._. i .· . __ ..+- .._._....._
I: I,'--i--:---~---I-'-+j--+--
I
. " "-..--~- ... -----~ ...-.-~-I---._r_r-I! !
--~~-=T~~~.:~-l=----l--~--_~--! !
, " 1 ; ; :
. ·-···--·-------j,-......,-...PlKH--~---t--~-~-··--~·---.-·"-··-,--r---;----',:
........---._-.- ._-.....i---
, ..I
"l\.
_. __.,,_.>o .•.~_ ~ ..• ~., ".' •... _. _ •.. " .. _.~. •. _.
.-----.--".--.----.....---··l---..·-----·..··--~
, ..U_;l~,...
··-·-·-l~~~ir·--"-----~_·_·,._~_.-----+---r-+-..,..+
, 'RA-M~
,25J.A.K_LLB\I .. _._._---.,._..------~..;;;;.--~-,.-+--.--('~~,...----
&.I- 32 t''Z:1 IS -'fiJ-"l tCJZ;O --"- t"l
r-4--l..---J~4--I---L___Il_4___I___I_-1r__-+---I-__rl '&
Ie...
t--+--+---------.....~-+--, ...,......._,--..J..-..l-----I-.-, ,
\5-,,\1
G.
5
L\
9
a
; t, ; \13
I I "3I I i\~iii z
Ul
11\\ o
i
'" IJI
'f!
. f'r
\~. ' '.
I, i
,-
•-
IN '15• ,. lLf. t'-~
F3
no.II
··-tI. -1-
'II
'1
\15
", \~,10 ,1
R ey: U_7..lMA.L'lR~B.......I__+il Q ivaI!) <;(~l
: i.- ~._•.. ,,"·-._._··,_._,······K· ...... ,....~."._ ..,_. ,--'--... -+-----.-.l--.-.-..,.--~.--.--.-----.--
. I
,--._--.:.... .._--- .........._-..__......:..-..,._._--
'.
.'- !---+_._"'--...._-_ .._---..,---....- .._..
. ! l
_. __. __..l...__.._._..•i._....~TO~'kE:'R~M
.r···· .. ·l~····......· ......\ i..~L.\
Ai: tOMP
I Rl:JUC.' ....._ •. K .-r-----'_·-.·.·· ·~··-t··-
; UbINYUTc..iD(.K(::~) .•.
22
._--_.....~--,--
I. --_._-~_.._.- .._~.~ ..._----_.-
I
-.~.j;. '-1'-.~-'"t" I I 'rr._ ..' ..-.~....-.-.--l-,-.--.-.i
I
....-+-'--..1.:..,~.:_.,.-.. ~ .
--t··-'-·--t..K-~~-._ ..!.:_~~\1....MA..R.B.1.~: .
: ; ; 1
;. !~~~.e~.~'::"." L, _
-;---i-'~' + _ _-"-•.•"';'•. _--1- .
... -.---i--~.--.L-.- ..-.-,- -~---.-j :' !,:, ...+ .....i__ ._._~ ... _, __ .L~._ .._~,__
7
....•. - .. -...
fui,,'ti>
-,..__ .__ .._.,.....--.-------........._....--:- ..;.,.~~-_.. ~,.__ .. _._.._._-_._-----
i~__ ..... rr __...,. ....",••__.,-_..., ... _.J.. ..• ...~-.-~._-_
" \
-T~ IN -o---I--n;...:1\.7\".:.:':"-~.I'VI;;':';';~
. .1 '2.
......._,......;
\I
. '_rr -----..r ..
- Z'r--+¥'R ~'I---~
/.f
.A£.QU1RE;
:Me0 M'P ----+-........~·.N£;L~ . --+1-\;.
'utT.,,\0,,1
'-.'
".-..-.---.---.- .. '-.-.- .. ---~--.- ......~---.-- ...-.....-~ ..-----~t-- i , -~-., ' " "- -..•.-...,...--.. I '. : I : '. \ '.. ! . , Ii!-----··r-·--r--..--·r-·~,
j , \_. .4_.,•••·-J,,-.__ " __· _,
: I ,-+---t--~.-.
.. 'i,--
!
i '--"------.-------1'I '
. ,
'-~'i~'-:
_... _._..-t ··_---·t---_· ,-~ .--. '-~
_.._~--~--.--,
·'·'·-·l· .
... -1\-1.--
"--TU~-~
-'-~I ~ W '
;..........:.---. --·i _ ,-..-.-t--.-..--_.
,-- ,- '" "'" .-_ _.., ..---- :._-'--.......
.; ,I
--'--:--'''----j---'·-i---..----·-·-.:.--+--t--
-'--..----..L..-~.- ..r-.----;_.-~~-~-
. iJ-------I--.....--+ -~.....
I I
+--l----'!-_-1----- "'.• -- ---t·-·- l ... ---t·· --r..---t--.~i \ ~I, ;.-- ...._;- '-r-'---:--
\ I-f-.....,---"--f -t-' --..+-- +----:---t----,
I
---+_..:-_;.-.......-+---'---t--,
: ! : '
I-~ ·-r--"I--r--~·-·
• I I •: I . .
.. ,- ......-----c-- --'1--' .-..,-- i I ! •
iA-1iC$ ---tl -~ ..---W-,t--+--..,._....--'.. -- .... ,---.-t---+ ...-.,.--.L--l..+! l_~
I! ! lIt,, "I..-i-'-""" ... ~'-r----+--;-,
'0"--,..'--t \ D . , ' : i_.~-'-~--+ : I,,-~_._ .. _-~ _,-+--+-,~-;-.• ~ . f
2_
in'-r
HAl ..-+.\'5
-9-,
_...._"~
,/0
i".. ·t- "'r S' -'-"q-
,I
+-----i----t-.--.----." .... ---j...--i I :
---+----4:1-''''-;--1'-- ---t-----~o&-_tl-_+--;--
, ~ :.-- - "-- __--,.__._.._.__._~_+~-'----'4 .¥.,_._.__!_._~.,44_. ~------ I I I I
...~.~._ • : +V I- j------. '-":'-T'---~------i
,-._-'--'-_.'--_.'."'-'-_.~'--.-
,L ...-..,...~-...,...---t-..l- .-.....+ ......-
!-11--_.-..._.:.--{ ..L ---- ..,------+..-i-..,....-r-...---.t-...':---j-----t-... -_.+-+.-.-:-'
AW~ ; i...---_.....-"",_....",. __..+,_.~-...+.,--"- --;------.--
'DAIA,
n. '
U'i8
GIl"
A-{)BY
lATLI-L
\0
Jl
- ....-I ', '
-----+.+.
\IIr
i
Pi
-i l-I'7.Ii+3.!
·-ILt--
Ie;!)&-
i LIAle·'
"'4
; . ~1[. .+-,j;....- ~_---......~--..-.---.-.----.--...----... ----.-- .;..,-t---'--"- ,T .pt."1"A····..·--T'-';---:-' .....---.-.--.-~-- .. I
. i_+Y --'l-r----r' 2Lt
t·
. _.2-
l~:~
___ .1
'Z.' ,MRV.
\-\ : MWKi
--
I.-.... -_.._.._-......-_.'..-. --"'--
i-
10;II0-', ,.g.
1"1 ~'D Utii' '- -· ..- ..~--~--· ..-_tlOt1-..- -,---~
'tobtLOO~S-~·-.._-_·_-·~ ..
, __ NDT__ .
u~"O
, :
•• 4 ••• ",~••_.- ._._ .-__._J...__j_~__ ~_.".~--~-.--l.----r-
b
..... L-G--=1-
\U3..~-_. - - . _, __ -~_.,~ ,
.~(lC~,'.. _', ,_._.__._. -;_......_
~. "IOO .;.~ .... ...._._~_(.. ' 2 ! 3 .--e.-s-: _~ ~ _.---_. _...•-\-- -_._._--.--------'-----,""-- ---- :- '._--------~-_.-
~' 1-1 ' i·,2 ,... ---,.--.-.----..-..-.---- -..... ~~ -- ..-- .. -.-----...
-,\Z,.
.. -"1./0.
U[U:::1[P:R.. ---''1"----------- "-~'--"-
U\~
'-\~l\
\ '1l""--'----.......1\12.
tv\
NO
24
s '....::t~, Co r~:):\~~--~!·~~-~r~~~~~.·~;~~r --HOSI, __ . -------~..•-L.l
-..- '--:-'-r-~,;-~'I. :. --~. _. --··i-.-~··-J...-··--r----+_:
! ! j
- -- ...-.-.:----;---T----r
: ,.-,....• _ .._. L ..._.__...._ .... ,,--",--,-----;---,,+--'" ----+----t---i-.--+, ' i
I'-"--r--i~--'--
, i ' t··--'r---------r---,---r, I '
( -. SEL. lH. '
- SEL lq. --~, ..'- . , ....
E ,,Fe G. .."'C\':.~ OF"
F ,... ~INAL, SiATV5
.......__. _ .....,_ ... ..;.. c.. .......__._-'--__
.... \'R\Elo.Lq.·. ··,.__···_4 ··, ... ···+·.
KEc.:.\tT/~RM
':>TE~
. , 'I.. .._..__..EE.~ MA'1t S I
. , .3lT~~QJ ,
•
-.
DESIGN YOUR PROGRAMS TO RUN
AT ANY PAGE BOUNDRV
THIS FEATURE ALLOWS MUCH GREATER FLEXIBILITY IN INTERCHANGINGSOFTWARE WITH OTHER CLUB MEMBERS AT THE EXPENSE OF 1 - 2 r.ADDITIONAL MEMORY.
WHEN STANDARD CALL AND RETURN ( I.E. RCA VERSION WITH MINORVARIATIONS) OR THE LONG ~UMP IS USED A PROGRAM IS FIXED TO THISLOCATION UNTIL PAGE LOCATIONS ARE CHANGED. THIS SUGGESTION COREeTS THIS SHORT COMING, HOWEVER, YOU SELDOM GET SOMETHING FORNOTHING AND THERE IS A PRICE, BUT CERTAINLY NOT INSURMOUNTABLE.THE LISTED LONG ~UMPS MUST BE REPLACED EXCEPT WHERE THEY GOTO A ~UMP TABLE WHICH WILL BE DISCUSSED LATER.
LBR COLBZ C2LBNZ CALBDF C3LBNF CFLBQ ClLBNQ C9
THE STANDARD CALL ROUTINE WILL BE ENLARGED TO CONTAIN A ~UMP
FUNCTION ALSO, AND MUST SAVE AND RESTORE BOTH THE 0 ANDOF REGISTERS. THE ONLY DIFFICULTY MAY COME WHEN YOU WANT TO DOA LONG .JUMP USING OTHER THAN PROGRAM POINTER 3 AND X REGISTER 2
I BELIEVE THESE CONDITIONS CAN BE TOLERATED AS NO ADDITIONALREGISTERS WILL BE COMMITED AND THE FUNCTIONS I HAVE IDENTIFIEDAS RESTRICTED ARE VERY SELDOM USED.
METHOD--1. ALL PROGRAMS MUST BE WRITTEN AS IF THEY START AT MEMORY
PAGE 002. REGISTER INITIALIZATION MUST BE RELATIVE TO THE PRESENT
PROGRAM POINTER, I. E. GHI 3, ADI 02, PHI 7 SETS REG 72 PAGES FURTHER INTO THIS PROGRAM.
3. THE STANDARD CALL PROGRAM MUST RESIDE IN THE FIRST MEMORYPAGE OF THE PROGRAM.
4. WHEN PERFORMING A CALL TO A SUBROUTINE "SEP 4 PP XX" THECALL ROUTINE CONTAINS A CALCULATION TO ADD THE "PP" TO THEPAGE NUMBER OF THE CALL ROUTINE AS AN OFFSET. .
5. THE LONG ~UMP IS REPLACED BY "INC4 SEP4 PP XX". THE QINC4"MOVES REGISTER 4 SO THAT A DIFFERENT ROUTINE IS ENTERED,SIMILAR TO CALL BUT NO RETURN ADDRESS IS RETAINED.WHEN COMPLETED REG. 4 IS RETURNED TO ITS STARTING LOCATION.
25
FORMAT FOR REGISTER 4 (CALL AND ~UMP)
• 0020 BF PHI F STORE 021 E2 SEX 222 7E RSHL23 73 STXD SAVE OF ON STACK24 43 LOA 320:- 52 STR 2 WRITE INTO X.;.)
TYPICAL CODE FOR USE OF THIS FEATURE MIGHT APPEAR AS FOLLOWS:
26
....
262728292A2B2C202E2F
START) 3031333435363738393A3B3C3D3E3F404142
0:3 LON 3A3 PLO 394 GHI 4F4 ADDB3 PHI 360 IRXFO LOX76 RSHR9F GHI F03 SEP 3C8 LSKP30 20BF PHI FE2 SEX 286 GLO 673 STXD96 GHI 673 STXD83 GLO 3A6 PLO 693 GHI 3B6 PHI 67E RSHL73 STXD46 LOA 652 STR 246 LOA /:,30 27 BR
ADD CALL REGISTEROFFSET TO GET FINAL
JUMP PAGE
RESTOREOF
RESTORE 0
BRANCH TO ENTER LONG JUMP ROUTINESTORE D
STACK REG. 6 ANDTHEN COpy REO. 3INTO REG. /:,
SAVEOF
GET PAGE NUMBERAND WRITE INTO X
•
•PPOO D4 SEP 4
01 02 AA
03 D4 SEP 404 00 CF
06 1107 14 INC 408 04 SEP 409 02 20
CALL TO SUBROUTINESUBROUTINE LOCATED ON PAGE 02OF PROGRAMCALL TO SUBROUTINESUBROUTINE LOCATED ON FIRST PAGEOF PROGRAM
INLINE DATA USED BY PREVIOUS CALL
FOLLOWING "INC 4"THIS WILL PERFORMA LONG BRANCH TO PAGE 02 OF PROGRAM
WHERE A CONDITIONAL LONG BRANCH WAS REQUIRED, IT WOULD BEREPLACED WITH THE SHORT EQUIVELENT TO A ROUTINE SIMILAR TO PP07ABOVE.
A PROBLEM WITH THIS ARRANGEMENT IS WITH A JUMP TO ANOTHERPROGRAM. I. E. WHILE RUNNING AN EDITOR PROGRAM IT IS DESIRED TO
.,., GO TO THE MONITOR. BUT WHERE IS THE MONITOR IN THIS SYSTEM ?
THE ABOVE PROBLEM CAN BE REMEDIED BY STANDARDIZING A MEMORYPAGE FOR PROGRAM ACCESS " dUMP TABLE", AT THIS LOCATION ON EACHSYSTEM AN APPROPRIATE JUMP WOULD ACCESS THE STANDARD PROGRAMS.THIS WOULD ALLOW VARIATION BETWEEN SYSTEMS VET WOULD PROVIDE A •STANDARD ACCESS.
A SINGLE .JUMP PAGE, POSS IBLV II FE" WOULD BE EASY TO DECODE AND
•;. ~
-.
,t 1
•
WOULD PROVIDE 85 JUMPS. ITEMS IN THIS FILE WOULD BE THE SYSTE":KEYBOARD INPUT ROUTINE, THE OUTPUT ROUTINE (EITHER CRT OR TTY),A HARD COpy ROUTINE, MONITOR, ETC. THE STANDARD ADDRESS TO REACHKEYBOARD INPUT WOULD BE FEOO, TO REACH MONITdR WOULD BE FE09.ALL JUMPS SHOULD BE RETURNABLE USING A D3 (RETURN) INSTRUCTION.THIS MEANS THAT THE CALLING PROGRAM MUST USE A CALL TO A LONGJUMP TO FEXX.
THE MEMORY LOCATIONS I HAVE SUGGESTED ARE NOT YET FIRM. IWOULD LIKE SOME COMMENTS ON THIS PROPOSAL AND ANY IMPROVEMENTSTO THE PLAN BEFORE WE GET COMMITTED.
27
28
1802 CODE EDITOR DIRK JORENS315-645 SHELTER CREEK LANESAN BRUNO. CALIFORNIA. 94066
•WHILE I HAVE WRITTEN MANY PROGRAMS IN TINY BASIC, PILOT AND ASSEMBLER, MY
INTEREST ALWAYS RETURNS TO PROGRAMMING IN MACHINE CODE. AFTER GAINING SOMEFAMILIARITY WITH THE 1802 INSTRUCTION SET. IT BECAME OBVIOUS THAT NEITHER THENETRONICS ROM MONITOR NOR THE ELBFBUG SOFTWARE WERE ADEQUATE FOR SERIOUS MACHINECODE PROGRAMMING. HENCE THE DEVELOPMENT OF MY 1802 CODE EDITOR. THE EDITOR USESALMOST 2K OF CORE. SO I WAS NOT UP TO THE TASK OF WRITING UP A COMPLETEANNOTATED VERSION FOR THIS PUBLICATION. HOWEVER IF YOU FIND THE DESCRIPTIONINTRIGUING AtID YOU HAVE USE FOR SUCH A PIECE OF SOFTWARE, SEND ME A SELF"ADDRESSED ENVELOPE AND I WILL SEND YOU A PRINTED HEX DUMP. BETTER YET, IF YOUSEND ME A BLANK TAPE I WILL PUT A COpy ON EACH SIDES AND RETURN IT TO YOU. I AMNOT IN THE SOFTWARE BUSINESS SO THE PRODUCT IS FREE, BUT IF YOU DON'T INCLUDERETURN POSTAGE, I WILL CONSIDER THE TAPE AS A GIFT.
HARDWARE CONSIDERATIONS
THE EDITOR WAS DEVELOPED FOR THE ELF II WITH GIANT BOARD AND ASCII KEYBOARDWITH VIDEO DISPLAY. THIS MEANS THAT THE EDITOR RESPONDS TO 1/0 THROUGH AN RS-232SERIAL PORT. THE EDITOR CANNOT BE USED WITH PARALLEL 1/0 UNLESS MODIFICATIONSARE MADE TO THE 1/0 SUBROUTINES. THE EDITOR'S PRESENT SIZE IS 1 3/4 K (7 PAGES)AND IT IS COMPLETELY RELOCATABLE. NO ADD~TIONAL STORAGE IS REQUIRED.
INPUT CONVENTIONS
THE INPUT BUFFER IS 11 BYTES IN LENGTH. GENERAL INPUT FORMAT IS 'X 9999 9999'WHERE X REPRESENTS A COMMAND AND 9999 REPRESENTS AMOUNTS OR ADDRESSES (ALWAYS INHEXADECIMAL). DEVIATION FROM VALID COMMANDS, INCORRECT SYNTAX OR NON HEXADECIMALINPUT WILL PRINT 'ERRORI'. NO ATTEMPT IS MADE TO ANALYZE THE ERROR SINCE IN ALLCASES IT IS OBVIOUS FROM EXAMINATION OF THE INPUT STRING. IF THE FULL 11CHARACTERS ARE INPUT IE.G. TAPE LOAD COMMAND), THEN AN AUTOMATIC CARRIAGE RETURNOCCURS. WHEN LESS THAN 11 CHARACTERS ARE ENTERED, THE 'RETURN' KEY MUST BEPRESSED. KEYING ERRORS MAY BE ERASED BY USE OF THE KEYBOARD'S 'DELETE' KEY.
COMMANDS
THE EDITOR RECOGNIZES 16 VALID COMMANDS. SOME ARE USED IN ONLY ONE FORM WHILEOTHERS HAVE OPTIONS TO THEIR USE. AFTER INITIAL LOAD, THE INTERNAL MEMORYPOINTER IS INITIALIZED AT LOCATION 0000. AFTER A COMMAND IS EXECUTED THE MEMORYPOINTER IS USUALLY LEFT POINTING AT THE LAST PROCESSED LOCATION. THE INPUTSPECIFICATION SYNTAX USES '_' TO INDICATE A SPACE. BRACKETS ( ) ARE USED TODEFINE OPTIONAL INPUT. BRACKETS IN THE OUTPUT SPECIFICATION SHOW OPTIONALOUTPUT. THE EDITOR'S PROMPT SYMBOL IS ,>, •
•
•
P (PRINT)
N (NEXT)
•
•
INPUT : P(_XXXX)OUTPUT: AAAA BB(DD CC FF CC EE)
(AAAA BB CC DO •...•••. )>
USED TO DISPLAY THE CONTENTS OF THE CURRENT MEMORY LOCATION. IN THE SIMPLEFORM. OUTPUT CONSISTS OF THE CURRENT MEMORY ADDRESS (MM) FOLLOWED BY THECOl~TENTS OF THE LOCATION. THE COMMAND MAY BE FOLLOWED BY ONE TO FOUR HEX DIGITSTO INDICATE THE NUMBER OF SUCCESSIVE LOCATIONS TO PRINT. IF THIS OPTION IS USED.UP TO SIX LOCATIONS WILL BE PRINTED ON EACH LINE. EACH t~Elo! LINE BEGINS WITH THENEXT ADDRESS TO BE PRINTED.
INPUT: N(_XXXX)OUTPUT: AAAA BB
(AAAA CC)(AAAA DO)>
USED TO DISPLAY THE CONTENTS OF THE NEXT MEMORY LOCATION. IN THE SIMPLE FORM.OUTPUT CONSISTS OF THE NEXT MEtlORY ADDRESS (AAAA). FOLLOWED BY THE CONTENTS OFTHE LOCATION. THE COtmAND MAY BE FOLLOWED BY BY ONE TO FOUR HEX DIGITS TOItroICATE THE NUMBER OF SUCCESSIVE LOCATIONS TO PRINT. IF THIS OPTION IS USED ONELINE IS USED TO PRINT EACH SUCCESSIVE LOCATION.
29
U (UP) INPUT: U(_XXXX)OUTPUT: AAAA BB
>USED TO MOVE THE INTERNAL MEMORY POINTER TOWARDS LOCATION 0000. IN THE SItlPLEFORM THE POINTER IS MOVED UP ONE LOCATION THE COMtlAt;o MAY BE FOlLOI-lED BY ONETO FOUR HEX DIGITS TO INDICATE THE NUMBER OF LOCATIONS TO MOVE THE POINTER. INBOTH CASES, AFTER THE OPERATION IS PERFORMED THE CURRENT LOCATION ADDRESS ISPRINTED FOLLOWED BY THE LOCATION VALUE.
o (DOWN) INPUT : D(_XXXX)OUTPUT: AAAA BB
>USED TO MOVE THE INTERNAL MEtlORY POINTER lO~~ARDS LOCATION FFFF. OPERATES IN AFASHION SIMILAR TO THE 'UP' COMMAND.
>
USED TO REPEAT THE PREVIOUS COMMAND. MAY ONLY BE USED WITH COf1tlANDS 'UP','DOWN'. 'PRINT'. AND 'NEXT'.•A (AGAIN) INPUT: A
OUTPUT: RESULT OF PREVIOUS Cor-IIHNO
30
•E (EXECUTE) INPUT: E XXXX----------- OUTPUT: NONE
USED TO INITIATE A PROGRAM. THE FOUR DIGIT ADDRESS FOLLOWING THE COMMAND ISPLACED IN REGISTER 0 AND REGISTER 0 BECOMES THE PROGRAM COUNTER.
C (CHANGEI INPUT: C_DD
---------- OUTPUT: AAAA DO>
USED TO CHANGE THE CONTENTS OF THE CURRENT MEMORY LOCATION. OUTPUT SHOWS THECURRENT LOCATION ADDRESS AND ITS NEW VALUE.
•INPUT : IOUTPUT: AAAA:
I (INPUTI
J (JUMPI IIlPUT : J_XXXXOUTPUT: AAAA DO
>USED TO MOVE THE INTERNAL MEMORY POINTER TO A SPECIFIC ADDRESS. THE COMMANDMUST BE FOLLOWED BY ONE TO FOUR HEX DIGITS TO SPECIFY THE NEW ADDRESS. OUTPUTSHOWS THE NEW CURRENT LOCATION AND ITS VALUE.
USED TO FEED CONTINUOUS CONSECUTIVE VALUES INTO MEMORY ST~RTING AT THE NEXTMEMORY LOCATION. THE NEW VALUE AND CARRIAGE RETURN ARE ENTERED ~FTER THE 'AAAA:'PROtlPT. THE EDITOR WILL THEN PRINT THE NEXT LOCATION ADDRESS TO PROMPT FOR THENEXT VALUE. WHEN DONE, COMPLETION IS SIGNALLED BY AN IMMEDIATE CARRIAGE RETURN.THE INTERNAL MEMORY POINTER IS LEFT POSITIONED AT THE LAST UPDATED ADDRESS.
M (MONITORI INPUT: M----------- OUTPUT: NONE
USED TO RETURN CONTROL TO THE ROM SYSTEM MONITOR.
R (REGISTERI INPUT: R------------ OUTPUT:R(OI=AAAA
R(21=CCCCR13 I=EEEE
RIl I=BBBBR(31=DDDD
>
USED TO DISPLAY THE CONTENTS OF THE 1802'S REGISTERS. THIS COMMAND IS USEDIMtlEDIATELY AFTER ENTRY TO THE EDITOR. REGISTERS 3 AND F ARE DESTROYED IN THEPROCESS OF SAVING THE REGISTERS. THEIR DISPLAYED VALUES DO NOT REFLECT THE VALUEON ENTRY TO THE EDITOR. •
•L (LOAD) INPUT : L_BBBB_EEEE
OUTPUT: >
31
USED TO LOAD FILES FROM TAPE. BBBB IS THE BEGINNING ADDRESS AND EEEE IS THEENDING ADDRESS. THE COMMAND BEHAVES IN A FASHION SIMILAR TO THE NETRONICS ROMMONITOR TAPE LOAD COMMAND. WHEN THE DATA IS LOADED THE EDITOR ISSUES A PROMPT.
S (SAVE) INPUT : S_BBBB_EEEEOUTPUT: >
•
USED TO SAVE FILES ON TAPE. BBBB IS THE BEGINNING ADDRESS AND EEEE IS THEENDING ADDRESS. THE COMMAND BEHAVES IN A FASHION SIMILAR TO THE NETRONICS ROMMONITOR TAPE SAVE COMMAND WITH ONE MAJOR EXCEPTION. WHEN THE ROM MONITOR SAVESON TAPE, THE Q OUTPUT REMAINS CONNECTED TO THE VID CAUSING A WILD AND SOMETIMESENTERTAINING DISPLAY OF JIBBERISH ON THE SCREEN. THE EDITOR ON THE OTHER HANDFIRST DISCONNECTS THE Q LINE FROM THE VID AND THEN TRANSMITS TO THE TAPE. THISIS DONE BY ISSUING A COMMAND THROUGH THE GIANT BOARD PARRALLEL OUTPUT PORT. THESIGNAL IS DETECTED AT THE PORT BY A SMALL RELAY WHICH DISCONNECTS THE Q LINEFROM THE VID UNTIL THE TAPE TRANSMISSION IS COMPLETED. THE HARDWARE MODIFICATIONTO THE GIANT BOARD IS OPTIONAL. DETAILS WILL BE SUPPLIED ON REQUEST •
T (TRANSFER) INPUT: T_BBBB_EEEE
------------ OUTPUT: START:>
USED TO MOVE BLOCKS OF DATA FROM ONE AREA OF MEMORY TO ANOTHER. BBBB AND EEEESPECIFY THE BEGINNING AND ENDING ADDRESSES OF THE MEMORY TO BE MDVED (NONDESTRUCTIVE MOVE). THE EDITOR WILL REPLY WITH 'START:' , AT WHICH POI~ ONEENTERS THE FULL FOUR DIGITS ADDRESS OF THE FIRST DESTINATION LOCATION. THEEDITOR WILL PRINT A PRDMPT WHEN THE OPERATION IS COMPLETED.
F (FIND) INPUT: F_ABCD(CDEF)OUTPUT: AAAA AB CD(CD EF)
AAAA AB CD(CD EF)
>USED TO LOCATE ALL OCCURENCES OF A FOUR OR EIGHT CHARACTER STRING IN MEMORY
BE"TWEEN 0000 AtID EFFF. THE BEGINNING ADDRESS OF EACH OCCURENCE AND THE FOLLOWINGCOINCIDENT BYTES ARE PRINTED. THE INTERNAL MEMORY POINTER IS LEFT POSITIONED ATFFOO. THE EDITOR PRINTS A PROMPT WHEN THE OPERATION IS COMPLETED.
USED TO VERIFY THAT MEMORY IS WORKING CORRECTLY. BBBB IS THE BEGINNING ADDRESSAt~D EEEE IS THE ENDING ADDRESS. FOR EACH SPECIFIED MEMORY LOCATION, THE MONITORWILL FIRST WRITE IN "FF' FOLLOWED BY A READ TO VERIFY ?'FF', THEN WRITE '00'FOLLOWED BY A READ TO VERIFY '00'. THIS EXERCISES EACH BIT IN THE SPECIFIEDADDRESS RANGE. A BY-PRODUCT IS THAT THE VERIFIED MEMORY IS INITIALIZED TO ZEROS.
•V (VERIFY) INPUT : V_BBBB_EEEE
OUTPUT: >
32
ODDS and ENDSMalcolm Coyne
Over the last few years I have had call to designlots of little circuits to fulfil a variety of simplelittle jobs. Here are three that some of you may finduseful also.
Software Interrupt:
Ever have call for a software interrupt, say togenerate break points in a program being debugged. Thiscircuit, when it is enabled, allows the generation ofinterupts in response to the SEQ (7B) instruction. Itshould be noted that this limits the use of the Q line forother purposes, uses up one output port and also ties downthe interrupt line.
Circuit operation is relatively simple - see Fig 1.The 8 channel analog switch (U3) is used to decode theN-lines and generate a strobe pulse to clock the B side ofthe 4013 dual D~type flip flop(Ul). The B F/F is set upso that it will be reset along with the processor. It isused to store the most significant data bit (other bitscould be used) in response to the OUT 7 output instruction(other port location could be used). This data bit isused as the data input for the A side of the F/F. If thedata bit is high and the Q line goes high then the outputof the A F/F will go high turning the transistor on andtaking the interrupt line low ie. generating an interruptrequest. (The transistor is configured as open collectorto allow the use of the interrupt line by other devices.)When the processor goes into the interrupt service modethe SCI line goes high and the A F/F is reset. Thecircuit is then ready again to respond to the next rise ofthe Q line. (The circuit only respond to the low to hightransition of Q.)
Tone Generator:
This is actually a circuit adapted from PopularElectronics and was designed to allow the selection of oneof fifteen tones. The tones are generated by theoscillator formed by the 4049 (U6) and the frequency iscontrolled by changing the feedback resistor. Theresistor values are detemined experimentally by placing apotentiometer in the place of the resistor and adjustingit to give the desired tone, the measured resistance isthen the one to be used. The 4051's (U4 and U5) 8 channelanalog switches allow the selection of a single resistorin response to a four bit word output to the port formedby the 4042 quad latch. The latch is strobed using thesame circuit as for the interrupt generator previouslydescribed. One of the sixteen possible channels is leftopen to allow for an off position. The resistors arelabel accordinq to the hex digit that will select them.
•
•
•
C.l.tj
Il1/i
~ 21J3'fo4
PiG. 1 'sPEC! A-L rAT/OAf
O$C/~LA-r()l?
SCI
])7
BVFpeR
4049
Poj}(
))2
])3
I ~~ () tl1J
RF6ef>8AC-K
LEJ)
~,.
TOL.-+SP8IrK£R
-'-'-'-'-'-'-'-'~'~'~'T -31=-::" I
COM 7· I} 4J
~ AMRD 6 I!JH I If) 't(3 ,TP13 '3 COM 9 US S s:
I cNO (I A U3 · 40SI 4 I
INJ 10 B 4051 · , /z
I ]N/-# '3Nt 'I c · IS"
jZ
I)UTPVT f1ot(r I IIII I
S6LecT I 0 I o,pI 0
:::i
t&N& 4&";V&~ATOR
ww
oil+- -v-(".)
".
I II I
c.~cc
,e(.
; {~ f
I I[L!fl/5
~ I 14
COMMOIV CIfTHOD& LG'])])ISPLAYS
~~b 112.
c~d~(2' q
~/Vb
(6
93(,B
I . r6f:3LE
--..-, 1/4
/&
~ ~ 7 A~
})z II / III40/ J ])3 12 2. A-z..
])1 13 6 11 3
GND~I<. A !(~
Dc 6 AI
])1 4 A2
lh "2 113
D IS A~ 4-
D4 7 6,
~- s: 135 2
Db 3 B3D7 t 8
4
Dfl-TA LINE TOBE PISPl-.I1Y£D
~.v3~041-.-
~ 12"2J !E3904
--L-.--1.-
~ ~ ~I I'
404') (a. ~ f)0>0::4
I
i le:t
FIG.2 HEX LED P/sPLAY
• • •
•
•
Hex LED Display:
After spending many months decoding the binarydisplay of the TEC 1802 CPU board in my head I decidedthere must be a better way. As a result I replace thedisplay with a seven segment one. Since hex decoder chipsare relatively hard to find and expensive I designed asimple multiplexer to give two digit r.eadout from eightlines input.
In my circuit - Fig 2 - I used the 9368 TTL decoderbut it should be possible to use the 4495 CMOS decoder inits place although it has a different pin out. The 4049hex inverter forms a multiplexing clock and the 4019 dataselector selects alternately from the upper and lower fourbits of the input and routes them to the decoder. Thetransistors act as switches to turn the appropriatedisplay on. It should be noted that the data lines arenot latched by this circuit and if used as an output portlatches _w.!Jl__ have to be added.
514 Platts LaneLondon, OntarioN6G lJ2
Hex to Decimal Conversion
Anyone who has tried doing hex to decimal conversions intheir heads probably found it a difficult, if not erroneouschore. The following program saves on mental fatigue and paperwork for converting any two digit hexidecimal number to decimal,and could be used as a subroutine in a larger program. Theprogram could begin on any convenient page.
To use the program, key in a two digit number in hex. Thecomputer echoes your number while the INPUT key is depressed.When released, the hundreds digit is displayed. Press again,and the tens and ones digit are displayed. The computer is nowready for the next number.
35
•
(Note: MA XX3C-XX3E are used by the program.)
MA BYTE SEQUENCEXXOO . F8 3D AE F8 3E At 90 BE
08 • BF F8 00 ;E SF 2E SE EF10 • 3F 10 6C 64 2F 37 15 F818 • 64 F5 3B 23 SF OE Fe 0120 . 5E 30 17 1E F8 OA F5 3B28 .30 5F OE FC 10 SE 30 2l~
30 • EE OF F4 73 64 3F 35 6438 • 37 38 30 00
David RuskeR2 Box 250Waupun, WI 539632/9181
36
Ken ManteiCal State CollegeSan Bernardino, CA 9?40!4 May 1981
XOR TESTING
When one wishes to test a byte to see if it is one of several special bytes, ~the most economical way is to put the original byte in the accumulator and XORtest the accumulator with a succession of immediate bytes. This is called XRI in1802 assembly language. The purpose of this article is to explain how to do this,and how to decipher such routines.
First review the crude, but clear, methods of testing a byte: I) pointed toby the X register, or II) in a register, say R9.0. In each' case let us test to seeif the original byte is 3C, 1B, 7F, or OC. Whenever a match is found, a conditionalbranch will be made to different locations, signified by XX, each of which is designedto deal with one case of the original byte.
Method I Method II Method III
lOI #3C GlO R9 lOX or GlO R9XOR XRI #3C XRI #3CBZ XX BZ XX BZ XXlOI #lB GlO R9 XRI #27XOR XRI #lB BZ XXBZ XX BZ XX XRI #64lOI #7F GlO R9 BZ XXXOR XRI #7F XRI #73BZ XX BZ XX BZ XXlOI HOC GlO R9XOR XRI HOCBZ XX BZ XX ~
The fancy Method III does the same job as I or II. Method III is shorter and faster,but how does a programmer decide to use the 3C, 27, 64, 73 sequence of test bytes?
The economy of Method III is achieved by using whatever is left in the accumulatorafter each XRI. Remember that an original byte is regenerated whenever it is XORedtwice with any arbitrary byte. After the first test using 3C, the original byte couldbe regenerated by a second XRI #3C. Then the second test, for lB, could be made usingXRI #lB. In Method III these last two steps are combined by testing with 27, since1B.XOR.3C=27! So in Method III, after the first test, each following test byte isderived by XORing the current byte tested for with the most recent byte tested for.To test for 7F, after testing for 1B, one uses 7F.XOR.1B=64. Then, since a test for7F has just been made, the next test, for OC, uses OC.XOR.7F=73. The original bytec~n be recovered after testing by a final XRI, with OC in this example.
Finally, how can one figure out what bytes are being tested for from an XRIsequence such as that shown in III? The first is obviously 3C. The rest are foundby XORing the current test byte with the last byte tested for. The second test byteis 27, the previous byte tested for was 3C, so the 27 must be testing for 27.XOR.3f=lB.The third test byte is 64, the second byte tested for was 1B, so the 64 tests for64.XOR.1B=7F.
To Write a Program: T = B .XOR. Bn 1n n -
fO Interpret a Program: Bn = Tn .XOR, Bn_ 1
where Tn is current test byteBn is current byte tested for •Bn_ l is most recent byte tested, for
VIDEO INTERFACE FOR THE MC6847 VIDEO CONTROLLER
~The circuit in FIG. 1 is a video amp. t am using to interface theMC6847 Video display generatorto the Monitor 1 purchest fromSeietronics (120n S. Napa St. Philadelphia PA. 19146~.As shown the output of the MC6847 must be inverted, amplified, andcentered relative to ground. Some experimenting with the cOntrolswill soon find the best display, but the lower the gain the betterthe heme width.I am using G. E. Miller's 16 X 32 software to dr I ve the moni tor andhave t ounovorie bug in it change location 8351 to 03 to enable eraseto eno of ~creen.
Ref. IPSO No. R rage 10
Tom Jones 8 Forest Park Apts. Enterprise Alabama 36301
/'''.'- ~~~.::..:..-:- .......-wrs,-----
~
..--CENTRONICS printre interface
----'---;,0'..._--I ...!
jl
\., .
~
About 6 months ago i bought a dot matrix printer to use with my homebrew Co smac , After shopping around, I des'ided to go for a Centronics'~':f7!<-/30. One of the requirments, besides readable print, was ease ofrepair. The 130 qualified in both.The next step was hooking it up to the 1802. Since I wanted to be able,t.o i us e a fairly long printer cable, I used a 74 LS373 buffer as a ,.-,-. :.~.,>-,
'driver. The 1852 met the timing requirments but it reauireds 8 dataeand 1 strohe huffer.I die have a little head start, since my I/O board had a 74LS123one shot which was needed to generate a lms. strobe for the Xitex CRTboare.The construction is straight forward. The one shot is pretty sensitiveto ripplein thpoower supply voltage, so to avoid any false triggeringput a filter capacitor close to the 5V takoff point.The oiagrams show the system that has been in use for several monthswithout any (known) prohlems.~f you happen to have given yourself a printer , this my help you.For those who want to be a little more Computer like, there is a 5Vs i..an~ 1 ava i LabI e on the Centron i cs edge conn. whi df".can be ti ed to astatus port to tell you "Your printer is on SIR"
Gooe luck
C.tl. Vlaun Hox 25039 I\",;::,li Bahrain
38
•
1( I ::: 331<
t?;z.::: 10K
~~ = J;{0,"'" N914
•
c~ ::: lliCT (~l T / , A-L..
lJM/1-J6 ReQ.u/f(6¥t6-Nf
ceNTRO""LC.~ (30 Ca.VlII/. c>+:h~rs)
::: 7t+LS 373
74LS I~ 3
!R2 ~EF'x a ~ <:J n~'f
5V0
Do .3 2 »'04 5
B"1~121 12-14- /517 If)
~7 18 , D7II 2J) t I
rc I
~I!j
Il-II
i
\l-1
j
I
rI
TITLE S.O. NO. w.o. NO. MO. 0"
MATERIAL DRAWN BY DATE K TCH SHEETIAPCO 3033 (417?>c••• II..... '
BASEBALL 39
6400;260 E;25BC;FO 55;80 EO;80A5;A6E9;A675;A6EA;25DC;50EO;00 EO,;25F6;6300;D433;6300;25E6;642C;3440;A66D;4FOO;C203;1362;D431;6802;78FF;13B8;25E6;6BOO;7D01;
630B25DO1232FOSSA6E96009630725D21298260EF06522D26426D433640CA6542608631274016800134484043314730115B4D43135007BO I13C625EE
A69825DAEOAI600022B67AO I260E63143A09A675A6E96900260A641C631D12F46422A618D43125F425BC80 I 4D4318020E8Al25C625A425E637006312
670A12106002A6E9A6E9128AA6701278128825DOFOSS8EO 064 I 1D433A6693320630625EA6421260A134EC I 0 I25C66500680115B445016306259625EA
6DOO34401232oOEO25DC400225D2300222C2126480EOF065A6226400D4317301A640260A63186422E8A 1COOlD4318404139AE8AI137A13F425E66C 0 0
6C 0 0F71 EEOA 1F055260EF0656300F065A6EA4FO 0A6EA12408 EO0630E630DD43125E26426A669631BD43125C47301801435006803331F4412670725EA
6BOO7408600 IA6E8A670A6E81240A6E8631B8EO 522B67AO 1F065A66DD43364202608630C25EEA622640ED4318020C 10 I143E15B425A413F4133C630C
j)y GILBE?T BERTRAND
BASEBALL I S A GAt1E FOP ALL mOSE lNHO E\JJOYED PLAYING• "GALA~ PATROL" WHICH WAS PUBLISHED IN rx z RCA COSMAC GAME
MA'\lTTAL II. TO PLAY BA5EBALL" FIRST E'JTER mE CHIP-8FNTFPPPETER A'\ID THE"J E'\ITER THE GAME LI STING STARTL\JG ATADDPE5S 0200H TO 06FFH. I T CAN BE PLAYED BY ONE OR TWOPLAvEPS. THE GAME STARTS BY THE COMPUTER ASKING YOU TO~FLEC: HOTJ! HA'\JY PLAYER~ WILL BE PLAYPJG. IT WILL DO THATBY FLASH PI G A QUESTIO'\l t1ARK A\JD WAI TI \] G FOR YOU TO PRESSKEY 1 O? 2.'T'HF GAME I s PLAYED IN THE FOLLOWI'\JG MA:\I:\JE&
KEY 0 - TELL~ THE PI TCHER TO THROW A BALL.K F'" 1 - WI LL s WI'\IG A FA ST BA T.KEY 2 - WILL SWPJG A MODERATE BAT.KFY 3 - WILL SWI'\lG A SLOW BAT. (EASY>
"'HE :'1 TCHEP CA'\I SEND 36 COMBINATI 0\1 S OF SPEED AND CURVEBALL~. THE OBJECT OF THE GAME I S TO GET AS MANY RUNS IN ASPO~5IFLE. TIlE GAME E'\JDS AFTER 9 IN:\JINGs" U:\JLESS THE SCOREI S TI ED.
I ALSO P~OGRAMMED A COLOUR t'ERSlmJ OF BASEBALL" ALONGvr TH "'wo OTHEP HITERESTING GAMES AL SO I:\J COLOUR. IF AtJYONE01J'J~ A np lJITH THE COLOUR BOARD OPTImJ AND WOULD LIKE COPIESOF THESE ALO'\lG WITH DOCtMENTATIO"J" JUST GET IN CONTACT WITHME" ALO'\lG IN'ITH 10 DOLLARS TO COVER MATERIAL AND POSTAGE.
THESE GAMES WILL RUN WITH rnz CHIP-8X INTERPRETER AND~H LL ~Tl1\J O'\l A BLACK A"JD WH I TE TV SET WI THOUT MODI FI CATIONA"JD WI THOUT TH E COL OUR BOARD OPTIO:\l. HAVE Ftr.'J !!
• > ?020 0 ?047F0200 6AO 10210 D43A0220 D4350230 12200240 25DO0250 F0550260 4FOI0270 22C20280 260E0290 FO 65o2AO A6EA0280 125Ao2C 0 00 EE02DO OOEE02EO 640Eo2FO 63000300 64220310 A6310320 260C0330 132A0340 630D0350 13540360 A6690370 COOl
•
0380 4FOI0390 F8A Io3AO 48000380 44 I Io3C 0 3BO 303DO 25E6
L
40
o3EO 25EE 3D03 133C 6707 25EE 2596 3700 13E8J
03FO 6DOO OOEE 630C 25EA 7C 01 25EA 3C04 133CJ •0400 6707 25EA 2596 3700 1402 6C 0 0 25EA 6306J
0410 25E6 6BO 0 25E6 6600 8890 4902 142E 4904J
0420 142E 4905 1438 4906 142E 247A 133C 6900J
0430 247A 8980 7901 133C 6901 7801 1430 670FJ
0440 8624 8765 COOl C 10 1 8014 8705 8670 259 E.:
0450 25A8 D431 1-I40E 2568 440F 2574 4410 257E.:
0460 6306 25E6 6BO 0 25E6 630C 25EA 6C 00 25EAJ
0470 COOl 4000 13DA 247A 133C 6501 6701 460B
o1~8 0 7701 460C 7701 460D 7702 460E" 7703 62lfof
0490 601D 610F A669 D 101 A6EE F155 A6FO 600 FJ
o4AO 61 1D F155 6001 610 F F155 600F 61 01 F155J
o4BO 660E 25BC 259E 4200 250C 4901 251E 4902':
oI-Ie 0 :'.530 4903 24F2 4904 2542 4905 24F8 4906.:
04DO 24FE 4907 2504 76FF 3600 14B2 8090 8904;
o4EO 8954 6007 8902 6500 7201 77FF 3700 149 CJ
o4FO OOEE 251 E 2530 OOEE 251 E 2542 OOEE 2530.:
0500 2542 OOEE 251 E 2530 2542 OOEE A6EE F165':
o510 A669 DI0l 70FF 71 0 1 D 101 A6EE 1556 A6FOJ0520 F165 A669 D 101 70FF 71FF D 101 A6FO 1556':0530 A6F2 F165 A669 D 10 1 7001 71FF D 101 A6F2':0540 1556 A6F4 F165 A669 D 10 1 7001 7101 Dl 0 lJ0550 401 D 155A A6F4 F155 1564 DI0l 631B 25F4':0560 7EOI 25F4 A669 OOEE 73FE 74FF 258A 3700.:0570 1568 OOEE 73FE 258A 3700 1574 OOEE 73FEJ0580 7401 258A 3700 157E OOEE D431 8020 25C6': •0590 D431 77FF OOEE 2 5C 0 259E 77FF OOEE 6005':oSAO F018 OOEE 8680 7501 A668 601C 610C D 10 lJo5BO A669 OOEE 25A4 4F01 143E 139C 6005 15C6.:o5C 0 6015 1 5C 6 6080 F015 F007 3000 15C8 00 EE;o5DO 630B 640C A67A 2608 OOEE 25C4 25C4 00 EOJo5EO OOEE 82AO 15FO 82BO 15FO 82CO 15FO 82DO':o5FO 643C 1602 6437 A6EB FE33 F265 F129 D435':0600 7405 F229 D435 OOEE 260E 260E 260E 6705J061 0 D435 F71E 7408 OOEE F494 9494 F7B8 9290.:0620 9290 F494 F4A4 97A5 B5BD ACA5 COlO COSO.:0630 COF7 5477 54F4 AlAI AlAI BDOO 0800 08 EO':0640 ££84 F424 E4F5 95F5 A595 5E50 9 E50 SED 0.:0650 8000 8000 A5B5 BDAD A52A ABEB 6A2A 5E50':0660 D6D2 5EOO 8000 8000 F880 8080 80 EO EO EO':0670 0602 0202 o70F 010F 08 OF 7A4A 7A42 431 E':0680 121E 12D2 8E 52 2322 23DE 12DE 14D2 F080':0690 FOlD FOOE 0204 0004 FEFE 6666 7E7E 6666':o6AO FEFE 7E7E 6666 7E7E 6666 6666 7E7E 6060';o6BO 7E7E 0606 7E7E 7E7E 6060 7E7E 6060 7E7E':o6C 0 7F7F 3333 3F3F 3333 7F7F 3F3F 3333 3F3FJo6DO 3333 3333 3030 3030 3030 3030 3F3F 3030.:o6EO 3030 3030 3030 3F3F 0000 0000 0000 000 OJo6FO 0000 0000 0000 0000 0000 0000 0000 0000
32 CHIASSO"J ST. •GATI"JFAU" p. Q.
CAl\JAr'A"J8P 6V6.
•
•
•
•
Eddie Shaffer28 HoneysuckleCasper,WY 82601USAPage 1 of 5
Program Your Sounds
This article describes one way of interfacing aGeneral Instruments AY-3-8910 Programmable Sound Generator(PSG) to a COSMAC ELF II. Operating under software control,the AY-3-8910 PSG can produce and sustain a wide varietyof sounds. More information about the internal workings ofthis chip can be obtained from either the data book orfrom the references at the end of this article.
CIRCUIT OPERATION
The N-lines are used to signal the PSG whether theprogramming operation is a Register (address) latch (hex67), Register write (hex 66), or Register read (hex 6B).The logic level of MRD determines whether A8 (8 bitbi-directional bus driver) transmits data from the "A"terminals to the "B", or from "B" to "A". The TPB signalassures valid data from either direction. A4 detects thestates of the N-lines to determine if a valid PSG commandis issued. The clock signal is used only for the timingreference for the tone, noise, and envelope generators.It turns out that the ELF II system clock is just right.
CONSTRUCTION
Attaching the interface to the ELF II bus should notcause any problems. I used a Netronics kluge board andwirewrap.
Parts placement is not overly critical. As with anyproject, use good construction practices.
The only other part you will need is some sort ofamplifier. Just about any should do.
THE SOFTWARE
Software to program the PSG can be done by eithermachine or assembly language, or Tiny Basic by the USRfunction or by the OUT statement.
The PSG itself does not take any memory space but thedata Will. One page of memory for program and data shouldbe enough to get you started. To eliminate any problemswith DMA or INTERRUPT, R(X) should not equal 0,1, or 2.
After initializing R(X), the PSG data pointer, aseries of out~ut instructions are executed. The OUTin~tructions should follow a sequence of latch addres~/wr1te da~a or latch address/read data. (note: Once anaddres~ 1S lat~hed, it stays valid for mUltiple R/Woperat10ns unt1~ a new address is latched.) The includedprogram show th1s along with the programming technique.
41
42 COMMEN'rs
The PSG can be programmed for many different and veryunusual sounds; also synchronizing sound with 1861 graphicsshould be easily realized. I have a short program thatfeatures this.
Using the PSG as a base, the possible expansionsmight include direct keyboard entry of music with immediateplayback of the note, two chips for stero (3 separateamplifiers for each channel output!), audible alarms,data transmission, and other examples too numerous tomention.
If the Q method of sound generation does not qUitefit your needs, try the PSG. The vast range of sounds it iscapable of producing will provide hours of fun andexperimentation.
Laser sound controledby keyboard
•
•
ADDRESS
00000002000300040005000600080009OOOAOOOCOOOEOOOF00110013
00150016
00170018001A001C001D001F002000220024002600280029002B002C002E
002F0030003100330034
OP CODE
30 030090B3B2
F8 91A3E2
3F OAF'8 A5
A267 6667 6667 66
D322
6BFB 7032 22
6B}i'C 04
5230 1437 2630 2BF8 20
5230 14
6067 66
22
2222
F8 2052
30 OJ,
COMMENTS
Could jump to monitor
Initialize:Delay PC HiPSG data pointer HiDelay PC Lo
R2 points to start of PSG data areaHoldPSG data pointer Lo
Enable tone only on channel A onlyChannel A amplitude mid-valueStart data value Hex 20End data value Hex 70Call delay routineMove PSG data pointer back to
PSG RO data locationRead PSG RO
Check if PSG RO=Hex 70Read PSG ROIncrease by 4Put new data back in stack to useGo write new data value to PSG ROKeep sound on if "1"= onGOTO sound offRestore start value of PSG RO
Start freq. sweep againMove data pointer to next locationTurn off channel AMove data pointer back to PSG RO
data location
Restore start value of PSG RO
GOTO hold
•
•
43•
•
• '---__5"'-1 \.... 4
Trp:5~2.~_++-f~>8>">4L.-----lf----~' If/{ ;r-
H 9~~f~O_~~~~~~~~~~~~~~~~~~~'~1117
~-----------------........::t::;..2. ..... (;&'O"K23 -
J!. i/~~---------~IA'
1. AI':.:!.-----------"""I~AZ.:.=:.- ---:...t4 A3r-=-- --=:....j)1M
~---------~, .+5t A,~ "1'
A 138 ~eS6r~--------------------~-~~f8,(,
1>,1 ~z
PI S8Pz S"-4
.P3 50
))~ 4'Ps 41.
Vb 18
•3A'
6 It'CJ,OcK 7 ~
",eM /4
10 I,dflf
PSG DATA STACK
00A500A600A700A800A9OOAAOOABOOAC
073E080900200800
Latch R7 addressEnable tone only on channel A onlyLatch R8 addressChannel A amplitude mid-valueLatch RO addressStart value Hex 20Latch R8 addressTurn off channel A
References •
1. Byte July 1979
2. Kilobaud Microcomputing December 1980