Sie sind auf Seite 1von 161

r i-t'j-'-t ■ * i ; ■ j ''j

f L'+ih IT!: ■ h:±! :TiLt: , . f



. . . . ;
- ....
: . ■- -
'I ; ..,1. < J. . .■ ... . *
j .
: ;... ....x.^.y., , , , 1 i . .; 4
: : T . ttt
T : ' i ! '

; H-"
. I

rl -t!
■ 'T rt- :-Ti;] |: i I rr;
;:Ti-H m-rH
I :■}•

-r - - -i-

ifi
• ! f . -.f--i. -4-^
- I-I 1-

I HA
I
AT
:.r-;

-t •: t ' -i
i c.^^-^VVAwC-' HSO
-!-! ! ! ;•

,.4 _ . i. ♦

I- I- i
..L-J._ -i-'-ll
f.r'-tr. -I...
4-.- .-h; -H -4-t-
i- t;
"• n
i
1-- -f-r

• 1 M"
.[iHEUi-;
•^t-
._L.4._.
t|:ii.l4.m
-f-'H"4^ r Ttttit-il'T
-i.
tt -+ff -f-

-t-
smiT -i.-i.

4X..
--f
-X

—t" •i- ;J:


4-hf
- ^ j- i-L.-j s
-f- St i 1-- 4.

-r
1- • -+- t- -;*■
_:Li.' -I-,
.tr
4-i-
xix
:lt -U- -t-f-VX

> (
11: TX ±
4—» -f,. Tm - l-j. x.U- -. -Sh
-i_ .
f-t ;-^ ■.
. - -1. i. .
: : H-- til- ._ - 1- ..

. h; l-S iii ;-i t.


4:bHl ].i .1 .;.-l . !
'-T
Et m- • *
. i -.i
:T4:iSiitiEiE
FORTH'5 LAYERS

Layers : ^ :
'1

(t) 11/50
Ccrpi'oJ (^r^^
ijet rMSStlnrv
Li

F^RTH LW6-UAG-6'

^ soumJ or a c«iMI#iwa+^'oM ct sowmJs^


or i'"t-5 represCM-fo "f-i'oM »»> wn'+ino^
'HkAf «yiwboir%es AKd ccmmt/Ht'co+es
a »v^eaHi*Ma ... a comiMaitd or
a»\ order.
(4row* Awierieaw HeriVoae Pi'fb'oMory)

FORTW SVMTA^:
a se<^oeMce or Wotds,
^epara'fe^ by spaces
possiW^pf +er»«lK«+ed by a Carn'aje Re'K>rn
@
A Word r^av cor4'aiw aw^ ASCXr cUorac'f'C'^5
eKccp"b spaces, Carriaae Re+wrn, or
Back Space ( wbi'd* erase; prev/o«/s ckarac+er
tK+cred excep+ Carn'aoe Reb'r*).

t/iaV ^ueiaess *
Words are dis-KHeoi'sUe^ -froa* all o'Hter; by
leno+K C I'ti aotaber o-f cUarac+ers^
aad -Rnf 31 eVarecfcrs.
xi.i((ri
"BY.ecurr^Aj

Appl'cafiOM
Layers

U
EXECOTIH6- « FORTH VJORO
II

e)Ca>^ples o"f woords;


FORTH 123 OK

Mori «xecu+eel word cewyerfed reply iVdi'eo+€s <*1/


+0 biwdr/ u^ords succ«5s-AaI|v
%+orc4 pi^ocesse^

@ 113 OK
r

*1^+0
prir+ o<A ftnd e»»'5eord
**os+ avai'loWe wt'xAbtr

S+ack t»seftgc;
Kiurxbers e,M+cred «*"€ pwsUed ow+o a sfack.
OK +0p 0"f k

0 3 OK

1 OK

@ 1 OK

0 STACK CKPT/

n
lz.1

Ifc •"32'7(o8 +w 32767


ukiSi^hed o -fo 6SS35

-loo . 0 -100 OK

-1 li. 0 655^ 5 OK

OK
321(>7 • © 327&7
-3Z7fe8 OK
3X1(0$ •®
32768 OK
3Zl(o8
-i OK
G5535 •©
(,553 5 t».0 65S35 OK
L2,2

^ ^perav\ds

9p6ravids ^ } are or-H^e s-kck .


Oferafors +ak€. m pu+"5 -frcou -fUc sh^ck
Ow J (cftv^ "K^cu^ c}^ s'htck-

iMpu-f process oo+ftH-

_7
a 14
1 L
M

(5
L9

S+ack useag€ leads +© pes+^'x order 0+


op6rA>\^5 oiwJ op®r<+ors Revene
Poli'sk Alo+«"h'oM).

W 3

7 """a ^ •@ *•*
3 a^j3 . © 1 OK

Nofaf'iohaf con ;

Iajok'cI iv»pw+ 8+«ck pftromtfcn """


/K
oo^pw^ 8^*^
poraiMCfctrs
4op ofs4nck 'Vep of S'Ktck
ljs+e<l U«i-
li$+e«l («t"^
iVdica'ICS "tkc
CXCCok'oH «T
worj
exAnxple'.
+ «Z nl s«»n
L4

ARITHHeric. dPERArdRSJ °
«4«jer (r»«je
+
— nl wZ """ (wI-hO
*
/ nuMerA^-ev JeAown'na+A/'
M(?P mwkerftfoiT' ~ irtiAAm^Ar
/tiBrO wuiwerafor deHoiMiVAl^ — reiw. two+.
MINUS h -n
ABS Pi — I «1
!♦ 1- 2-
MA)^ — sreo+eir^
f^lN — siM«|l€ir
wl AplZ M3 ^VA+'eMf A-p
(32Wf m+emc^wle proa.;6f)
m3

VMOD *"
lb bi'4- iMti'txed ivlejer(r««^e O +• 45,S35)
AND

X^R

®
Q)
"AC OOTT (?S) * /* ooof 9s ooooz
ooooz
OOOT • /* OOT S ooooz
ooooz %s
ppx.«^ 9j9
COM/m /n f^«fW9Jo >|.i$odM09 avjj.
AC 1' Oi * T- O
AC U («) • XVW -t' LI
AO t • ^9V £-
AC £' ^ • snwiW £
:sjol\.vji'9^o ^ ?a|<)iMox3
97
32, bi+
Ea^U -1-4kes 2 «+«c)( cells
e) -— wl4ftu> mI^i'^Ii
EMHflna'.

ootKC^ociMov\ frUfl ir<i c'fe rs•

pisp|«y: 0«
^xav^ples

il.3 P- ©

Y2-,
(fAM^e -2j 147^ 4*8*5^ 646 4©
Z> 147, 46 3^ b4 7 )

04 dl d2 — d(«Jl+<'^'>

PMrMt;s .<1

■J
rs
H+'^ J ---

lA/ j vt —

M/M©0
^ ^ ... J(f<iu<4.; «re.M.

7\( Ar —■' 32 fpf flrtJ.


»\ Z'

gj nj__
d 71, n V ^2.

®
AS.l(^i
FO-RTH C^F[P\LBR

Appll caf lOir)


Layers

Devices

B)(renslbla

T yt fey Active
L(c>

M t F^RTH u)oris
The c©l(ec+on 0+
Dea di'c-h'owar/.

( iVe Amer»'c«i» Heri+»j€ Die-hVu^r/:)


DICTIOMARV - I'S-Hwg words .••
speci'ali'tfid iMTorM4«"#>oM
«.|joi;+ "Hiew.

F<?RTHs drc-h'oMtfr/ cow+«mS ujords'


And « con./»//ed ■^e'>
/n -rt^e order were de-fined •

Pe-f^v^in^ A. I'lAw) w>or^


: newi-w/or^ 9
P^ev»ow»s|y de-finecl
Ujords or v\o\Mhers
exA vMplcs
. #. ..« osca^C

: 8» i* ; 7 8* . @ Sb OK
( % IPO */ ; 2"° 5 % ■ @ 10
{M fi)

USING- A FORTH
COMPILER
14»bif ^TACK lAAHtAOLAriaM OPBAAT^AS

PROP

PUP !)
m
^ cr^

SWAP ')

^VEK 2

JH

C
R©T
C

@
16

£)CAiwples o*f s+ack kviAM I'pt; la'fi'oM


3 OU? * . @ <1 OK
: SQUARE" DUP * ; ^ OK

3 SQUARE . © ^ OK
^VtABOUC CdAlSTAMrS

^ PefiMiwj a 16 bil coKS+«w'^


\nowhe.K CONSTAt^ T

ejcaiMPles
de'Pi'»»i*'f>'gwS usea^e

10 CONSTANT TWN TEN . 10

<^430 CONSTANT' tM-IlP • ^ ^430 OK

A constant's mv¥^ he used


QyiywktTe a nvmber C h'4-eKal) can
be used.

M'HP ten 3 * + . @ 946O


.«r>
?!
nj
O

o
ti X
0)
e
(L o>
2 M
2
V
0f
tj yc fU X
o I
_o}

Si
d
u
111 III lu 01
Q) e
111
5^
J j
ID ID CO «)
CD a
< << ol oJ
<C >
H o
or
M ts
«l
lA
eL oc > Of I
o)
>
0 < < < > -S?
0r
m > > O'
> 3 S. 0)
o
0) *0^ 01 >
I
0 > o + § 3
v>
Ol
> ol
2 tS
ol
«o
oS <
o
-r
>- CO 0
0J •■Jba
D-- '-P
<i
o
u
0)
01 K
-T3 01
C,
Iff

GXAmplfiS of usmv VAi^ioljleS


1 X r @ OK
X @ • @ 1 OK
MV-J-IP 2IP ! ® OK

2IP @ .^ H30 OK

TBM 3 + X r @ OK
X @ . © 13 OK

JlefUe add»'+i*0K<iI^ useful of&r^i-ors


•fefcU and di'sploy use^e
•• ? <® . ; X ? © 13 OK
(Vicremeh*!- cawhehfs of a van'alj/e
• +r ( iMcreiweMf var/a ble-Mome — )
oup (S> Ror + SluAP ! :

a X +! @ OK
7
X •
© 15 OK

-5 X 0 OK
X 7

0 10 OK

2/
Hi

Base oanverst'oH o'P numbers


"Hk c^MuersioM «nJ +ke i'H+€rw<i/
^ binary) va/ue an<( +be ex^ernal^
<|i'spla/€d ^riM Can be per'Tarmed
accor^i'na any base ( radix)*

examples
L(o HEX . © 10
7FFF PECIM/\L . @ 32767 OK
40 3 * 7 + Db>P • HEX . ® <27 7F CfH

+'Ui5 conversi'an is canKirellecl by +Ke can+eHfi


©•P variable BASF

: Hex -.v BASF


w.^-w !
. ,
: pecimal. 10 base r ;
Could also de4i'HC
<le^ini4i'on ■ usea«|E

: OCTAL 8 BASE I ; TEN octal . 10; 12 ok

: BIAiARy 2 BASE! J BWARV loom octal •


cr) 47 OK

c££)
cn

WK«+ is

BASE ?

dCTAL BASE ?

binary base ?

Pe-fme A vutfrd 4© Ji'spUy +Ue v<ilu€ «•?


BASF m deei'iMd I j trt^arjless o-P BASEV
c«/irreM+ va lue.

: ?6ASF BASF @
POP PECIMAL .
BASF f 5
usea^e.

PECIMAL ?8ASF © 10 OK

HEX ?0ASF @ is OK

Bia/ARY ?BASF 2 OK
Houu VARIABLES u/ork

VariAlsle.yvamfi — o<ldrets

examples
BASE . © 102^+
X • © 7^20 dK
EIP • 7130 OK

itddress o^erni-ors
address @ coM^fentS
v«|oe address •

exftwples _
BASE . @
loz<! 4. (? .@ 10 OK
B ioi^d- i @ OK
TEM . © 11 OK

Tlvis I's A very s\Miple ^Lt^d general CAp«l»i'fi'4/


example ( iVJiV£c+ address )
O VARIABLE value □
o VARIABLE P0;A/rEA|-q/
MY-EIP valve ! LJJ
VALUE PdlMTER !
POIMTER @ @ © ^430 OK
L1S

DICTIOMARV ALLOC ATiOM

lou>
address
MERE' —- tfdlJIress of
4«p of di^efroMorp OICTIOMARY

Sfock

—j

addre^3
LIS
A

DICTiaMARV ALUOCATIOM

low;
address
HERE* — AdIJIress of
4op of di'cfroMorp oictiomary

VARIABLE- X
dofa cell

higVt
oddVesi
'Ir
m
Clb

DICTiaMARY ALUdCATIOM

lour
address
HERE* — aJJress cf
+op o4 JlfcHcMary OICTIOAIaRY
Sinck

X
VARIABLF X Viecid
^daffl cell
• Bytes
10 ALLOT dat-ft
I
address
DICTiaMARV ALLdCATIOM

lour
acldresi
HERE* — Address oi
OICTiaNARY
4op o4 Jlfch'pttary
Sirick

X
VARIABLF X Inead
do+a cell

• Bytes
iO ALLOT dftt-a
i hijli
30O s 3oo
IIS
4

DICTIOMARV ALUdCATIOM

|ou» I
atddrs
I^SRE' — Address ci
dictionary
4op 0^ dUH^A^ff
S^ct*>

VARIABLE" X
da+ar^ cell

Bytes
iO ALLOT ^0 dat-a
-i
hiaW
a<l4rt
30O ) 3oo
\

FeR&er x
Exfttwple
^
Address pseu^e vortoble
arrays
Dc-PiwiM ^ variable array
O VARlABtfi* ^TABLe 6 ALLOT (si^ 4-cclUi
rwi+iali^mg -Hve arra/
1 'table ! (ls+ «®'')
a. 'table + I (EkJ • >
3 'TABLE 4 4 f ( BrJ )
4 'TABLE b 4 I (4tL •• )
AccessiVa cells of +Ue array
'TA8LF <§) .©
•TABfcE > ♦ @> . © 3
To siiap/iVy cell selecfi'cin ar^i f-e improve
reada b I li'+y^ Je-fine
I TABLE ( 5<^Lscrif4 mfdr^of-cefl )
2* ^table 4 ;

•fKen
o TABLE G . 1 (is+ cell)
% TAB LB ^ 3 (3r^ceiO
LVt

01^ t4 ydv» sobscri'^fs io 4^ i.,


V.l
J€"Pih€
• TA6LF ( suksc-Wpt <uWr-«P-ce/r)
1- 2* 'table -h ;

1 table @ . © 1 «k ( ut cell)
X table ® ^ 1 «k ( ted)

/^Mo'fkeir M/Ay +o cfC4*fe an


V4ri4l»i€. airrAy

1 VARIABLE 'TABLE 2^ 3, 4- 5
( si«e is 4- cells) j
"cowpDes' fcp sj-c r.k
Valoc iM+o di'c+jCriary

Access is "/"ke 5ah«c «s he^cft,

2 r/)8<.E- @ . © 2 OK (2»J cell)


'15 Z TAEtf f © OK (Indeed)
'tABLP 2, ♦ ? 
-15 OK (2nd cell)
O
i 9n>i-:>s @ ^
-H" -PZSZ
:$dlJy^'o)(^
• pao<*J *» ^C) SS'i^fp^ l^VVjJL^OXp
'■pjuxv^ Cv l^ S I <"3 W19
dpfljoy^^ 3>HI?V1 mraw v j-.' f
'^.1 ^f>ov}j.»rO
/viBvt<3ij.pip vii SI y-Aom »7 -^i tuivii
C..=J^.4-., p95W»0v,OuJ )
( ^ sv«uw ''asp N
/ J :?M^^LJ.Oip .
S5avtppt> ^VJ4 'pMf.^ ^1 "BWAVU
MJl
bv4n^c>,A»a9
■tn
U?:.
^'■3
Ci i« "^6 AiC'hoixtxir'y '
n

fJAkvtg. Im fn+fir^ve'l" s+isfe^ se^rckes -f^e


di'c.'hovxAr/ a^d e.r^ecuHs ^
e>r^ COyv^ ejcecu-fe a. uoayd yve^ I'-l-S £{t'c-h'cy\ary Addles)
dici<ovxAr^-(xUiress CFA E^BCOTB'
A+ €i.AirCSS 'h
eicecofei.

£"XA»v*p(e: (ie-perrcii et&coh'oi^


*, G-RE^T' ." Houj you?
0 \/ARlABLF DEFER

' G-REBT PBFeK I <y^ {i>-


DEFER @ CFA £)(ECOtE (c^ How «ire you? ok

u
Lit
STRUCTURED PKO^R^HhlNO-
successive Ke^-iwe^Me•^^'
kierAirfrKicA I deco»«iipesi+i«M a prol^lem
+op-Jouvn sfarf «T en+iVe
«Pph'CS"h'oi*'s ^HC^I0M
bottom-up s+«r+ «f primi+iwe^
tu^^omeMfAl operott'ons

exoimpte: vmusi^c plAyiVo piro^r Aim


sowg PLAV
—I
m s fri> we/wf oa

ioui^d ►\cjc+ l^o■^e

lVis+i''UiAaKf ®fp

/«*v
HI

i'K5fruM4eM'4- c-^ spo¥\il iA€xf no'he.


I 1 1
scf +e»Hfo se.+ ^e^oenc/
sei- scale, e^4 «fairf soui^dl
6»vd wa I'i- -for
Moffi's AufoHon
Sivp SCtfHj
&M<I

•a'a/'I- "fot^ v^04e!s

fi Kct
^2
S+ruc+ureJ pr^i/i'des a CL

w*/ !• breAk A cAAipli'cA+e^ x+rac+uKie in-f©


Simple pAir<f5.
prog ITA IM

S6l€<.flO W

eMtf

1. coA+rol paHv iv> ; JL cow+fol p^itii


aof-A da^A r3/
<1

wtty 4® bre^k A Cdmpirc4+e^ sirt/chfi^ ih+p


Simple par+S.
proa^A m

se-lct f-|0 M

RytE: 1 con+rol p«^+V\ in ; JL ci^w+rp|


do+'Ci da4^
LZi

D-CHARTS

1 operAK0M5 s+ftp one,


sfep <t-u>o
s^f Hiree

lOM*.
fes+

Use p«r+

loop'.
+es"l-

^\ (oep ^ed f
-U
( •Piwi'sUeJ )
or
(,alwAy<)

loop bo^/
C wevev' }
It
FC?RTrt coiwpiMci'' cc¥k+to\
SELECTI0M

volue XF 4es+
frwe p«r+
BL6E "true p«r

^^ls€ p«r4- f«tr+


THEM

value ~ O means "PaUe


value ^ O means ^rue

exQtu^le'
de'P'w^'Kaid
TEST IP TRUE
11
ELSE FALSE "
THElJ j

usea

1 TEST TRJ^e OK

O FAtse OK
e>
-15 trkc ok.

NOTEx TFf eiSE emi THEN ^


sjiiy
Lz:
CdMPARISflM «PeftATdR.5
16 bif sf^MeJI mfe^er:
Q- n j O if r\
t 1 r-f w s o

0< n JO if rs zo
{ 1. if n < o

wi nZ — f O If »*i ^ mZ
i 1 if «1 s hZ
— wl mZ f O If »»i s wZ
\#0 »'f Mi ^ kZ

< m1 11^ "■'■ ( O if 2 >^Z


t i. I'f ni < mZ
> ¥il < O I'f Ml t Ml
t 1 Hi > MZ
0 0= ^) TR^H OK
1 o» TeST @ FALS F ^K
-1 0< Tgsr ^ TRl^E OK

4 3 « TEST FAtSF OK
-4 -3 < resr^ TRt^s o-K
A AO > TESTK^ FALSF

©
i-ii
A/esfMj TF s+rvcfores <K

Ci IF

Si

c2> TF
sz
ELS^
Ci TF
S3
THFM
rHEA/
THFAt
Lib
a
D© LO&?S

loop h»dy
4
hody
LO(^P
I
i»c fl&d'?

/
•pc/Mc"hdr\: /

DO- Kt^wioves 2. pAramtHf^j sefs iHi+i'tfl


loop hoiy eyeco-hed oyrce
L&'OP a.^ds JL "h iv\^€X/
e^i'fs (co^ rf i»*<l6X ^
yyat\cUe.s back +o 0^
4-L&&-P reiMove-S mc, '+ ^ ^ .. ,
etof tWi'+coK'. iv»c >o cKif *f iwde* - tihal
iVe <0 <u -finfll

tul'fU i'k loop hod^


cu/>r£>ff lf®p m^c-X ^'' ' \j-vXX(^
r —

LEAVr «H i;«i+ ei;irreK+ loop lixle*


SO o/iK eKi'f r\efi a+-
or +L^^P

NOTB:

D&, L(^&P , LFAl^f"


ca-M be ghly tvi'HiiK I ^e.-fii\the>yiS.
1%-
eicAiMptes loops:
: C6UHT D& r. I

4 o c&our @ o i 2 3 dK
O 4- C&ONT @ ^ OK
-16 -ZO C&o*fr -20 -11 -ig -J7 OK

* Zi-COONr \>6 r. 2 i'LO&P J

10 o 2*coonr @ O i * >- 8 OK
<1 O <5 2 4. 6 8 OK

: io-cowr Dd r . -io .

5*0 100 lO-c^Nr loo <10 8o 70 <pO <ZK

XNC'C&ONT 0&
X. OUP
1*(.d<PP
PROP •
ISO THC'CCUA/r (Cft O 1 2 5 4. OK

2 5 O THC-C&ONT ^ o z 4 ©K
-3 -10 5 TMC'C&ONT ^5 2-1-4. -7 OK
Lti

\ -frCOOH T 0&
r , r OS XF
LE-AUE
THBN
L&&? j

5 I iC&OHT 11 3 4- OK
5 -3 ^CdfONT -3 -2 -1 O OK
now-JiesfructiVc s+«ick prin+
wi-fk fop f® fk« r/jlif
•for F&ATH
dA-t-4 |0W7
s+<itk
SP^ value oP SP
^ aiifeff c'P
© top

"hf s-tee-lt cetf

SO @ >

nu0*ber Af ^e((s <?m "H^c s+«ck:


: DEPTH SO(P SfKP - 2/ i - •

S+Clclc *•

#
.S
SP@ 2 - 50 (p 2 -
DO T e . "X Tt-O^P

us^ae

12 3 .S 12 3 <»K
Jes+ructi v€ s+ftck priii+
uJlHi fop fo
"for f\'^ F(^TH
da+O |OU7
s+<ick
SP(S> — v«l»/c of SP addi^
top
*aress o'f
"h'P s-fac-k c£4(

SO @ -

nuwber of CM -tfc sfack;


DEPTH SO (S 5P(P - 2/ i -

sWk dol^^f :

.5 DEPTH JF
SP0 2 - 50 ^ 2 -
PO T G . -1
ELSE / E»Mpfy " THEA/

12 3 .S (cr) 12 3 Ok

:f\C\^ C^"'
2_ t )
Lie
loops f' I

loop ^NTIL a. co^^^^'h'ov1 +/'v^C

BEC-XN
loop boJy loop bo^y
V UHTIL

•PcwcKo h*.
loop bo^y 15 ft(u;ays ejcecofcci

eX('<V loop I'-f VT'^ O ("hrye.)


t).WA -b BEfi-l/vl V=0 ( false)
,H01T\ 6E6-IM ^ uNriL tc c^se^l
owly uwlHiiV I JeA'm'fi'oMS
-pof
eKoiMpUs:
; C(^ua/t-p^M BEfriM
PUP . i-( PfP 0=
ONTIL PR^P »
5 (c^ 5 4. 3 Z 1 ©K

; halves BC6-(M
0(;p , 2/ ( OOF O-
UNTIU pR^P •
OK
lb HALVES © 16 6 4. :2- J-
/.34
COMil^ronal (oops
loop A COM^'"iTiOl^ /&»M0 i'm5
\J^

BEfi-lM 4vo
id^y
l6"f parl" loop bo4y par+
\f UJHJLE
2n\J p*irf loop boJiy
Repeat
i
•Fwwchoht
isf p«r+ loop bo^y alu^Ays ekccM ^nce
u>HtLE
ex T")^ loop V ^ O (^|sc)
( Te^ br^KcK +©
o+Keru/fse, csecu+e par'^
•jUiM {jkakc-U 4o BEtf'lN

M&fBi BE6-lHi WHILE, f REFBPiT


Com. W used ow|y tui'Mtin I

Tkts s-h^oc-^rt. is ver^ gc^^er^tf.


BifUey loof> bedy f>Arj- be d>iMi #e<i,
T-P -ttic is-!- p«r+ "fticM -Hif'x I'x a
loep vJI'fU. A. p^e-+es^".
£-a.i / &S.
\ ^

FORTH EPITOR
r Appl>cafi'oM c
Lay e rs
HEX
TEXT HERE C/L 1+ BLANKS TORD HERE PAD C/L 1+ OvDVE ;
LINE DUP FFFO AND 17 ?ERROR SCR @ (LINE) DROP ;
-MDVE LINE C/L (3dVE UPDATE ;
P 1 TEXT PAD 1+ SWAP -'MOVE ;
DECIMAL

These words define the elementary editing coiimand "P"


which places a line of text on a^ screen. Blanks are
significant. FORTH should respond "OK" after each line is
entered. The syntax for its use isi
1ine-number P text-to-be-entared-on-the~line
V

For example, to enter line one of screen 87 type:

1 P FORTH DEFINITIONS HEX

and type return. FORTH should respond "OK", If you then


type:

screen-number LIST

you should see that text- at line number 1.


16 LIST
Sr.R « 16
0 ( Screen Editor... CtEAR COPY
1 ; CLEAR ( CLEAR screen b:/ number-1- *)
2 SCR I 10 0 DO FORTH I EDITOR E LOOP ?
3
4 COPY ( duplicate ■>creen-2 onto screen-i *)
5 ■ B/SCR » OFFSET @ + BWRP B/SCR * B/sCR OVER 4 SWAF'
6 DO DUP FORTH I BLOCK 2 - ! 1+ UPDATE LOOP
7 DROP FLUSH ;
8 EDITOR
9 WIPE ( IstScr# iastScrtt blanks ranee of screens )
0 1+ SWAP DO FORTH I EDlTOR CLEAR LOOP t
.i.

12 RIGHT ( lstSur« lastScr^ )


13 ( copies ranse of screens from DRO to DRl )
14 1+ SWAP DO FORTH I I FA + KDiTOR COPY LOOP }
15
OK Hex
17 LIST
SCR « 1/
0 ( EDI TORi NEW )
1 DECIMAL
2 NEW ( )ine« replaces text from line« until nul l line)
3 FORTH 16 0 DO CR I 3 .R SPACE I OVER =
4 ■ TF QUERY 1 TEXT PAD 1^^ L(£i
5 IF ( not nul l 1ine ) i EDITOR R FORTH 1+
6 ELSE 08 EMIT ( DS ) X SCR © .LINE
THEN
6 ELSE I SCR @ .LINE
9 THEN LOOP DROP t
10
11
SCR
0( double number support WFR-80APR24 )
1 ( operates on 32 bit double numbers or two 16-bit integers )
2
3 : 2DR0P DROP DROP ( drop double number )
4
5 : 2DUP OVER OVER ( duplicate a double number )
6
7 : 2SWAP ROT >R ROT - R> ;
8 ( bring second double to top of stack )
9 ;s
10
11
12 xxxxx
13
14
15

SCR # 149
0 ( String MATCH for editor PM-WPR-80APR25 )
1 : (MATCH) ( address-3, address-2, count-1 )
2 ( leave boolean matched^non—zero, nope«zero )
3 -DUP IF OVER + SWAP ( neither address may be zero I )
4 DO DUP C@ FORTH I C0 -
5 IF 0= LEAVE ELSE.' 1+ THEN LOOP
6 ELSE DROP 0« THEN ;
7 : MATCH ( cursor address-4, bytes left-3, string address-2, )
8( string count-1, — boolean—2, cursor movement-1 )
9 >R >R 2DUP R> R> 2SWAP OVER + SWAP
10 ( caddr-6, bleft-5, $addr-4, $len-3, caddr+bleft-2, caddr-1 )
11 DO '2DUP FORTH I SWAP (MATCH)
12 IF''^2DR0P BBBP FORTH I SWAP - 0 SWAP 0 0 LEAVE
13 ( caddr hlSt $addr $len or else 0 offset 0 0 )
14 THEN/^OP 2DR0P ( caddr-2, bleft-1, or 0-2, offset~l )
15 SWA]^/^- SWAP ;
OK

IKutI- ovtx S /o>5.

O - c t m IVA'^r/L ffS^S cni ro^


irr 7/
^1
' _5(n'v-®^j "^'3

figFORTH EDITOR GLOSSARY

*LAG —— addr n 88
Leave address of start of current line in a disk buffer*
Also leave n, the * characters following the current
cursor position.

*LEAD addr offset 88


Leave the address of the start of the current line and
the offset to the current cursor position.

'LOCATE offset line' 80 U5-0-


Leave the current cursor offset relative to start of line
and current line'. Uses contents of R' .

88
Lofi>'s
-MOVE addr line'
Move C/L characters from addr to 1 ine' of the current i j \i^
screen on the disk.

CLEAR screen' —
Erase the designated screen with blanks.
COPY source' dost'
Copy contents of screen from source' to dest' .

D line' 89
Copy lino' of current screen to FAD. Delete it by
copying lower lines up one line and erase line 15.
line' 89
Erase line' of current screen with blanks.
r>
line' 09 /
Copy line' of current screen to PAD.

lino' 91
Insert the contents of PAD after line' of current screen.
Lines below line' are moved down one line) the contents
on line 15 Is lost.

90
Relist the current screen then the current line followed by
the current line number. Uses the contents of SCR .

LIRE line' — addr 87


Leave the address of line' of the current screen.

M n 90
Move the cursor by the signed niuuber or characters.
Print the current line followed by its line number.

REK line*
Print the current screen down to line' . Replace lines
with entered text until a null line is entered (ie, (CR) only)
then print the remainder of the screen.

1ine' — 91
Put text following P in 1 ine' of current screen.
> r +- Previous contents of this line is lost.
«J 'i5 ^
^ C---\ , i ■ -'itpi- L— -V
I v.. Jb P jovjs ^

Jft/p p.ru^'r v) t-
^'3

— R line* 91
Copy line PAD to current screen at line* .

— S line* 89
Spread lines of tlic current screen. line* becomes blankt
the previous contents of this line is moved down one line
as are lower lines. Line 15 is lost.

— T 1 ine* 90
Hake line* the current line of the current screen.
Hove the cursor to the bcg^lnulus of this line, copy it
to PAD , then print the line followed by its line nxunber.

TEJfT delim 87
Hove text from TIB to PAD until dellm character
is encountered.

^ TOP 91
Hove cursor to the beg^lnnlng of the current screen.

— WHERE in blk* 83
List the screen corresponding to blk* aud type the line
where in is pointing ( the contents of IN ) Inside the
screen. Used after a compilation error from mass storage
<1e, a LOAD ).

.t • *.
B.O.I

sroRA6-E
ApplicafiOM
Layers

Devices

EX fChs/b/«

X M +er Acxi v«

.sr)
6.1
r.l
MASS ST&RAG-F"
CL geiaera I i m+er -Pa. ce

Single de^i
floppy ^ Pfoj
•lar^
^iwckesicr
Q+a.pc
256 K y>yi^S 51ZK b/fes lOM by+es
o
21AM hy+es
10 sol.. 3Z 7&7
Z50.. 74-1 7SC .. 10 500
blocks O .. 2+1

block ^ rwass storage aJ^ress ^


o-f 1024- by+e " block"
A 16 b.'+ bleck# «^l<lresscs 33.5 M
A 32 <«"■+ block# a.AJireise.S 2.2 +er<* byfes

to a device
+0 a pro^ra»v\
logical vwapp pkys I'cal
proca&i block
block ^

OFFser & ■'"

^ Cynit. j (r^ks/o ^
B1

DISK ACCESS

disk
bw-ffcrs

m¥"
fW
a.

DISK ACCESS
tik# BL&CK

disk
buffers

(g)
»2
b
DISK ACCESS
tik# 3L&CK — <^ddir "t" ,0/W^
disk
bwf-fcrs
f^locl^^-
Y->^

btk#
BZ
c

DISK ACCESS
kik# BL(9CK —

disk
bu-f-fcrS

bik#

UPPATe

eJ/C^Cc4"e 4^ f tfil
vs
w
DISK ACCESS
n \00

dish
bw^^ers

loo

too read
pfer •formfid

1 loo

3oo
DISK AC.CFSS
BL&C k

disk
buffers

loo

20O

300

bl e«.k

4v
B4-
y
DISK ACCESS
^01 BL^CK add/'

disk
buffers

read
re^oethd
block

(uri-le opJa+d
block
65
r.l
disk

' FLUSH -forces «1| UPPATEd loo-pftirs


4o be +0 vvirtiS s-forage
t^UST be executed:
be-fore. cKawgiV^ di'sks
before pou>eri'A^ doivn
before res+ar+inj SfS-Ki^
can be eit-ecoM:
Q-P+er e4iKM3
FMPTV-BfFFFRS u»ri'fcs O^S iV+e aj^ di'ik
bofPers vJi>Ueu+ u^r.'+^^^3
UPPATEd bu-PferS fo di'sk

Bo+fe« «« ""
scree^i^ i.IS7"
screen -f^rmiKef
{or devisee >
(A
streew# Z.<>AO m-terpre+s p caMpi'lei screen
A ft I , i .

.j)jf
ioi (pr^
*

( L&fiit> sc(ieeM ) ioi LO-Ab


'

ioo l^AO 102. t.«9-Acr

L&AP-
Rcwi 9cv.^ 3 w ^ XMlspx " V^-r^o
s.l

STRIN& OP£RATI(^A/S
Appl» cafi'on
Layers

DevJc

O
STRXM(^ HAMDL/M6-

X^vpuf
Co)f\ \lQ.r^\OY\
N otn^rt'c s-friv\2 ^ biKeiry
C o p/ 9
Forvv\«ifm^

Cotv\parii<?t^
<5oFpu+

STRIMC- input

Re.CL<l a. S'f'rin^ clxo.ra.cA-^'^S ^om


yi>Mr -herniinAl
C'T' <K a)vw>vinM/'M"^<?>^-S cUflMMe/J
•/' ;
^' df /Urcy^

desf-o.idr vviAX^ckars EXPECT


m /^'?TYTir^
^ " f te( crv\
per T^r»v\s Sack. Space ed
Tt.rw\fKaf€S iAcia ^ wvo.^# ci\ars e^ferea /Si ^^,eCT
or

u 0
57
b

riB

TIB0

hull py-1- Wy

aN. '
d rc.+ t'owa ry
I'mJvO
50 I^qJ -fj
Hh' lYOf^V

/
k^a>RD'5

\ •.

. .•.:--'8

U
S2
C

/v»c.ssftg£ bu-T-Te-i^
TIB^^

t iTkull py+ !»/


32 WO-RD
//js
C Ascrr bUVk ) tl rt+\owa ry

k-^eRD 5
btJ-P-fer

^ c,;e,

B L Vo/?Z)

e)
d
•fi'3

rise^
--■ t rtuU py^'»y(cn) i(^
I
1 tekt

d i'c.+ I'owa ry
!

(PP}^ Iv'C^RD fj
btJ •?«?€, r
PAO^ hilYU'^
^ext llwQ.'fe'feD'b
./■

':jI^

ew ?w
^ KH/^f jCsLt^Y!^
p ^ ju^Ui^ tksdi4i^ uo/^p

'A?]
53
-fi'j

^ #ty+e5 HOVE-

•PrairurtiA^ I Q b C^ X

-PiVst »

4t-AJ<lr ^ be d % •%

Rev»A©ve "frftilma

aAAy^ k^)ra#l»i4ts -TRAlLlMG- 4i<ir

I*4^*0.!s S'f'riVftj( Of" «rr&y§)


A.djlr '!#"bij+€S 6LA^iK3 S'hrei M'^h'cS

ERASE s+«re s ^eres

c.lt«rAc+er FTLL s-hrcs "e-lxAP^chr"


S'fnr'ii'H^ icf" "^^dt

'C.
Si
rt.
I UTf^OT
•ft'*
clvd/rA.c-1-e^s +0
v| our "f-e-rwMVaf /uf^
( or c< cc»^ liwe.)
-
<>r^

aJiJir ^l?c|-fes TyPS* wn'-k.

cl\ruvo.lf£. J $m^fe c-Uarac+ey


CR u/n'K Carrraje ( Line FiaJ)
SPAC^ siVgle W(<unk
#5facGS SPACES sei/er«( 1?1<vhM

\aJOW
u/rif£ 5"fr!ng

udJiQue-fi^i

C^ ■ .-^
uS«-
yt^e wnt
6011'^

cj>a(!?^''
?7
7

u ,"0\<"c^
If
i
Sir

^3
STRIHG C0NyBR510H

Ascrr cKapai.+er +o wwwen'fc vaUe;


use;

ASCir cUr —- ( chr.^Joe .'-P .M+erpre+.Mj


I eUe covMpiliKjj
{^ cl*r_v<»!we >'s cempi'leJ
K IKS ft d.& bi'4- h'^t-e^A I
(Z
de-Pi'ni4icn; -
Ascrx 8L W(9RD HERE
literal. 5

Cn/fOTa ^ sc rxj^c—
x/
7 II 1^5

fSjujwftrK 5"i"rm^ 4-o c-oMwers i©w;


aajir-s-frm^ NOMBBK <^yalue
awJ folloiA^tn^ cotAversio*^^
varicble DPL c^v,-Ums
-1 I'-P nywen'c s+riHj no"!"
pUKC+yq+ed ( c<5v\ver"!~cd Vftl^S
• . ft .^t *l t .1 * 1

is m Hie 16 Wi'f signed iwfeger


Tftnge ^
else -H\e nyvnW e-P
TKC rw*^ Vvr V* cHftr4c+«r-5
w v^w

■folloiV^^^^ -l^c ks+ pyRL-fvft-hVift


/ 'io LftU- />.««% 1/p
1 ]« 1^ ^^^''
5(1 cU-^j "s.fvj
. X ^00,0 S V vw

» rp(5 0<£^ -5 5«s« )t>

L.^^ ,,,
AJ.
I K

^'(1
X

6^
yi

^ms '[<# #?/+> T/ffi-;

f.'-( ■>"

'-7^
S7

C ov\ ve.>^ •fo A Mwwwer/c S-friV^ *.

A2'b
12 rewftiVtft-t^
AO
4^
11 i re»w.<iVJer |2
lo

= O iVil i
io

CoM\/er*F uy\if'^y\€(i 32-t>j'4 v<kIu^ 4-o lO <if'g('+S I

: ut?.io <^ * 44:# :«= 44: 44^ ^

- T/Pf
^ 1 t ur^
Ty/'t;

S+rt/T+s Hc»Me^/c C<rAv€^-|-5


om ve^Sf'<?n
Crvn/6i^S)*<\^
Ai'g rf

3,14.JS^ 26 UD.IO c^ 00314^15^ 28

f^5 VA\l Auivc<7«.(iA1 C^YA^UolV I/^ jiji strtv^ ^


. <# 7^5 #>

:4^-5 Q-^OfjnL- ^
r
o
Scr.yr ^
J>^ OSBK ^AS(^

a S(iy^ l^-^-e^ ,V cA/"«:.^CtW^


^ eyee.o^^cJvv fiAju^iSLjU^ ^
6"^ ii\^ CiAAA-^i-j/
M?

adclv 4oi5

F^RTR
sliftred /
<li'c+)OM«r/ /
V ciyl>a^^^ic. <-
(Tev
^i<V^ -
ds-lrQ
50 (^)(j0/i
O
m(ife£ac;}e
bt,» Her

\
USeR 4. \
\ $+aclx
\
UiC r
V?iriVilles
&?ERAT(frR

l-\GCid C
f toHcv^
DISK laS Byi€S
bUFFERS 7
UCaciCr

\ bui-fcr
addresses \
\ f-j'
\ •Van
liC U ri C
U \
\ boHer

\ •H r I
(S)
M2.
a.

Dsc+i'oniiry De-f I+i'oM


For Miof

picriawARV

prfivi'oo^i
de-f)'wi'*heKi

No we Ffeld

Link Fisld
in.

Co^s F I'eld
T\

Parft we.4-er
F {eld

U
M2..f
b
A-9
Dicfi'ond»ry
For no

: Z-^ DUP + 5

picriawARy
Mf
>

1/

r\
b.-k5 6 ^
prevfoo^
de i"h CM
0;+

<^(p {<^ g ^^5 70<^32,aj


Ni*w.e Field
2.

Link Field
Code Field addr r^un ;
addr cl VUP
Parft we4-er
F ield oddr cF +

I oddr 5^
U DP ■3»-
r.i

r^xr XNTBRPRBTATId/^
V .

Appll
Layer's

U-

:7>.
f'?
T^Xr J-/V TF/? PRSTA TIOAJ ,!»5

S^PSCT ( reaJs line iw4o mes5«j€ hiffper)


^—.woll «+
7

IN-

WeRO di>cfi"onarv

HUH 8SR

Ward's
XI
c
T£KT ZN TBR P TA TIOM

BKPSCZ ( rso^s line iw^o v^essA^Q feeder)


«ol| 6+

kw^er

WC?RD
<d»cfi6Marv
da+«i
sfftck

1■ c ^

Ward's
12
A

T£'X T IN TER PA EVER

XNTERPRST

i/y\-h*l &v\d o"A Imfi

7 (+ick searcU •^eir MeK+


m d I'c+i )
T©«^wd

n*;mber

eyror
EtPcurs'
(T.v^vr^-
Ic

T'e+urn
k
ft's
T£'X T XNTB^ ms'TB'R \

COH?T\.BK

INTERPRET

t/w+i'l ev\d o-f Ime


1
^ (+ick seaycU ■?•«/*
tV\ ai'ck ^
TOUwd
1 it*+«.rpre'Kw^ e**
XMMEI>TArr

eriroir
FXFCCTF

LIT

Te+Urr*
X2
^3

USE R'5 EXECUTIVE

GUERY tts ® SO EX/'Scr ( i^aJ

0 IM i ;

OUIT IA ')
vr^

0 BLK ! ( Atfirh siTMm -prem ke,fLa€ir^^ 't.r


' Jj^
S'

0 -forevfii^
1
RPi L y^ti" P.F fo feiMp'fy ^
CP QUFRV
XhlTBRPRET"

CAwptlc s4t*,'f<. iM+erpvel" s+<t+e-

0>^"
, \f R. Ii' A

•(-W :.1«P!5^
C.l

FORTH C6HPILBR
A p p!I C af j'0 M
L<xyers

Devices

E %te.nsThla

JTn f eh acxi'va
c.x

U5IN& COMPILING- W0RP3 I A


c,x

U5JN(t compiling-

Time,
Scit/ence: f 1,)
® ®
'A*

tfl^+ihr*h'on ^ IxT

exi5f*)ig
CctHPf ler dcriV

Comfih'hj u/fffj ex«cu-f«


dt'c"fi'tf»ar/ v>e.to
e0MPt'l<'H4
de-fi'hi'h'en wird

c>tecute
JiC+iVhar/
'Ah^r*y (atoAI d€-Pfw/'hon word
cMo ^

output

O CoiHf>i'k c( Ex^cu'h' -Hxe. H€U/ fxccfte -Hte


■ c»m.f i(imi uicyyf• Cdiwf* liVij k^cr-J J hew

V OmprMe a wtfu/ o/erd.


<)- \f, t,riWT^
ci
n

dowp I* 1 Mj
r*orm«l tA*ord s * «0~pileJ
b/ s+ori«j €<*<2Ji (^^e -fy'eU aJJress^
I'w -Hte n€)«+ cell o-P iUe ^fcHaM^ry.

** cevMprlivie worJ %" «.re ex€c«j+6^


4"}- Ctfwpt'U -+> W*e. 7"^e cety-h&t^-t-s o-p
Hie d,'c h i(¥\Ay otr^ nch (fC
a-ffec-f-eJ.
Ctf>»Mpn»'«4 v>jeris Uri JeP'n^cf usfys.^
</e-AH/Ha ^ori ( : vocabulary)
fUfew fie -fUe vJvrd IhAMEPrAT?
•pjKovjf*^ -H^ MPt'm'h'ffH- TUi's ^eps -f^e
Pr€ce<lewe& bi'P ap iUe previ'ousl/
AcrineA v^orA »H /"f5 Jtch'onar/ d^Pt'm'h'on.
coM^i'l/na coorAs lA^Ay be t/TsJ
dnly u/i'•HiiV J A&P\hih'lms'j oMa&its
vAAy \/t ostd ei-)Uer itxsi'de «c+.
e.1
Vi.

&;cftvwpUv

VOCABULARY FILES
cle-ft'M&s a Mflw-it« (Ajard^.

UsiM^ FXLES oy+s>'^€ o-^ n- ;


C4vses I'l- -h ioe eieecoFe*/, soJi'4-e.tii'M4 iUe

4CC « 1'yie vac* hvia ry.


Usit*^ iF {t\tfdc. A » j 4)s

: Enre^ piles ^cf •


caused FtuES -tv ift. co»ytpf*/€^ /♦< /A.C

ih'ayi tfF ENTER . /\lo voctfbolary


acuss IS ectf€c4€j,
(jJkeM BHTEfK IS eieecu^edy ptlES w/V/
fee ttccohsJ^ xujj'-fcAMf 6of*ries.

r
c3
rl

MdCA^ULARy mE5 TMMfOJATE


^ cempib'M^ ui/wi.
U^ivi^ FILES A. !
•5 "/Ae xaiMe hovk- v^x/Vh.

Howei^er^ FILES /nji'cf^ a. •

C4.i;xe.S 1/^c^ bc?|e> r fes +o tc dt/ri^^

; eHT£ri^ FTLe5 gef pt/-f- j


73i€. uJOT'ds

IH FILE'S i/ocei bol^ r^y\

TliiS v/ty-s/bM FlL^S /X AH CX€U^yle O'P


immediate u/ort/ vJ(trc/( J(4x a /iJ:/ t/jg

bo'M\ miiclc ooj-stdt 4 I


C4
rl

S'e/e«//>Tfl 0tr -f-exf /rt

•f-eri«m4^€S COMpi ^
bc^iiAS •|-fx+' pre+rtfi^^M ^ ^

4eriHm4f€X iH4€rpr€4>st'f?\pH STATE ^


beg jKi c^M^rlciff^cyi ^^

Us^4 'fv
S-hirj- a^4 coMpih'n^^
Hxy A ho be oscJ Compf Is
or)Hi¥^e.h^c cukJ oHiC/i^
u/fV^iiK €i ; 4e:AH

iv{^ t M 1, 1^ /WbDirr^ ^ I

U 1^ Cnatv |.w.aJL

r
cs

^'•9
TTrc cempi o'P '/aloes'-
a. Ivl^fa/ IS a. Mw»»ter;*c cUaracial/' s-hri'na

et.ample: 123
U/htfe /»fl-erpr€.-kvi^j a, h'-h/irttl tS
h) lamary Odht o/^J posked ay\ko fUe
Jd4n s-hack.

l/Jhe*i Cdi.eaOH ins/de a. S de-fi'** I'h'ff m j


a Ixke/ra! KH«y he. eeni/ae'-k.d -fo I'js
bitxdry i/dlo€j ko'k -fke erf
Odioe ^t%.e sfex ^ k t^os

dfi'^CiTcJ iUe is ei^eoA-eJ:

de-p
is coi^ptlej US

Atc^ovyary r Ctfde -ft'clJ bi*K4ry ^a\oe


LIT 123
2 h^HS 2. \»f+es

I uoUck ejc^cu-f^^/j ^tJsU^s


c^H+eK'fr o"P cell 4^\low\vi^
C iH -Hie di*c.47i^w^iry) onfo
•fi\€ idndk.
C(e
r>l

•Cre
r»«rM4 cam piTi
(AhJ o-Kt&r cei^piU '■h'mC ep^aij'ans ) •
TAifi €'/-fresst'ev\ i024 l(t /
^ coi^s-ht-^i" va he. fke

: s(ow i024 It / —- j
IMlIf j7€T"fi>r»H fit€ di'Vl'Jc wjUfi^ tt<.« de"A'M
/s executed 4Md ^>'1/ +nke op iO byMs o-P
Jtch'crtary sf^ce.

Xp Me Ptl/owina ^eP'hi'hb» /i osejj

: Pasi" C 1014. 16 / J LITEfKkL

"fKe. diVi'de j*I done hjlteM "^15+ Tr cempt'leJ/


atii ^ fcyMr op Space is osed.

Oic-frowary de-Pvr'fjov»' oP pasP

• « •
aJid r V»ii<*ary vaIv^ • •

LIT 64
C7
1^1

4?a
/i-f i'i»\+®^^pre4A+i'o M - +i'wv.e.j
9
- ^ DUP
pushes "Kie pti^AmeHy -fi'eld ttAJr^ss o-f puP
ot\+w •H^€ s-fack.

USin^ f'ke
: ^OR-POP ^ DUP ?
/^esul+s 11^ c-f- DUP beiMj
coiHpvicJ* lUUc^H fy DR^Oc^P Ti
^ e>cecu+€4^ -fUe -fi'eld ^ddrsss
o-f* DUP li p^skcd S'hick*

^ ts txy, XmeDTficTE uJOrJ.

T^VCN^ ^

^ t-ekiv Ccvu^ £vaa<y^=^


ri
-Fr<9
I«"flow J CL

A now- tw4HA£<Jr^-f-e \xfOrA rw ^ • J6*A*H/4ibw #'5


co»uft*led u;U£w i4* e^coc^w+e^ed ( r€y wo+
de'fe^red )•

w^-dc-ferrcdi
© d TcKon ar <xMrtss ccJ^e A'eU

"flails de-AV^rfr^w IS Cic€.C4ji€Jj 0 Ts


© W6cu+ €d rejol+fwq m ftifi +0^ oA
s+ack fUe. drc+i*owflry.

A compiMm^ cA'^rd may weed -Porcz a u/ard -fa


be coMApfl^d </>Uem 'f^e ujord

COM PILE
© ^dAt c-f c^Ai r c -P
<{rc+('»W4ry »f t

CmPXLB

wUfc^ "HmS I's ex6d*t"l^^y cc/'hAPELE /$


e*ccv;+e<i. TUt's +«l<a5 lUa i/b t/f vaIi^c.
wUi'c-U •follows I'w -K^c de"ftwi''h'oM ye.Cn^ ex€c*»M^
ftnj compiles ■rtv^'f va\\j€. mlo +I\C Ji't-fj'oiiory.

Ti\is i'Ccki^i'ive. CAMAo-h ht. t/sg/ iv coMpilt on


rHHfDTA-rE" t/oorc/. ,\ C: . I ^ ^
^K^CyOji^ X'JvJ^h
t Ui.-sOty/ , CH
'ii
£x«*«pl€.s'. I ^
V \i/

I j ?csP coMPrLE- j's smvG-E t ;


iMMeorATF

A/om4 e-P -fke, uf«rJs wi'-Hiin -fi^^ Je'fi'h I'h'oti ;


are ThhE^DX^TBj sd ca^A /i campHeJ
n^rmaZ/y.
tt'KeH ) y -r%e si^ck
Sj'je >'S cUtfckecf bj ICSP y
jS 1^ c^MpilfiJ ivK^o ild "AuT'fjfcM u;Zif*cl\ /5
bc.iv\^ com pried tu?UeH j 1*5 ^}cccu4^J (<i+ se^c/^nog
2)
SMUD^^B mokes -fke 2. u/oi^^ Komd
ond

C fermrno'ke^ com p/lo'fi'OM •

Literal state @ tf

cchAPTte Lrr ^ thbk/ j ihmfdwtc


No¥\e, o'P ikt ujcr'Js w// 'o>f
XHHFPIATE, ro e^clt /s cowp/fed Mormif//^.
U'Kcm Liter /'s <X€cu4-dd -/row u;/-tt/K a. S
dc-ft'vi !'f?*0Hy code ^€Zd ^dAress o4 LXT
\S COM p /'le-d 5€y<^exc€ 2. Ae.'ft*^ t^'hbyij
-fiiiM "hp o'f' yAd s-i/ncM (o-f 5€g«/e«o€ 2
cowprle-liWa) i'5 comp\e.A LIT.
wKcm LITE^A L is ot/fj/'de o*P ^ S
d6*PjKrfj'oM y »*+■ doC5 Mo*tAf*iiy.
Clo
►■i.

XMM ED r ATE ujcr^s:

CompiMiw^ uoords necJi -(v -fof^ce


cow pi*l^+7^*1 o'P XHMFDXATE u/^rcis*
For" eyc^iMp ike u^<?r«/ ^ IS THHeOTATW /*,
uJcri t l/ke. yt^uri'
-ftfrnA 4 di*c4i*oiiar/ szakcU a+ mfc/i^pref--h'we.
This CouU 6c iot^t ky Suft*id{ /H^ 'h mi-erprt^- sfti-hc
u^r^ffciM "K^C ^C'PfMi'f>OH o'P F^'^6'6'Tj as iH
"'A rt/'U't]

: ¥&n.^eT — [ ^ LtTSRAk, — j
This is p^r-periled fcy LCOMPXLEJ
lolxich 'fiff^C€S COWpf fd»'/?*©« d^P -fkc
'ofi ^ r-f

wtfr<l rr XHHFDXAT6.

: Fe^6-Bt — tcaMPriB] T ■— i

rLTXa/)-
C1i
ri

CONTROL STRUCTUReSt
Tke. cctiirof ^h^civres TF TTiSTJ j BF^/a/ UNTIL ^
a// ofhe^s 4Ke -Hajo hro.¥\ol\

Uiic^ndi*4iona I kr«ncln:
adJlr c-f
dichcn^ ry BRANCH
bnthch
address

WKen ty^ecw^^dj BRANCH causes -/^e


Aet¥ -fo i)€ ejceto^d 4t^ HiC,
t»ord m a+ -tUc loy^ahcM
address^

4(i6 -^^16
iV^4€ir prc'l-er^ br^ncl^

. (ihsclu'f^ if-hei^ H^e brancU adAr


/r A 2. ty/€ akco/t^C.
ifHA^A/nC o.dJlT€SS»
UJhtH Hit brMick is
or^ ty^ecwhedj t^Axs address
is sdx>red /h F&RTH^s
JTH +€/r^r€ 4€r Fo i*m
Tcl^Uve, ftiCH f^e addr
s*S eH1\er*a Lor^ 2, hy-Ac
Si^YicJ value tuhicii is
added i'o 'tUe cff^icMis
of- Ty\ re-h^
\/ob.e^ -fiiC bTartclf
is executed.
CXL
ri

^9
al hra v%cl\ *

addv* c4 bmptch
0BRANCH addrtss

u^li€fc\ trcecoWA j OBKANCH


peps +Uc. +^p oP tU^. d[p'ht j
_ .( UWc )
i-P »+ is fUe/yx pe/T-ferm^
'fUe bra^clx C S4»He ax tJ¥\cei^Jt'h*optal
hrpnck^
'■ ^■^^^^)
C'^ixe/rwj'st skjps ^ver
brAwcU pdA IT amJ CKe^u+^x 'fliC.
uk/prd 'f^lloiviH^ i\\ +U€ dt'cijcyia p/'

Calcola-h^t^^ hr^Hcli ^djKesscs'


T^h€. I os€s fk€ cl^4p s'h^ck

durikx^ Cempilc" ^ "fo


hrp.v\cl\ pddress^^- This pt/rMij-s /h</€//f#/A€
i^tsiii^^ c-f control sd-rochs^C-S.
y^e-fvrns •f/^e Address cf^ -^e

hei^+ avAiMe> \oceji^>\ ih dhe dich'ofipr/.


cn
VI

2 b/fe »*el<i+iV€ lorar\cU ^MJresses

here IMMFDrAYt

! UMTIU CdMPrtE 08RANCH HERE - j J


TMMEPlATE ^,-
• c^teuld-K bAcktvtvJ
branch
•••
SI 0= UMTIL S2 ...

BES-lM-HERE

• ••

: IF COMPrtE OBRANCH HERE O , ; IHMej>iA7S

: them here <»veR - 6wap I j xmhepxatf


CAUula4-£ -forwa branclt

... jp SI 52 THEM 53 » ••

rF-HERE

OBRANCH
Ci3
rl
■ft'3
B^XAmple,: 2 b/fe »^eU+iVe yraytcU Addresses ^ b

BEfrlAl HERE IMMEDrAYfe

UMTIU CGMPrtE OBRAMCH HERE - J »


XMMEPIATE
!- V- ■ '5, ?. v-^

• • •
b^g-im Si 0= U^JTIL S2 • • •

OMTIL-HEAS"
BE&iaJ-HERE
BH£AE-
Si o= OBRANCM S2 • ••
uHene"

: IF ccMPruE 08RANCH HeRe o , ; xHHepms

; them here <»veR - sioap i \ immepxatf


CAlto'.ft'fC. •^y.c-n 'o>'rJw.C-U.

••• IF SI 52 THEM 53 • «t

THeM-HERE
tf-heRE
aT sau
•• • obaamch TH6AS- Si S3
rFH6AE
cn
rl

: 6LSE COMPILE BR/iA/CH HERB O 5 a

Swap CcdMPILEj THEA' J IMMEDXATE

... jp SI EL^E" 52 then S3 •

IF-here

08RANCH

: WHILE* CCOMPILE] tF 3 THMBDTAre

i REPEAT >R COMPIt-E BRAMCH HERE - ,

R> tCdMPILEj THEN) ; XMMEDIATE

BEfrlN SI while sz Repeat 53

BSS-ffl-HERE

Si
C14
ri
fis
ELSE COMPILE BftAAlCH He-RE" O 5 ab

Swap CcompileJ thea/ XM MEDIATE

••• TF SI 62 THeN S3 •

ZeiSB-ffERB
xp-HEfte lELSe-ttERE
o
%•
OBRANCH si BMNCH
XFHgAe

: WHILE CCOMPlte} tF J IMMEDIATE

: REPEAT >R COMPft-E BRAAICH HERE - ,

R> [cdMPILEj them 5 IMMEDIATE

•• BfifriM SI MHILE 6,2 REPEAT 63

while-HERE
esC'lH-HERE

Si 0branch
CK-
rl

^9
ELSE COMPILE BR/iA/CH HERE O 5 abc

Swap EcOMPILEJ THEA# J XMMEDXATE

TP SI £45 r S2 THeN 53 ■

TU&i-HmS
ZSISB-HSAS'
TF-HERE

06RANCH ze^ezB - Si BRAAICH T-HBfte - s^ S3


iF-Hene le-HERf

WHIUE CCdMPlLE} tF IMMEDJTATF

REPEAT >R COHPII-E BdAMCH HERE - ,

R' CcdMPILE} them J XMHEDXATE

-*• BfifriM SI WH1L% Si REPEAT S3

2ReP-HERF
iRS?-HEfeH
wHlLE-rtERE

jtr B'HERB -
Si 0branch afttP-HSRB- Si BRANCH S3
u;>HERe 1 Rep-HERE
ci5

V < fisFORTH control structure comrilins word definitions )


1 ( no compiler security )
2
'
t -> BRANCH
3 here
HERE - # -}
OVER ( £^ACK
SWAP ! in$ Instal lation Manual
4
5 IF COMPILE OBRANCH HERE 0 t ; IMMEDIATE
6 THEN ->BRANCH ; IMMEDIATE
7 ELSE COMPILE BRANCH HERE 0 /
6 SWAP CCOMPILE3 THEN ; IMMEDIATE
9
10 BEGIN HERE i IMMEDIATE
11 UNTIL COMPILE OBRANCH (-BRANCH IMMEDIATE
12 AGAIN COMPILE BRANCH (-BRANCH ; IMMEDIATE
13 WHILE i:COMPILE3 IF ? IMMEDIATE
14 REPEAT >R COMPILE BRANCH (-BRANCH
15 R> CCOMPILE3 THEN ; IMMEDIATE
OK

0 ( fisFORTH compiling words# part 2 )


1
2 t DO COMPILE (DO) HERE ; IMMEDIATE
3 i LOOP COMPILE (LOOP) (-BRANCH ? IMMEDIATE
4 t +LOOP COMPILE (+LOOP) (-BRANCH J IMMEDIATE

0 ( fisFORTH control structure compiling words# part 3 )


1 ( redefinitions to add compiler security )
2 IF ?COMP CC0MPILE3 IF 2 ; IMMEDIATE
3 THEN VCOMP 2 ?PAIRS CC0MPILE3 THEN J IMMEDIATE
4 ELSE ?COMP 2 7PAIRS COMPILE BRANCH HERE 0 #
SWAP 2 CC0MPILE3 THEN 2 ; IMMEDIATE
6 BEGIN 7C0MP CC0MPII.E3 BEGIN 1 i IMMEDIATE
7 UNTIL 7C0MP 1 7PAIRS CCOMPILE3 UNTIL f IMMEDIATE
8 AGAIN 7C0MP 1 7PAIRS CCOMPILE3 AGAIN ? IMMEDIATE
9 WHILE 7C0MP CCOMPILE3 IF 2+ IMMEDIATE
10 REPEAT 7C0MP >R >R CC0MPILE3 AGAIN
11 R> R> 2 - CCOMPILE3 THEN IMMEDIATE
12 DO 7C0MP [COMPILE3 DO 3 f IMMEDIATE
13 LOOP 7C0MP 3 7PAIRS CC0MPILE3 LOOP } IMMEDIATE
14 +LOOP 7C0MP 3 7PAIRS CC0MPILE3 +LOOP i IMMEDIATE
15
Ci(fi
fi

•Pi'g- F(?RTH Coi^ptl&r $ecoiri'4-y


I

4e+ecfs And alfor+s an »»*os+ errors IMN/O /vim


5
CoM+rol s+rucfurcs:

iMi'ssiMfl pftrfs o"P 4 Cdn+r«l s+rvc*fnrc^


iMCtfrrec-f- wcs+i'Ma^
use o-P e^iupi'fiHd tv^re/s oc/f-siV/c 4 i Jet.
Secwn'+y vvoris:
texec f-P €%€Coi^^ /H SXBCt/iioh S'h+€.
C ivi-^trprfhk^ioyi r-fc/e)
Joes ho-ffiih^
oHie/rwfsej an A^Bd-RT ts ^}ceco4-ee/.

?caMP o^fosH'e a\9o¥Cj akor^ t4 nci"


e%tto'i'eJ u^Uf'le .

!csp shres ccn^B^'i'S o4 SP ostr^


V^rr^bfe CSP

?CSP /-P Cch4t4rhs of" SP ^


ceh'H^'hs o4 CSP

?PAIRS ahor^S shtck vaIocs'


aire Nf&T I

/o^
C17
rl
-fig
(Jii. secuKi-fy ^ofJs ih vjtf'J %:
COmpi/iHA S«curif^ acMoYi
vjord

fexEC Icsp

?csp

BBS-IM

UNTIL i ? P^IIRS

IF 2

ELSE 2 ?p/^rxs 2
THBhi 2 ? pAX/e5


\ Lt^P ] fPAXAS
I +L©-e-p 3

BE6-IN

WHILE

REPEAT 1 ?PAIRS 2- 2 ?PATR5


Xl.H

APPRBSS TMTBRP/lBreR

Appl>
Lay e i^s

Pe Vie e

12las /

€r d-e

(2)
■ -i- .

f-
t'

I . 1 ;
'
-.
!
j
'
!
' ,

H V-fT^"^ n^clr^^

: 1. i- ,.

st«f> C0( cr

! ^ - -^--^
f^se^ ^ eXliij
'. mA^ V^ LAjrt^
;r^

V
t t. i i j .
r4
A

^3

1
oy

V +

J- X
) ) )
A/£Xr F^RTH'i Address X^h-her^re'fer-
«r

O)

iv\ a cli m €
Cod C

ecV
\
,a.nj
y Vo >A
,v^ rc+ory* jowf NExr
\.. s+ftc k (1) IP 0 0 w / xr
q/^

(2) a IP ^-!
(3^ W @ (5> PC J
'/^"
\
0<\
" ^ fc.
j </l +x (9 A
i+ j>i t- (X")
(5) d)( (9 di (^) >13W+S
I
<^049JI
J.X3W
3 P®'
aw't^OovM
« Mn«4
0
:Moj
c c <L
A"}
p,

sP
QJ

9)

i■ O
o

• •»
Of
b
Ul
*2
a.

■>

s:
o
•z

3k
<0

M-
o

•2:

—i 3t ^
h
«l v»
w
J
lU
><►
lu

©
/ J OtAO I4.?|p
©>
E*ECUTiJa/ ©f wrxT

ifviacUivie
code

jomf NBxr

5
S.
o iruyi: ^UtMp NEXT
H
o immsj rovk*

juwP NEXT

JOMP NEKT

do+o
^+«icK e^^ac k

-t t
) BtBCOTlihl of d*- NFXT

i^acUiiifi
co4e

pup

i^uM
:

i.
o

o thMl

-H
o IHTERPMJ

reTurw
6+ac k

iCa/>
IS"
e

»- (u
US
eC 5
cC

IS
G
JE±

««iC it J >9 tAO 14>? t P i//<


^« c. I I u r* ^ t f
m
tc
m
n
c
V* - c M H
» ^ s
V) ♦ H
\> •• f
o
-h
c
5
••
^'
c
2
-•
z. </)
fn
Xj
si
XS
3

Itf
'Z

m
•>

/J 14-7 IP tf
<lic+i'©vi«» ry
H
SX
XS

/ J OiAO 14.'} I1>


//'
) ^tBCUTl}hi of d*- NFXT

macliine
<odd

jtMpNEXr

i.
c
s*
o s jwwp NEW

o iRTERPRgT iron 5

junP WBXT

jONf NEXT
reTorw dlo+«
Stac K
14«

xS)©'
.Mi
j;-a
Iff
k

V
^'1
s b
15 «» tti
*2
V9
II a.
m
* -n

lu

*
<0

<4-

"a:

. i

o
lU

lu

KJt OtAO
20.
If
A
Ktj
Itt
"Z
o.

">

JC

o-h
-«in

M-
o

"3:
••
a
•>c. * s . lo
u
h C< o
_r
j
lU
ry ^
lu

/z/
wP <1^ <1^ ojLAAjeo>e^
'j'-Ccn^e. ii\t?*-j)ta^et- .J^PA'>CflL y}d■'j
C4jy^

Oo

ccw, tfwLXi-l/
FoK.rH 'Uo

h'
L/'
j
- ^ d.ecLc/i^^cx,
^J>Jt
_ |wva^ ^

I V j^' \wA«^
OV <P^ tU_J;fvU^
f , \ .oC'Km

2-2.
^ 6i<',
m

CaI{^ '5,f^AT ^--><^01? Spi^Al


fE

^ I^ ^ ^ ^^-f sp^ "7

n
VI\(\l/^LC ifSTAKT

"' &^^hWT -(iNNs^ a4J\') 2.^ ^C771<V


Q) -f- iL^cic ^ ^ px>A^rti

\J' ^ i ^'fW?
j ^od> ^ j>o X X ^e?M£-/vr / toof/^
•• .^flRA>' o Xo Cp. 1 . 5mr^ Z I Lc^f)

V/Xa|!4,|i_0i^ ()J^N(M/\ iV^U A


./ , I
- pry/l-llAdL-^ -^C '^') S^CIC

(•^x) I
0 /[^Jf^XLABlET ,
(9hja«
^fvyl T /\N^A'Mf^E ^•
i/Wa^ia^le^ (^ XLBA^x)rr !j
^7- I

: 5^^ /Vi/Aiu^iiT (2;|\l 3on x ? loot j

tg)
p- - ^Z %

-ffyyp

ST/tT£- @. <

/^-Ajp Qyi~r
<r

U/tt^/ "rw^/

y/yCA-zJlM. 3

Caj V-c»v
^5" J^ZTT-^V/*^^ l\J^Q. f^ 0*^
aJtfi^xsr' •ft

foW

ff
j p^s J'Oif'/ o^iUy tz!
_ ^W\ ^W5^T M U/tO-^ KajC H\ A^e/«14_^ /
^ ^3"'^ A4<*X^
f
4

U/
6il/fv 3

C 9 Tr/
f^hySl -£frcv>v^
0
& X )

;3"

fed 2 rl !\lu'T^ ■ ^Cii> Sy^o!-*/c rurt C(yi^

3" £> Lo-Jxixi

c
r
'■^h^ (k^P(P(^ APP 'm&

5 / l^L5i^ A
F
S3

:7z<
U'tp!^ r

< 2^J>\J? Ya^ OC ]p DKoP ei^e — OCy

^j>vjf x<3f^ c)< _ IF o/?op_ o<; 0- — o<


CKFW j,

^ScR ftF^ *> -a'P c)\ /^ I hJu? X

L_ f=Lu$H ^ O X>0
BUfFE^ L-^ofj.
v.l

FORTH VOCABULARies

A p p ii c af rc n
Lay e rs

Devic

f xfens/

./27
V.2
A

•fij

give f "h'^H v<av^€$ scoft, by rtfs*frfc+)'wj


di*c+)*o>id starci\€.s i-o ^ suU5€+ o*P -KiC
di*c*h*dH«ry • TWii Jul>S£+ lac. a j€/k\£.rd/
-f-rce s-fruc+t^re.

f{elj

R»RTH

F<H^TH
V.2
ab
■f<4
i scop^ lay v^tfs+r/c+i'n^
d{cHof\ar^ se^rrcUes +«? at suU^e+ o-P +<<€
drc4i*0Kary- TUr^ Jutr£+ Ki^y i>e a jcidCrd/
4-rce S'frucivre..

fteU

RSRTH

Xf

ASM

ASS EM BlER EDITOR


Y^l
Abe

die-Pi*viI "h'dVI v\dw6s sco^e. by rtfs+rf'c+j*w^


d»*c+)'ovia iry se^rcUci +o a, suU^e-f- crP +ti€
di't+^'ortary. TUt'f Jul!>re+ K^Ay be a ^eMeral
-f-rce ^-frucfvre.

■PVeU

u
F©-RrH

APPLICATI6M
F<?-RTH
X

assembler tPIT^R

APPLICATIOM
V,3

•fi'9
fibvi y^e^ofre ments:

TKe 4tch'cha\r/ is owe v^e^ory ^re<\.


Space is alloca-hed JeaffoM-f-ecf h'kc
A s-hick.
De'ftk%tHoy\S ¥^a.y be addeJi h> en/ \Joca LoUry
0.^" Civsy iim€ •

/^eeJ A yoit^-I^Ar i^o /^€ de.'fi?Hf*'hbyt jh


eAcb y/ocAbohry • TKi'r poiyy^cr- t^usi-
be clxAkK^ed eacli a dt^^t^ih^oyi is
Aided io -fke socAhoUry,

Musi- be abk -h ckaiyy VtiC •^irs'f de'fihihbyf


0-^ A. " " vcca buUry +o -f^e Urh
defiy\ih'oh 0^ iis parenf vocAboUry^

(^\ Must be Ah(e -fv /he sob-hree,


cjKi'cA \jj\\l be seArcked•

tAusi be Able 4o iJie^iify fUc \rtAj o/nd


fA^n'fe yiocAbolorits sepArA-hely*
a

-ft^9
F^RTH ifviple Hr(j^u€:

FdRTH
PHFrNrrr5A/5

CONTBtT CURRENT
;VeM 1
VoCAif^Unts fo fc€ y/ocA \»o(a ry
^ searcUcA u)Uer6
h€jc+
u;fll be
b
•ft'9
•Pi'g-FdRTM irnplemeMfa-H'oM +ect»Hi'at.;€ •.
O
F<?RTH
P^FTNTTI&t^S

6 '

F(^RTH

CONTSXr CURRENT
/JcHh-fftS i cr AiOft ASSEHBIEK
VooilfoU ries to fee vocfi. bcp/d ry
^ SearcUeA u)U^rt Hit
h€|C+
tufll ht,

ASSBMBLER
pbfimjtwns

i"r^

^53
vz
rl

VOCABULARY

V OCA B UUA R.Y FORT H

VdcABULARV AS^BfAZlSfl
VOCABUUARV EDITOR

Usi*\3 voco^utories
^ Voca b<;lary-. v\aiHe s+ores -ho hameJ vocahohry
ih C&AiTBXT.
idc MVife 5 voc^ boUi^y sob irt^.
\ajI\{cI\ »>iay fee Sftse^i/^nffy
seArcUed.

PEFIMlTlONS sefs CURREMT -from

C^TEXr
— pu"f neuj
de^-iWh*©*^
I v\ fI*rs+
C(9-MrB)cr
VocAbi;lar/

( colcvi) ^e.fs Ca-fXTEXT 'o^ ct?R.iL5>/r

SeArcU
CU RRgMT
N/OCA buUl^y
fVs-h
Vi

CO/^TEKT voeabuUnes. b

^ppenJ Vituj iicfrKi'froMS fx> -K^i current ^gcakolnry.


ExotMpU:
Assw.v.e Fd-RTH h ho^ Career «u<<l currbht v^c*Uvf.
ASSSM8LSR FOATrt . asvM
cW4H4€3 <l^TFXT
CURRBMT -» vecA boldr'y
C^^TS XT V0C4
vecAltuUry ^

C&PE MP'P MG*"T

>3:
V4-
b

vecA VjoIa R>RTW / ASVA

Cd-MTSXT
^ CURRENT
veCA WoU i^y

: STUB NdF
V5
b
r2
^ OEFlNmOH^
C^^ITGXT

^ tuRREMT V0e4<>tfl<irt^J
+p 4sse.w bit** as*v*
PSRTM
cdwrexT
4 cuRRewr
vtfC4bc;i4r!)^

C0P£ t^E\N-NC-P NEX T

M AC NBJJ-N&f NBuj-M&P

f VOC Cij(«7r)(T © ^-
WTA Xj>. '
D.|

OBFrNrN& \a/^RPS
^ of^ )f\OvJ \-o M/ri'Vfi (K c^nifi 1^1^ it\ "2.5 u/ards j
AppllCafi'on
Layetrs
U5rNO DBFINI14& \IORt>S
/■(■ma

de-P

d^Tihr'h'w

1
eyecufe
1 wor^i
exi's+iMj scotrcje.
camp Tier 1

i /

iic-Pm tM u^arJ C)Cecu+€.


dy'cHcnary v\e.io

1 dc-fi'M c'-h'an compi'lfir

f
uJcyf^At eyec.(;f£
d^^ + '^>^^^y
d€"P W0V^4

^ u+ p t; T

Cof*if>f k ^ fiieuuf 'Hie. yieio Ekcco^ -fiiC


uJorJ* de-fih iH^ tue'rd J y\ejuu h e.Y'
C£iY\pf\c C( y\ejAJ u/crd.
kti€>i^bt^K Luord^

(S)
Pi
rl

0€F1MIN6- VdRDS
ay^e e;c^cu+ej^

Cr€iif€ 6v\*KV€ yvew dc )v^ -HiC

dic+!W4 r/.
Pre dc.-fiKed de-fi'wiVj cAJoy^ds I
C(^A/3r/^A/ 7"
VARlAS^f*
iy5F/?
V^cA6t^iA/?y
C<SrpS'

f's posstbl^ ft? cre^ffi ^orJs


i ie., $^ecf^\i^ed coi>^ filers ) uU/ch can
suW 56^ t/ev\*Hy be used cre,Afc
neiu -Pam]}y cp tMeH<i>er '^or^ds •
^orA s Are use-Pt^/ Ar

sf-rc/cf-ures oaxA procedures-


sUart A. €xecuTf'A>t -
be k^v^Yfr*
Pirop^ use. CAvs, S o yt /Iy
neJuce So*f"fu-»are de\/elopwiev\"h -h'^Ae^
rei«;ce progra»v\

iv^^ros/c ret^Jia I)} 11 f y


uui Mn no eAecU^on-'A'H<e pt^cdiy *
PI

^'9

om e,Ki*3'hin^ ooorJ I ) /5 used.


7"A)*s occurs ad- se<^ueHce .

The, de-fihi^hon sfcci*-fi*es di^e


COYYij>)\e - a.cd)Vi
ay\4 fhe

eyecAJhcvy "h'l^e (Hc-h'yf dy ^3^


e€tc,l\ v^e,mhe/r o'^

The -fiorr^ o'^ ^ ¥\e^ ufcrds de'ff^pt/'hhyi )'s

<6uruP5 a?vw(i>i'k- +/m.€ words

D(5^ES> execu+ioh--liW^ words


0 or

JC(90E asses^hl^

5
P3
n
•Pijj
o-f a hiah-l^vcl Ji-fi'hi'hffit of A.
u^oY^d: VAftlA8L£'

©
wiemtdr
3 variable

crtAfio¥\ ~

dicHovyary ^— Z Wy4€S
/
h-P A-P «-P v^loe a^- X

c©Je +i%a+ pvrkfir +Ue


address of- -He cell

©
/^vnfilter
3 X 1
6.X€^+l(?W- X ? (CR) 3

f{(p
©
d€*Pmiv^A
VARIABLE

u;oj^
Creeitibw-
<BUILDS D©^es> '4.n w
fi'v»Re
YVni
/?

ilit+i'owa ry variable <60rLDS 9 0©es> ;5


tVp K cf

© d icj-torAry C /^iVi Jr<tu/iXy


rest/1+
X</i »J>
>r-^
1%V
•■ C^N^r/^NT <i5^.Li>3 ;; i)o^>;>
y. WcU^ W
P4
rA
-Prj
Crea+e a 1 Oi»v«eMsi'»hal byfe arrAy
Dfi+€r»win€ +i^ c«K«pile-"hW& Ac+iie« o-P »vtewl)&r u/erJsi
y^eu/ dc-fmiVij
5 CVECTi?-R LWf
U$£ t .. . . t
u/or4
Pe+er»vn'>\e +K£ €,)C€dc''#)V»ii - <id+?'€>H o-P ivienitier t^^rds*

©use
3 LTMf C@
ve+unis /tJJirest e-f
vmam ber
u/ord
SabscrYpi-' seiecied L/fe.

*H\€. wen; \juor<i:


"Ko, c^'U'?

: CVECT(?R

cr€AH <BUXV.D5 /<LL(^r 0&ES>


woird
run;

di't+ipwapy CVEdTdR <Borup5 ALLOT 0ȣS> + jS


Ht 14 c4

/© i ©
(y dfctl" OMA P LINE"
2_r<\ \^G<yfxn.
n-f i-f e-f ws,e ^ ^ -f
i)\i;^l^Uf f.\^
Z (yt<?
. V'^CTof^ •^gv.HuP^ MbS>

J-f 1 )^T^5
PS
rl

Bxckimphs o'f uSit\6 LXNS ;

t FXLL-LIHB so D& 65 T + T LTA/B Cl


L&&F :

i PFlNT^ LlNe 5 O D& X LIhlE C@ BhTT


SFACE L»^P t

FTLL-LIhie oh

PAThlT-LJMB A 6 C 0 E ok

\/ai''i*<i+i*dHS ew Cy ECT^R:

S ub Se.ri'pi'S S-harj-i'tt^ "^rcm i. {tyisisaJ o)


: cnbcto-r <bvilps all&t
P©€5> + 1- 1

Imih'AUhE j^emfeer arrays 4-o blanks \oket\


Hi&y Ats cFsaj-ed

: 8LAWKfeALL<»T ( asH,y+€s — )
HERE over BLAMKS
Allot :

CVBCTOR <6VrLDS BLAMK^ALL&T


OOES> 5

&
Dfe
r2
^'3
Chick suhscr/'pf" oyt iaeh referstKC
io all im€.m u/oirJs

A'lwsf sforc <*rrAy 5)'%e I'n vytcm heir's


^ V
-1—I—t—r
^icfiohtf ry z.rvf

P<^S>

: cyjBCT&R <6UILPS OUP , All&t

o&es7 20UP @ U<


^ tKec-ks -par- l\^c.kr
y\e^aH^c ^r<)^
rF + 2+- s.;bscr,>Ps
£25 F (® . .
," error" AB^HT

TuefJ

Pefinihon in ROM j Ja^ik in RAM (uin'hable


mC worv)
ROM
RAM
LTA/F

«-P\ H
\>oe&>

I- j^'

Ly
CWeCT&R <8urLP5 THBRE , ALL&T

pe-e5> @ + :

LVS-
P'?
rl
•^*3
Vir+udl Array : i'm 'I'Ue I'oMO ry^
dla'fa OH HtdS-S sforodd
s-far+
bicdk#

subscnpi*
b/e^F
B/BUF
byf-es subscn>t MdD

BLacK

CVECTOR <t>UXLt>S sUr-H bUck# , DR&P

P&E5'> @ SU^AP

6/6UF /MfTD ROT +

BLOCK UPDATE
P8
tl
•ft'l
D€+««»«^ ufcrJ : CASS": 6xecoii'cy\
vecfor

Pe"Pm€ cas€,s

OFBt ." D^<^- " *, iper " CAT "

i ZPEr ." RAT " ♦, : 3PEr ." SNAKE " I

Us de-frhinq MorJ

©
Source
CASE: ANIMAL oper iPer ifbt 3P£T

dsfmiVoi*!

CreA+iwA Je+i'iirri^ u>or<! / ^(T

: CASe ; <8WILD5 3 SMUD6-E

©) K>OBS> Su^AP a* +• @

execute :

CASE ; rok\; <6UILI>5 ] 5M0DG-E D0E5> Su;AP

c-P

©
rcswlf
animal oper iPer ZPrr 3PE7- ;3
Jlf

Usi'ma member wovj f--- ^5'


mS-^^V <p^
C ANTMAL ^ De-6- ok
© 1
3
A^^rMAL @
ANTMAL
CAT
SWAKE
ok
ok
^On^PB :
Ad

F^RrH ASSBM BLER


App 1'cafion
Layers

Devices

E ^re,ir\S i b Iq

V,---
I '2-361 SO SHtEIS SSOUAtE
■2<uV '2'3'3 100 SHEETS S SOUAIE
A 41.369 300 SHEETS S SOUAII

tA 2: 70
G-
(^
2 c_ . c ip* o
ro
t g> "S £ O 00
e tk
r» rs Ci-
o -s ns
(p m Qa
n r o
Vo d
S- vA
Ci n C
rb o
-j^ -f s P 3
A ii t £
o
v» o
o r> I -5
lA <; -s
Jft TT ft-
o 5
r ^ vn r\
d- n c. rN
I vA
£ ■"D TT CP
gi — ♦ cs^ 7r fb p P
fb P
UA o '— <<» o vo o "5
C_Ck
g~ d- A
<. VP 2r-
n> 3 c c ip -x-
c
«» Q — 3
o Sv X*
Cs- ft A 5
5 C
I 5 -N
5 Si
Q_ X X 0> -hk
O
3-
ft
E VA d- fN
i/» O -0 VP (*^
fN' n n> •3 lA
;si X I 3
•d Vn 3 Xk_
c-a r\
d:> m
O' s
5 <1- Ai
;r* s> £ p" I £- z
<C_D \A
5 cJi
;b tx>
~x (S- IP
CA
CL. yr 0 r*
Q r«> d:
dr <Vi:
nl
<T»
lA p>
£ 7^
to £
a O
3"
r r
r> 0
rv 7C-
o fb
§ n 3 IP
5__ V^^ (^
lA
t 1
n *0
&
c •%*
ib
n» i/>
d: i £
Ci ft
X
iA n>
:t
X (p
<ja
r I

OSE/K&S:

CO'DB !
lU
/

CREATE*) cl^*c+l'^^^ary ^Ssewttlfi^ wotAs Juc^p aAAt^css


V\^aJ •/toIT- '*y\avvK^" ir-terals i*n'terp*^e,4er or
omA »*viyokes F<^RTj4 i/«/ofAs {Mv I"h *f^ ^k eK*
A^SSMBtER vocahoUry
"fke C&hiTTEXT y/0CA\avlarjf)

H?<Avvvples Are •Ar Lsr-fi poi^ r^RTH


^ 5

'»**"

« HAdmg S *. Next ( vM.46rd) Ajolre^x i'v\'f^pre4^


YO-p TMP JrscArJ +op S"frtck^
]ymp +1) NBXT
?VSH TMP pt;sli O om+o s*b»ck^
jy**Ap -h aJE^T
PuT TMP S*fere ^ ''H"k> -fop 0-f
S-fttok^ jy»^p "h HE XT
WAIT (v^acro) jy^Hp ha^ IK+a&ker
( l/Ke Prtuse )

Asss^w^Utr vuor<ls;
i. opeyftvU Jh. s+roe+i"on s :

I perA VM VVi rC

eg. CLR ^ ME6-^ ASL


2. op6YA^^J iwS'lruc'b^dvAS.'

cles-})v\A'Koyi-opera hi scufCt^ope.riii^A iMMewoM/c.


APO M(^V X(^R

( crJls^ I's OM 9o8o !f. )


L/'STl
/\3
r.\
We regis'/^s^ v\yjv^e.r)c v^l<^€s
t ^ J res s€s)^ tfind
A^iiJressmg woJe \A*^Jr"fi*ers •
Rej^'sVfi/rs :
v\ov*4 Wey* wAvvi e essign Hie wf)
0 scr^ -ficU
1 scr<a fell
2- w
3 u vai^CAble*> W^se
+ I XtAH-ir pre+er
5 5 ^•Vtidk
(<^ R Re"k;rn sia^k p^in^v^
7 PC processor!s Cavn+er

XA\wei«^a+€. dU+A ^ a<l^ reuses r


vali'C i=t

CS-OE (9-N^ 0 1# JWP


^3*
C TraJi-h^ytal Ai5e^4W /yn-M;c; H^V )
\M.ocle vwddrA*€.rs*

ReU +?'v'e dJiJirtss /Vj re


3

eg. C^J'P^ MINIMS ^ MfXT

ReUifv/ey posf mcve»ueM'h reg

eg. C^P^ DR<^P 5 rsr Nexr


( Tv^aJ ktX I TSr (S)-H )

R^-U-hVe^ pve c}ecirewe4\+ ve.^ -)


LAB^U Pt^SH S -) O NKSV/ AJE-XTl

C TraJi'-hiyAl Syn4«tt: MW (3,(5-) )



i? 301 SO SHtlTS S SQUARE
) 307 100 SHEETS S SQUARE
vj 47.309 700 SHEETS S SQUARE

c>
-5 5
Hi jx-
l/>
C

o
to H
5
O o o ~ CP Ql-
< O c_&
US m rt»
II V A H-
cS>
rs a
o
2.
H 5
*n
to

O 22
TT3 r*3
Ci c if'
< o
£Jb £J>
I
"S I C
•< -TQ
^ ±. cr o
a
C3_ A
-Ti ±2
a s>
<L_a
uo
CA
c-a csi
{*»
l/>
A m -o
r- lO
CA fs to c lA ^
i/» -o
(T7 "1 H a
r5- tA r\
(>0 C 40
(0
^ vA K> m

lA
J s
ni "V ^ iP
I

m s Z2
2

—f
3:
m
21

Ny
43.3BI SO SHEETS i SQUARE
•S- 42 303 100 SHEETS S SQUARE
) > 43.309 300 SHEETS S SQUARE )
n/jtrton/JH.

H
4r-

&
4* o
-1?
(«>
H CJ> 5
t/>
c
5 z
r-- •%
5 r 1 m
$1 \A I'X §
-0 X
CX) z.' *«
-t I

c.
S'
r %
r
Va >•
>
c. I («>

?
r*,
5 rs
rb ^- £
t fe-
c ? •'
-o c. Y
-t-
ir>
tn
-o 5 S:^
o rsr- H
In

V X
H S
r
7:
5U s
si
To
5^ bl
~+-
I
c X
n /T- trt
•i
i h
K
V)
n) H
O
O
o 'm
T5
•X)
r:
■~V3

i>
3 — ! Vf|
0 ( Solutions Multiexit )oop structure )
1
2 » (-BRANCH HERE - #
3 i ->BRANCH HERE OVER - SWAP } f
4
5 $ COMMENCE HERE 0 i IMMEDIATE
6 i StWHILE COMPILE OBRANCH HERE 0 » f IMMEDIATE
7 i CYCLE COMPILE BRANCH 0 #
a BEGIN -DUP WHILE ->BRANCH 7STACK REPEAT
9 -2 ALLOT (-BRANCH f IMMEDIATE
10
11 t MULTI-TEST COMMENCE DUP » 1 - DUP &WHILE
12 DUP ♦ 1 - DUP &WHILE DUP 1 - DUP Si WHILE
13 CR CYCLE DROP
14

10 MULTI-TEST 10 9 8
7 6 5
4 3 2
1 OK
9 MULTI-TEST 987
6 5 4
3 2 1 OK
6 MULTI-TEST 654
3 2 1 OK
2 MULTI-TEST 2 1 OK
46 EffiPt^' Stack

0 ( Multi-exit se^Juence structure )


1
2 t SilF CCOMPILEr SiWHILE J IMMEDIATE
3 j FIN BEGIN -DUP WHILE ->BRANCH 7STACK REPEAT
4 DROP ; IMMEDIATE

6
7 SEQ-TEST COMMENCE DUP 1 - DUP SilF
8 DUP » 1 - DUP &IF DUP 1 - DUP SilF
9 DUP ♦ FIN DROP i
10
11
12
13
14
15
OK
10 SEQ-TEST 10 8 7 OK
4 SEQ-TEST 4 3 1 OK
3 SEQ-TEST 3 2 OK
2 SEQ-TEST 2 1 OK
1 SEQ-TEST 1 OK
0 SEQ-TEST 0-1 -2 -3 OK
46 Empt^ Stack
/ —
dcLe

IPj Z^hZS
5^rV fc4?c^+ ' cf\-

^Txj\ic-^iA<

^r e c,

.pl^-ALUT

/6 &-i:)£D.

fA._ U\/w K
/ !«.

lv><t

*5:-^

: <BU|t_I'S , l:>o^sy
fr«s» C^.
t^'r ^

.=vi^

C*AA-

@) 5"(^/V

\ ®)
/
r -'
-

Uo^D£Z)-BY [' <B ^ I 5^0^3>

TU P/'(^ P^f^TH r■ IL is>

fUJ^
K -p I p"o|^Tf-/
"C^
iXJ:

'V-L/wHr^^ C''"^
c-^ /J[^© .Oou;> fK
2>oj^cW-
/!o5i
vvJ'cr' .A/wu)"^ ^0£5>

V y