JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control,...
Transcript of JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control,...
![Page 1: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/1.jpg)
JMfhL S t0 L
‘1 uLer
€ au e te Or if
c1 r graTCao Cocrroile I
1.J l if oil rs oigi at d oppr nato y 0 y at go
‘if if the need to provine a more efficient way of implementtng
;e t a logic con1rol systeirs input/Output modules provide
a c d oan bewec xtena d°v C i i t
a t cc p Jfl ut swto .es etc , and he in err ii p og am M st
large programmable controllers are manufactured using bit slice
th oIog, which execue their own unique limited instruction
a. P - c P ‘e t s on np t o u c a d or
a r a if gs.
:if equirenens if a programmalbe controller may be summarisedF I
nardware constructed ror tnaustral environments, where
electrcai Interrerence 15 always present, and environmental
n ions are poor. e ( high temperatures high levels of
usc and coataminates et
Real alme performance execution of programs in the order of
cc w h as r ont o scret me requird
‘ progracuing language specific to industraal control, which
is easi’ y understood by personnel with no formal programming
p‘“ C
‘mcLae dcc nifcroe of programs to enable
norm ss’oning end eiftca.ent software maintenance,
p if ama le o t II s provi t e abo e e urcs o
2;.g degrees, ne4ever the maJority of units are suitable for
cmcpcerncnc rela7 logac systems only. Many systems attempt to
a t f ct or to orovid a al p oc s rg howeve t ey
I & ryakardardliLed.
The wTr00 programmalbe controller steps sell past conventional
o yr I r into the realm of advanced control by providirg PTD
r gu atcas, adaptive control, and feedforward control, with
future developments planned for autoifuning P1D regulators.
P o wa e amer iei of the RT150 is p ovided on ‘igure
s ala ‘or Sy P0 u
![Page 2: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/2.jpg)
I
SiJktL
flO
__
__
__
II
0/1
LU
TO
Firm
!XflV
NV
t3hta
9c
9;
LeJ
i9
=•
_F
F<
_J
LiH
-\L
2L
J&
Tad
A;
90
91
38
EDC’)
CaEGo
-c-t0C•01U)
D4-
U,
LUadX
99
99
13
91
•adA
99
91
308
120..$_—__E
o/i
22
0
![Page 3: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/3.jpg)
I
( T :t -‘ - I’
F or k e or or - cI I JFr arru t r:v i s r ii I/c usc or th I tyraoriry task level,Virtually a unlimitea ruwber oF rasics Alrh fastcotex swlrcn-n3 oetweeu asks
a I t t- o ort Ir
‘4TERRUTvu r ,,,,,JxtcisNENT xaa zrcstocc xctscx—
IRESTART LEVEL 0 C LOOK AT XAGAII4)
XBASE = 2 1 YESADD TO XAGAIN flE CONTENTS OF XBASESUSPEND CURRENT LE’IEL. RESTART LEVEL 0
SEIDOND CLOOC DCTERRLPTI
L
FIRST CLOCK NTERRLPT
va C tD4AL Q2ITRQJ
FIGURE 2
ndu rid i ic°r al provide e 800 c rds is 6
ocabular es,
Table driven assembler supports the complete 68000
instruction set, with error checking on instruction syntax
Fmrst Austrahan Fcdh Sympostum 41
![Page 4: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/4.jpg)
a V
HOIS DRI%‘ART ONT D IS NC?Xl 0 SR all a a
AND a 7e1 S1
CK
I
00 e
A tra,rfe °j.1as3ur
![Page 5: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/5.jpg)
G 00
4 05r et
[RA’IP 1 RI C RPcRCN0 IABE
.— 000002
0
3 OVE Sia beaddeOOaC. bete enoxgbel”n t’ Ps.. Tert cii
e c,a .a. a PC. e n t 4efi. 3. a rcASK 015
Tfr 5C. SK
FIGURE 4s aaronSy sul
![Page 6: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/6.jpg)
d
so ci a. a
cc er Ic0 a )i td harle°E,or
at B a. ii ;s Mr Esson’aada ‘coer o a. n ag akcy ortr systems
air le s w’n h we e ha dwired to microSrpu a. y °rc ouputers were programmed in macro
as mblr whi urammab e ntrollers were programmedo lea oi t wa o v ou flat combining the two
ai if e aqu pment into one unito o e kltao gi a er having
o a c e a r was he
C Co
y j I a° Mro
a.ad
s aOci.
g
A ? ara r IL Syripusiun
![Page 7: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/7.jpg)
t iran: r3
a a Fpa a t M s is ti C
atnal niacitc Os iop.ed ‘uesl.
aacV; ista a P adet anto e t d a sy t A a an la
ts ona’ gurat ion r prescned oslow
a toral a a n
aa incr avatar, a
NLa a *
—
LaIIN j flLia BN
I 3 4
£5
•1
SCALL
2
/
IANULI
First A straiiar Forth Symposium 45
![Page 8: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/8.jpg)
3
‘;
is
4
4
a)
f
3T
‘II
SIT
II
1
)V
V3
1.
II
‘I
‘1
rixrn
xrn
t’“r
nr
%rn
o.rn
Mp
‘I
‘31
1,1’
V‘S
4
11
•11
0’ 0 iica
1i’
‘IZ
J2 -7
,,
3
![Page 9: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/9.jpg)
LVWWIJULIISY
£JUOU
zaeasLegET3Nfl(0t*3e9)
JSOTUOIt38UIVtfl3
rubut,swe;°p
at303uusb°eqo6p
oseawa3Lsueq;ebwat•w
amid6uaqa
pueIutue&ua6
tp
uot3aeayxuapueuoflttj,.pe;uawaaaq
3UWT8WflSAS803J8T13’t3J80S
dA4ea3a4SCSCI.LVd’LLVdIN...a
449SCfl4S0‘TP.LVdWiNaS
vJ
—‘a
Idi.3
Wiat
a—
![Page 10: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/10.jpg)
ft C
S.
t ‘ark’we’
‘I
rbc ae”do- .4j q LeGs, were (is
• - ‘Z Z7 • -t V . hnall, ,:mated power‘a:t- wit • .,e.. . ; g $ %“3 OEtrs to ge’ theirar’s ‘n a - aac’e ?n-e...rrpt •o-: Mr tn1’ was a SYH-l,
zaGe b. the ‘.:w dctunor .te tck Sgscea iC. This board wasrtoteed •‘ at b) a _‘ngn t tia fru I ned just left,
• •an t ..ea wg f.r 4E Pa •sso intr;duced me tr th-eedsegsp sit’c mOa a nair e for board -
C ut. n’ As b r/Edi Forthone er wit (or a Gent
I Frth rig ay ua Bo ak omeaa.j
war my g as. to U- shad a a Pew ckard g amable ulator a
weeWt ov ‘ impres.. iith stac After all the HP wasa continual to..rce of kt.rrjsare prot’ems, so that anythingtnat even resembied HF •tyles was erough to immediately ringalarm bells.
However, a software company in Canada was offering someutilities and a newsletter on a b-monthly basis, so I rolled
p with my subs and started Forth.” It took severalU rising we beoome ‘onvert t this ten and oompaotew anguagc iyone ifl is it S d to is language
‘i b oat Co çr I oam a zealous• a o t e a ymposiuma
lar te. log ive. paper apacaag the ii. alke a tended at
v t.rg an •nt awe s ins Thet n. ration ‘
largely resoc ib for a Syapnstu êt this t me. I alsonad nuse tc have my awrej orga’z serviced by two )ocalservice techeioiars The protlen was rather tioklish andreqaired several reruwn visi’s O’ one of these visits thetwo tech’iicians notioea my tYti_l rid ate fact that it wasranting Forth Their irterest was Immedtately aroused and the‘s techrio4ar çow ‘cw’i as Hsestz Pty Ltd) went away,
rmly cony ad that F ‘a was a • od thing The next stepto ac a use i saftwa • elopme t or several
ts d n tt ence o experimentst ornoi e8 a * aç ottycovixboard
from ‘osput•r Cowbo rototype one Chris anda s de a total ste sed on h HC4016 andapable o b ng us d ther side an IBM, outside anyomputer wi a serial p r (inoludiag an IBM), ard a small 5
volt powe: sppiy. yr with a simple serial terminal andmonitor.
be two Lair r’t%at-ag 9ea’utes for the whole projectnrc the exizte.’a of Fork atd the existence of tho Huvia to
Rrs’ Australian Forth Symposium
![Page 11: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/11.jpg)
a
U5
-- • tp acri everert7 - — 1 as. I e...rs,i’ styl . c..a: ‘ra tfa.s •..
-.— .: a n. :er 9c ..a. _‘ b— ohn!.eiae ‘ci pr.a• e
•- a a 3%a ic No-’s C’i3. kirt!w 2*SCdStICfls rcca s!
• . -,a ta. . r’ssoc o.aro for tne !bH 143’,ld Oftta S
a .j elozent advantage. C :rent Nvix boards.n .e t.ttoçme.t system ,‘r3d-aced by Hcv x ttemselnsi
c-’cq a: -c exj.ei.sj-’— o enable the a-erage hobbyist U--cr4 tc tn tecknagy
tnrct. of as ar thrashed cut a specification fr •tesoar that we hope ould be fa impressive. e‘p ion stated
boar a o well $Oøsotarage ob s cold fedbo. ad o eusabebybot ci in
grammer ard ompiete t roh board ha to roduce s me ned aemonstrat o of tie power f he ‘1 ix comb e
nth Porthe board had t operate in a ad a variety of
oombinations as possible:- Inside an IBM fl/AT (not a ‘friendly”,
electronically speaking, environment)- Prom the RS232 port of virtually any
existing computer- Prom the serial port of a simple
Terminal/HonitorGiven this third point, some form of source code storage
-ad to be provided to enable applications to be stored and-etrleved after power down. This took the fora of providing an- •bosd EPRUM Programme
‘he board ..ovide wo c fly than gut arc ation bo r
d pared d ed r t fst
c. I g (bu cap a cRAM eeb a ayof a g sts. 9
o had t ble upgrad° o faster chip alie higher t o ghput speeds), without major hardwarmod as to the boa d This was provided for wit ajrograaable system clock and the ability to replace hec:,stas with a faster version. This is discussed in detailfarther in the text- Board layout was also a critical factor -
long traaks mean high inter track capacitance and lower speeds.Also, design of hardware address decoding prohibited the use oftoo many gates, as the decoding delays would proveanacceptable. The overall design took two months from initialconcepts to first prototype. Incidentally, the prototype workedfirst time - an extremely satisfactory result, given thecomplexity of the board. One of the first things that
‘rr Ausralian Forth SymposIum 49
![Page 12: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/12.jpg)
-F
.-
, . C — e at
a “
t a t
£ e r a. nh i’a ‘s’ o • El- ..
‘- -a c ‘cce 4r ‘‘ Iaestrc. tI’r-.vS ,‘ a’j, e - V •. •e r Sse’.t rg;r,jjets,,.e
a‘
--p •-u’-: srcecca
• rrfl4P !iAS1t .f::Ev z ‘•
Tl’ a ‘c 20 t,i. .,I%’Pc -tr. .p gt teJ ..oner of tne
is P1 oh- a •r id ht se i rei i t I. n at e
Ii s ps r ab 7? ti. Ra .b st tie apegas‘at nteided to be a trea’i.e ..r sozputer flsigi’ cr advanced.e’etzoai.n, . s he.;fu te .inderstand how this board haste•r ro de4eloped pitt ‘gn ri.er1a it. mind.
1 d d t e i yft ibi spe na t act ueof ie gliipe prooessr:
27k- board v’ eadI1 svaslable aomponents thatwe no t’ cos y ens a av age ‘one ith sias op a-
Par these reascns, i. was dea.Lded to provide the aitaitl’ 43256-120 RAIl. These chips run at 120 ns and arerelat..vely aheap, but dnfCrtnnately. only allow the Navix torut at 4 MI F at extra $70 432 ‘100 ohios (running at100 1 a t c o n a 6 N S Ic tanner nwh , I is ias des ed hi boa enables users to taketheir em’ costIperrorman -—lect -on without requiring aajor3aard modfloatiaps Let ye ewjaar sOb this is going to bedone The locis f acet anterc are esigced as shownbe ‘ig •1
1c1* -
4
: “l
w g t swtcsI - awin *s hW’ff £51 I tb’ n n pakiss sfrras’ st.mu ‘asp, “kr.o n.4 4M o ‘us , tAct,.
slc’wr lien tat prausor krrg ‘.set
‘t2 is usua ly ut t always) the sane tine as ‘ti.this ‘to n as a epame rica ck f t2’ is longerthan • U , he oo is now as at asymmetrical cloakThis is as far as cost ooapaters go, in order to allow forRAN (which uses “tV) that is slower than the prooessor beingused. Let’s have a sook at how the Novix would work under asymmetrical look ut ‘he chip unnirg at 6 MIPS To run atNIP te l b 75 s foprovide RAN
flrs Aust.a an Fo”h Sympos.u
![Page 13: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/13.jpg)
II
I •1
‘V
—‘. ..a’ ,.- t. .,
S h ;fl‘ ,CkI .I’tt t.q sit; 220” cln
.0
.4
- 2ns! 8’..
al tan.m’duy daode y
) a;’ see’s :‘im.
t,gyn2 Usingan civ ndral ‘n’gns clock”, y’ QiuiwbSlwus0f4aw711.Ikscznswe ( M.
ote iat each of the RAIl access cycles is 10 ns longer.1ian the actual designated speed of the chips. This is to allowthe narditare time to decode the actuai address of the chipbeing “talked to” and also to allow for the fact that none ofthe verticals on the diagram is truly vertical. It is more likeha’ how in gure Ic. f we also make the c cck o all-g ia ‘i va ab e mark space rat o’ we ‘a mak
an r os ay eed f RAN d irodue arothevery interesting aspect of Novix Power. This is what has beenaone on Vie Novix boara ard its use is very much like the‘LcnI—ratsr;brake combirstion on a car. Normally, the Novixrirai. •t tpg tall speed nf the clock, but by placing a value on
‘ic p th eta (wi Fisdne just typig tha r ‘ gtl- it L K t o speed s age
s at pls o te op th tak-ract..al ..erms. this means that th board can be userprogrammed to run at anywhere from full speed to about 2seconds per clock cycle. The advantages of being able to doth: ty not be readily apparent, however, this means that.
We oa perform dynami dc-bugging f a i’ceode, b mply by a eying down the clock to its
s...owest speed and examining ti-c source code asit executes.
There are numerous advantages in having theprooesso operate slowly - educationaldemo is ra io s data aid eturn sta k examina io
Firs ustraI ar Fort Symp saum 51
![Page 14: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/14.jpg)
F2
T t ar t S ,
pe )/L ...rne_te_ ac.5 c r..e4 -tçpt t t’rzt n—bca:d s1sc means that
• ......st.e ‘, de e.., •pp’:eri’ z rot data-o’ i nt a r’ t T posth iti
g d t •s aa 5 1’ ji
‘the ‘i’a nsign .a:deration was nat the wholearo md tn ze pani’ t being built as -it 3nce
‘a to •p e ‘to 4ow
BOARD LAYOUT
ic at s it dt cup, o’ he8 bitot n I eprv n faseria
ott tha ha lie’ a statar RS232 aitertace meansthat it can also be used ii’ a’; external mode
The qovi, it tie square PGA chip (IC1) in the topf ‘ad •o r o mda° eftaetrc. two
at t pa ig n w c I aid-4) On its ..ght are tw we Parametsr $ ack chips(ICs 11 and .2) TIe caiz maccry chips are the fourRAH chaps below tI-e Noeix (IC a 23 - 33 inclusive),whil ti sy tea ON wt 275 2 EDRONS flarks tie
a a C a
.be AID and /4 ‘,i,itG’ is locaed ci the topRight Rand side of tne bean, and uses the Analogevioes AD7569 chic ‘:,is is a fair LI fast S bit A’D
‘A nvtter id T a as a t en t• 3 r Xe S t ba
All ti-st r°cainz s • demonstrate itsversatility and wet fc.r 3ges ‘c start Ending backthe applications tc whiel’ rhey an putting ‘he Maestroupe cap er
:2 F’,.t Austrahan I’ orth Symposium
![Page 15: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/15.jpg)
t4 0 rI x 0 0 C x 0
Z2
0 m m
t1i1j []
<
1111
1111
Ml ‘I,
1111
1II
IIa
a—
,.*
as
n—
,a
aa
aa
aa
aa
a•
N•
0S
aa
aa
aC
M
—
4
IO
F9
SE
LE
CT
z:j
afl
0a
![Page 16: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/16.jpg)
e irp oe- “
s sf ed e weeriIC 0 Tpl pote
f ranc
ie 86 sjc t d eo t s
cess pr to ol Curr ut eo nr on ‘banuel Signalling in a r
en one exchanges 3o tbese y te ORIH p ogramru ig v n
FORTH lang ag is lar°r bi a al
6 c tnaranig va a
rrr tivehexdurrp f hes reported along witi ext
allowing on cc ta entoutpu p0 e s
c r ay barkedonc fr °g te Set ices D gita Network (ISDN
da ay develop a est system for theI which is used for the signalling between
ed i us K 195 tocol Tester using
e p ca or The high level nature andadd or F F 011TH ntetorete
p1 r
d e kr
rt na
d °stls
e cst 0 Is) dspayedd be available ranging from avhere he value of every bitfieldF lters eb ii d also be provided,re tester ai educe the amount
sp ayed ligger wh cE allow
eF
ae
a
r rd
ape s s
S
3 I e ed r sa
r
eu
p sy Frpr C
CS i 0
b ort n
s houv deFe ui ay
a e aitar Folh ymposur
![Page 17: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/17.jpg)
f0‘3)1 0)2K
rs#2
L. J
s. c”c tete a a
IsEts_s RuSS
0)10_P PROTOCOL II TESTER
;ur Siflg tbe rotoLci tester as a s’rnarcr
a aser programmable action to be performed when a particular event occurs, may also be
pros ided.
L ‘j gmg: n additio to on inc display, s protocol tester should provide facilities to record the
data onto a permanent medium such as magnetic tape or disk. This permits the storage
if .arger amounts of data tkan can be stored n memory, as well as allowing the data to
be analysed off$ine at a later stage
An ivsq: In both ond.ne and off$ine modes the tester should be capable of performing some
lea ci of analysis OL the recei ed data. rhis anal, sir it ay coos st of generatir g some stan
ad prfon ance criteria, e g data throughput, or some useitdefined criteria eg. the
proportion of attempted cait setups whch were successful.
rror corp ehen ive testis g, th protocol tester may taKe the place o’ one of the sides o
the comrnunicaion link (Figure Ib) Lu this mode, the tester takes an actve role in the com
r u t or b’ec ii g h d v’cc urd r t s t a known set of stimuli, and the i hecking that
i gri rates the correct response. This mode of operation is known as simulation or emulation,
-is di ti c o i eing ti at a imu atior perforrus seit rograrr med protocol behav’our (pow
aioly iorrec , to check for correct error handling ), while an emulation performs a correct
t ard-coded protocol behaviour
In the s’muia i u and en’ ulation modes, all the facioties availab e in monitor mode remain
avallaole In fact, some of the analysis functions may be used to test the performance of the
tester in these modes!
r iually, a protocol tester should provide sufficient support for the user to program a simulation
This support consists, in the case of a FORTH environment, of words to
s Actraiiap Forth Syrnpcsiurn 55
![Page 18: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/18.jpg)
t I
ar
H ware ii g
r ME a r
a0 V cart
R
IbteoRcit g
s r pts ) i plac d
bi is dasn e rg nd be FOR”
rog a cdi the ‘?AM o th
a r en g ar alysed, andsnese boards contain 1
software for the protocolrds o simulation test
‘ argc pp a ions Mby ris case a standard me rory xc a” ads ts Solvac
uh e sb-
0 cr agc o be F ORTH dictionary. Ina 0 tI c VME bus nay be nserted into one of
Li e b’s KI 9 FORTH dictionary to allowP ards This software renders the
5 0
n R
asic If xte cal de
wI ch i
a
saam Ea
h appl ca iora Pt
S g 5
o taii ic a
0 1 PU
k
5 Austrahan Fort Symposium
![Page 19: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/19.jpg)
r
C
erfnsnCd rcotruFci&o J et ruats taC o’:rtor uPc;1
ri bce s be ire to en’ e, to t cc
S u
I ORmH Ftaour
he avour F F( fH u ed on he K 95 is ased FUFIH49 igt RTH nd 6
C RTi with nnsiderable enhancements. These enhancements reflect the specific system design
J Ce KIlPE as a seifcontained computer, in addition to providing support for data communh
Co The nciu disk file systni tools a tex edit r display enhancements, and suppo
t a) ö coh at fh tes ports a eeptandtisrrs or fat
‘ee’ ta
structure of a K1195 FORTH dictionary entry is shown in Figure 3. The K1195 uses 32
I each address which requires that each dictionary entry has a code field size and a link
d f bytes each If the dictionary entry has been generated by a colon definition, the
parar e er field will be a multiple of 4 bytes long. To avoid accessing or writing to odd memory
ocations, the name field is a multiple of two bytes long. The name string, like all strings used
on the KI 195, is stored with the first byte containing the length of the string, and subsequent
ytes ontaining the string characters. If the entry’s name has an even number of characters, (ci n e ti r ame string uses an odd number of bytes) an unused byte is placed before the
amc d t ersur he lirk field a igred o ar even address
D wel pm ut Er vir nmcnt
v- task if developing software for the K1i95 (once a specflcatton and design has been com
bet’) ‘ conssts of the following steps.
r i tia vers r of e d C FORT’!
• ropling this code to add new words to the existent dictionary.
• Debugging the software, and making subsequent modifications to the source code, followed
reco pilations.
• Saving a nary image of the dictionary once debugging is complete which may be copied
&rectly into memory at a later stage.
is p asible t perform all of these steps on the K1195 sing the edito the K1195 fllesysterr
d Fe FORTH interp eter, Howeve , due largely to inadequacies in the K 1195 fllesysterr. F
rs[ fr\ustldHan Forth Symposwm 51
![Page 20: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/20.jpg)
&s decided to nake cc faUNIX 5
by a rnicr VAX unning ULfiRIX f abs°quent rranagement of h U’ 1 aphis inst d x editors i r Iitt u a ge roai
a gsI
n tially VAX 750 running UNIX 4.3 BSD, followedarge pa t of th development. The development and
ii e d was tFc ef re facil tated by the use of moreu urc a range of standard UNIX text
r i tn sed a stream editor forn if re versi
g a i utcaus t ie software
i en s the standard K1195t ing the UNIX bostc uld
f arc lea gan wrdu t develop are it mear
o utair he most errors
cc b e g XI9sb ueansofanasynhronous d ransfer package a led rf lex IF arch nec were connected by a direct line
weer a cal port on tFe UNIX F s be n’ot port the K1195. In additiono ransferring th source des ‘rfilcx o v rted th xi nt the correct format required by the
K1195 filesystem nd stored thrr n 3 5 nd floppy disks One K1195 was used exclusively forFe u pose of up dowr ad g Si a d t 55 r du e were compiled on other K1195s
0
5 dI
aw
0
r a d ver k
b s Austrahar h Sympos un
![Page 21: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/21.jpg)
J if e&, ne cc ivru pr at Cr p i c as ound are. iseltlb
ag ra :5 FFCtC Orougri; rc ae project was rr ineract:ve inte”faco Ohs
ft Oy’rg aricos aptons ann immediately being 0b!e to ver the results; and for-ono to o:ase w’tuoct hatng to do a complete recompile. Of course. anything altered
e’ ado had to be added to the source code and ultimately recompiled and tested butas a hgh prooabiirty changes made this way would work first time. Care had to be taken
ocr r veer track nf what changes had been made interacteiy and to make sure they alli cv. u et put in the sourc°
ipare the ss ORTH code Li ther languag e auee
be v d rtainly a e been designed differently if say used, Also, using‘i b verhead of maintaining a dictionary would not be equired bu nor
o me ar d rreans of executing tb c de would e
FOE tensible Later sections f this paper will explain features that were addeo FO he development of this software, There are dangers in this approach thoughF’ the cx s ice machine specific then the software loses its portability and in this case allcevelopment er d testing had to be performed on the target hardware which was quite expensiveS the extensions are not machine specific, they still add to the final code size and speed andmake t harder for another programmer to understand what is going on.
7 Disadvantages of FORTH
F’ e man orsadrantage of FORTH on this project (which involved several programmers) wasthe way ft e person’s code could r advertently modify another persons and the lack of anyarl een different r’ h software This meant that there was a eubstartia
had to b f e re all the differ nt parts f the softwo iv r yog s was us a d ne t before a deadline was ne and it meant that testing
ti t awrlt ng oftware because of a nnsunderstanding between programmersI’ u h a Mode Ia 2 as sed that forced the interfaces between nodules to b
episo a w uld probably have been rrininused
OLd ge checking, a ab y n the interest o speed This meant tha a toreperation 0 0 be performed using any number on the stack as an address, even if this was
fti or ro a part of memory that you had nothing to do with, In the first case, if the addresswas odd and you were attempting to store a full word, the machine would crash requiring a
-eboot C this was later modified so that a reboot was not required but you were still returned
to the FORTH interpreter from your application). In the second case, the error may not be
Fscov ered until the code that was modified was then executed, often only revealing very subtle
ugs,
There is an overhead involved every time a FORTH word is called from another FORTH word.
the CPA of the called word must be fetched from the PFA of the calling word and transferred to
r;rsf AUS’a a Symposium 59
![Page 22: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/22.jpg)
sgci scLtc
ut• as d’st a cnac” af’ ‘ ‘‘ “
tic a
iNu. ‘I i,
xi costancre
FDRH Jar r
Na _eecc a re4r a a’ ‘us ‘r rp “a a ‘a stack and tora worc to
cc earn a k’s worn hat calico it u cia r’rd N at alied a tailing word or some otrer
ara Tale s aswfn’ sometime’ to riw a amount al resting of iF statements for example‘aN when it comes to debugging 4 makes rue debate about CflTOs and “spagketti code’ in
seer trivIal Car’ must aNn ‘t aasn ‘vi ‘acnr’ng net aps because the return stacka s’d he. a well.
ks d, 10
of contacit
totic
e FORTH en‘I nterpret
of the 1’,
ypin r S
ntro a
u car eas ly’r the stack
a aborio sapp eerfo
as r a oryou
S Gener c Design
relecommunication protocols are usually crandardised by international bodies such as the CCITT.However, in many cases, certain design decisions are left to the national telecommunicationsprovider, eg. Telecom. Differen’ es In protocol specificatcns ase therefore commonplace in1fferent countriea
To be useful for more than one national varIant of a protocol, testcng software should be designedso that a minimum of source code has to be rewritten to adapt it to new variant of the protocol.This has led t a design strategy o’ ep e ting a protocol s cc f at’ n in a descriptiv ratherthan a p ceo V ay i.e by use ad of instr o is
it”
Aaxa ordcontent vblueprint o F
gyca bor codingame tru
d the frar ate he structur
f a e structure.
y the sa ai vuld eq
eso ye ad a found
d tame To
i should be pcnted out here that a descripttve method involves a specification of how the datan the tables is to be organised, and such a specification limits the differences in the protocol that
can be catered for. A simple data organisation can only be used where the protocol differencesare minor. In general, as the differences in the variants of the protocol increase, the datarepresentation of the protocol must become more elaborate.
Fortunately, national variants of the ISDN Access and CCS7 protocols are similar enough toallow the descriptive method to be widely used throughout the software without the data organisation becoming prohibitively complex.
re uroding
pressed by tF a rci - r ack and the mplete
bugs that turn ontFe mor traditional approaches
e Fe ed asks su-b
p fbid al ri tbo
a) a an Fc
i at frames is representednew FORTh word for each
u nly require ne FORTHefi ci ables Changing H ci table
te s may be likened to
60 rst Australian Fort Sympos m
![Page 23: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/23.jpg)
t y rt y for the word CLEAR CALL, which Iray then be used in subsekt this stage, CLEARCALL performs no action At a later stage this word
crf r some action by using MAKE, for example
MIKE CLEAR GALLBREAKCONNECTIONfREE RESOURCES
C MERS
FREEIfES Uv k ‘LER AL
RUt GS ND CLEAR REQUESWATT VOP GLEARAKN WEJE
REE RESOURCES
i t er for n of procedural specification is the use of pointers containing the addresses ofRI F w rds hich execute the protocol If a different protocol behaviour is required, a
rd i lefined o execute this and the pointer reset to contain the address of this
![Page 24: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/24.jpg)
rn n lrtet
Fi ot ci fes gu r h software hi should
er b r aid & t g t r&ultant machine‘r de field of that ord sh uld contain the
1 55 C e F ORTH words r he dictionary areime is redu ed Ic ir taken to develop
t taker us g FOR’IH
a 800 c o s compiler was used or the UNIX hostf e asing oftware development time, while allowing
‘ ½ U IX I st taking advantage of debuggers
Ohte
rs find d n
posd wlei dii s e ewrt er FORI
THtog e he
e g Ibya to tb
f 05 F
& r nc e speed requirenodu es generally those whicl
he Ki 195) v crc developed using Cser r terface to the software was keptul f’exibility f the anguage
ge o utint s, b t r OR1H ardnvironment The first of these was a FORIH
UNIX host nto the KI 95 s meiror
Ok nare
crc °v d to provide a usable crossco npileor des gned to oad a bnary file generated on
P0
f hpec
c rat fieF& hiss o ywhi
e Th pobler½ e b’ vLw sse ble y sc
o riethis be fhis app oach has the dua a ntagp or ion hr s var e ng
I
I ag
V
s y I
s Ausl a a oil I Syriposium
![Page 25: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/25.jpg)
as tb fled hi sti becking that the magic number in the file header is6 s t b e cxc uti r If i s the header a then consulted for the sizes ii.
f h h gr eits e pr gra tex data and BSS ), as well as the address ab b ad’ T e a d da segri nL are then opied to this address
d e g t r to addre i d the bre seg n i
c Ip duesh heso
ar act ar a Ic p int.eL. I’ Tws s is %fhø c,’r’
e identifier is the same as that used in the C program. The number depends on the symboltype If for example, the symbol type is that of a variable, the number is the address where thear able is stored. If t is a structure offset, the number is the number of bytes to be offset If
is a fur ction the number is the address of the entry point to that function
t a ar [ortfl Sy nposiu r
Ii
gen rachire odeand da a
![Page 26: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/26.jpg)
a
a c e Sea l a dal a
dr rx
00
a et b read S urtmeacio fb e u ‘8000 a u t r as star dar variable
d as h r
6
i u i at og c. sect g
a n r a t a a hie action of whichlb to 2 otF aue no c he ffaettngabaae address ofa
g cc dd a cr
TSia o eas au onati 11 genera c ai terfac ord for ad function, variable, structureaae, structure generato structure oset array and p inter dec ared in the C program If
FORT H interface words are rot reou ed to all of these t e anpropriate I nes may be deletedcm he auxiliary file pr r to v 1 ading t he K1195
s Austraha Fo th Symposiun
![Page 27: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/27.jpg)
F CURES Hash Table Structure
10 FORTH Software Development Utilities
g r ours of the protocol testing projects, a range of utilities have been developed intTzl v Fich have become part of the standard K1195 FORTH dictionary. These utilities have
enabled the software development to proceed in a faster, more efficient, more structured, and
less errortrone manner. As such, they serve as excellent examples of how the extensibility ofdRTH nabies the progranmer to ‘mprove the language and overcome many of the deficiencies
nd OR1H
jc’ I Fast Compiler
e ORTH nterpr r corn des a c ondefned wor it mus search the drct onary te p ne v rds t e o ha he Code ield Addresses (CFAs
be ci ePaar ter i dofth newwrd, Thisprorsorig allyem yed
‘:rea- sea. algorrthm, wh,ch became slower as the comprlation proceeded and more words
w-e added to the dictionary
1 s og rash table to improve the search algoritnm, the compilation time for a large appli
a n tt SDN protocol test software) was reduced by approximately two thirds When a
is rtered it is only compared to those dictionary entries whose names are hashed
to he same v ire. The Name Field Addresses (NFAs) of these words are chained together as
shown in Figure 5. When a new word is added to the dictionary, the hash function is evaluated
acing its name, and its NFA is then added to the head of the appropriate chain. The number of
l FAs stored in each link of the chain ( three ) was chosen to minimise the amount of storage
ed by the casE table and linked lists for a given number of dictionary entries
:
I I
tEEZ1 ii
S
P
LFA
A
PEALEACPA
I
.4
;rct Australian Forth Sym.poscim 65
![Page 28: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/28.jpg)
o r
r r P 5 b a tincturegerera or wth th following contents )
o D 4brsONG MOlT bytes
OHS YEAR 4 bytes )8 CHAR AREA AY lAME P bytes4CHAR RN MCI NAME C4bytes
T TLE utured i*
C RE efloes he size of titr t len it
b cod ATE
P o h
AY d eserve enough memory tCt t r u ‘IF s xeu d the aseaddressof this
‘ h ccii i o at rs M I IH et Fe add the appropriateffse s a d ess c by et r g h css of tEe requ cd eleir ent The foHowmgus f e
988 1 DA SfiATE YEA sc the year to 1988T DAYS DATE MONTH C return tie aonth )
e F c ra a uired ‘t u ture elements
r rustraliai F r” Syripos urr
![Page 29: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/29.jpg)
r
K d r a. to I
EXPORI orEXPORT wordEXPORT word 3
‘1 bOULE
M P E narks the current top of the dictionary for later use by EXPORT EXPORTI which of the words defined in this module are to be visible to other subsequen
is done by linking the following word to the previous word specified by- s the first t be expo ted in the current module by linking it to the
e th m dule as eg END MODULE causes the last word spec fier k F a d finedwordinthedctoiar so atth ext o ma
k I renati n tiesew r s eq ltl LX 0iLNMDUEv d
U
a a e r e s rta if r ranple when a ame is being decoded a id he buifc
e a scanned yte by byte, while each field f the frame is xtracted and displayedhe a frart s beng cded for tansmissior Here, or. jt s coded .d F
e a lablo location in the transmission buffer
o i rds ore defined to facilitate buffer operations They were coded in assemblerr ice h speed rheir se has lead to speed improvements of 20-30% in typical franc
d g, oding operations
P E If tart Addr s Count
tb yrpus i 0
![Page 30: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/30.jpg)
‘1a I ax
‘
h i.
Din. t of th iaff.r
WI aI.
S. g S
11
St $ isvhitesic ps a a withi fl
t a d if a i a vat outside ths buffer
ad a was ag•d
1sto ‘i u ufferoe
bt owns en h bit a tuned rsuccess
s aust ahan Fo it Symposiu
![Page 31: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/31.jpg)
td i
t e p F ‘l A
urrtt notat a tng?xc the cud f be af’
e’ trg s’ir- wrht cc tanaged tufaeL C.
f 51 uhcrg
F IT
hctrns th byte froa the current pasition arthin tne wanaged buffer
P E )Stnree the htte on the stack in the current position f the managed buffer
hY’E flag)
PYlE flag I
• a)
CP BYIE flag )These words combine the byte fetch or store operations with a
p t cc ernt or post increment or the current position pointe
0. act B t trcair Routines
h by p ra d r i hat at ft £ rr et position within the ii anaged buffer The Bit Pointer
HP ) is et to rbt U whenever the current pointer is moved.
bit number
Peta—ns the bit nanoer current Cv pointed to see Figure 6
I icc to move tile Btt Po nte within tne syte ore bit towards Bit 7
I rizer i it v pt iT
p CTrieatomoe he it to its wth i he yt o bt owad Bi 0
The pointer will not be nosed past Bt O
:;? C FiT )Trics to move the Bit Pointer by OFFSET bits. A positive OFFSET will
a e “ Bit P inter wards B 7 and a ega i e OFFSET will me e
towara 3t 0. The pointer will not be moved past either Bit 7 or
Bit 0
fBP+t ( number bits bits )
Will fetch the number of bits specified rom the current
B F inter position.
r ut Austahan Forth Symposium 69
![Page 32: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/32.jpg)
a cic i ra
n a
r b t s i r c ii hcated as the strings themselvesci cv ci a gs h u b red starting directly above the
e r £ I a t ble e y dedared ‘Jo faciitatcu a r
‘II TBB
u sedpr not rc r Bahi dl d sir tIe wrdaa
e I haracter t rryalong
r air i s ring add ess Tbt i ig s ed i tb tabl et
ed ab I pfh
p I
S It JABsr gt ing2
t ang3TPB
a c t ast tB asstngl thsrrarners s r b ab irar
s Austra ar Fort[ Sympos wi
![Page 33: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/33.jpg)
w 011w d2 rurrer of d
b e wd3
sag AEP6 Fe er . eat
sage MT F w zdte ‘r tnt p d 05
0
n I
t F’ ap rave Ii rntations w ren t is used n a large, muItiprogrammcr environmentr i suffi r t p otectior of one persons code from modification by someone else’s and
formal enfor cable method of defining the nterfaces between modules of code
e C I. If d c a e de n e advantages i ftc oroto ypi ig ‘nv o iment he interpree fa e id he hi y to nodif the code c rrently in memory nake quick 4hacks” and
F 4i y(rsur
![Page 34: JMfhL S t0 L - Forth · 2017-06-02 · ‘ progracuing language specific to industraal control, which is easi’ y understood by personnel with no formal programming p ‘“ C ‘mcLae](https://reader034.fdocuments.us/reader034/viewer/2022050311/5f73d8718c8afa5fac1a6ce4/html5/thumbnails/34.jpg)
7his
V
S 39 14 tispapti zereby
‘-s Australian oft Symposium