bigforth-english.pdf

(2089 KB) Pobierz
bigFORTH+MINO
Documentation
contains AndsoForth...
BerndPaysanJ.L.Bezemer (AndsoForth...)
c 1991–2003byBerndPaysan
Copyleft—allrightsreversed
Dokumentation
Introduction III
Introduction
1.“RealProgrammersdon’tReadManuals”
W ell,itshouldbemore“RealProgrammersdon’tWriteManuals”,astherehave
beensomecomplaintsthatthefreeversionofbigFORTHdoesn’tcontainafree
manual—theonlyavailablemanualsofarwastheGermanmanualforthe
commercialversion.SincebigFORTHisahighlycomplexsystem,amanualisnecessary.
However,togetstarted,youcouldaswelljuststartbigFORTHandplayaroundwithit.
Ifyouthenstillhavequestions,thelectureofthismanualshouldclairifytheissues.
Notehoweverthatthisisstillworkinprocessandthemanualisneithercompletenor
accurate.Ifyoufeelabletocontribute,doso!
Weproposetoreadthedocumentationpartcompletelyandtrytheexamples.Ifthere
arequestionsleft,youcanuseindexandreferenceparttolearnmore.
Thismanualassumesthatyoucanuseyouroperatingsystem.Thefinalversionofthe
manualshouldcontainarealForthcourseanditshouldbepossibletoreplaceaForth
introductionwithit;howeverthisisfarfromcompletenow.
2.History
bigFORTHbasesona32bitportofthevolksFORTH-83authors.volksFORTH-83is
apublicdomainsystemthatisavailableforAtariST,IBMPCandC64(therecalled
UltraForth).It’sa16bitimplementationwiththecorrespondinglimitationslikea64
KBytelargeaddressspace.volksFORTHbasestosomeextentsonthePerry/Laxen-F83
fromtheForthInterestGroup.
ThevolksFORTHauthorsstartedattheendof1987toportthesystemto32bits,and
convertthecompilersothatitcreatesreal68kmachinecode.Tosomeengagedvolks-
FORTHuserstheygaverunningprototypes.ThesystemthenwascalledturboFORTH
andshouldhavebeendistributedcommercially,buttheprojectalmostdied.
However,oneoftheseengagedvolksFORTHuserscontinueddevelopmentandaftertwo
yearsofdevelopment,bigFORTH1.0fortheAtariSTwasreleasedinsummer1990.
In1992,attheGermanForth-Tagung,EwaldRiegerandFriedlAmendaskedme
fora386versionofbigFORTH,andEwaldRiegersponsoredthePC.1995,thisversion
(bigFORTH-DOS1.20)wasreleased,togetherwiththelastAtariSTversion.TheDOS
versioncontainedaobjectorientedwidgettoolkitwhichusedVGAtextmodetodisplay.
Tocontinuedevelopmentofthe386version,EwaldRiegersponsoredanotherPC,with
thegoaltohavebigFORTHrunonOS/2,WindowsNT,orLinux.Ifirststartedporting
toOS/2,andafterLinuxgotsharedlibraries,IportedovertoLinux.
Inaugust1996,afterfinishingmydiplomathesis,IstartedonMINO,thegraphical
userinterfaceforbigFORTH,asequeltothetextmodeUIofbigFORTH-DOS.Onthe
Forth-Tagung1997,Ipresentedthefirstresultsandsoonafterwardsputademoonmy
homepage.Laterin1997,thelicensehasbeendecided,it’sGPL(seepage 247 ).
IVIntroduction
bigFORTH
3.ReturningThanks
IwanttothankthevolksFORTHauthorsDietrichWeineck,GeorgRehfeld
andKlausSchleisiek,sincewithouttheirworkandwithouttheirvolksFORTHbig-
FORTHwoudn’texist.EspeciallyI’dliketothankBerndPennemannhere,forhis
supportclearedallopenquestions(includingthoseofcopyright),andwhosrecommenda-
tionsallowedtocompletethesystem.Furthermorehesuggested(amongalistofother
suggestions)thename.
FurtherspecialthankstoEwaldRieger,whosupportedthedevelopmentoverthe
time,andmanythankstothetestersfortheirbugreportsandsuggestions.Thanksalso
toNikolausHeuslerwholecturedtheoriginalmanual.
I’dalsoliketothankCharlesH.Moore,forhiswonderfulForth,DonaldE.
Knuth,forhisT E X,LinusTorvaldsforLinux,andRichardM.Stallmanforthe
GNUpubliclicenseandtheGNUtoolshestartedtodevelop.
4.TargetMarket
Forthhastraditinallybeenmuchmoreapublicdomainlanguage,that—unlike
COBOL,Fortran,CorADA—wasn’tsupportedbyneithertheindustrynorthemilitary,
and—unlikePascalresp.ModulaII—alsowasn’tdevelopedonuniversities.Forth’s
developmentliesmostlyinthehandofengagedsmallcompaniesorusers,whohavesome
dicultiestomatchoeringsofotherlanguages.
bigFORTHshouldfillthisgapandprovideamoderndevelopmentenvironment,that
doesn’tcapitulatefromlargeproblemsandcreatecodethatisinspeedcompetitiveto
otherhighlevellanguages.
5.Copyleft
bigFORTHiscopyrightedbyBerndPaysan,andavailableunderGPL.Themanual
hereisalsoavailableunderGPL,withexcemptoftheGPLtextincludedhere,whichmay
notbemodified.
M¨unchen,inDecember1999
BerndPaysan
Dokumentation
Contents V
Contents
Introduction III
1. “RealProgrammersdon’tReadManuals” ..................III
2.History ......................................III
3.ReturningThanks ................................IV
4.TargetMarket ..................................IV
5.Copyleft .....................................IV
Contents
V
1Installation 1
1. InstallingonLinux ............................... 1
2. InstallationonWindows ............................ 1
3.EditorCommands ................................ 2
4.NotationvonBefehlen ............................. 2
5. Zahleneingaben ................................. 3
6.NotationvonSondertasten ........................... 4
2Tutorial 5
1. StartingtheSystem ............................... 5
2.EndofaSession ................................. 5
3.TheLineEditor ................................. 6
4.ErrorMessages ................................. 6
3AndsoForth... 7
1.Preface ...................................... 7
1.1. Copyright ................................ 7
1.2. Introduction ............................... 7
1.3. Aboutthisprimer ............................ 7
2. Forthfundamentals ............................... 8
2.1.Makingcalculationswithoutparenthesis ............... 8
2.2.Manipulatingthestack ......................... 9
2.3.Deepstackmanipulators ........................10
2.4. Passargumentstofunctions ......................11
2.5.Makingyourownwords ........................11
2.6. Addingcomment ............................12
2.7. Text-formatofForthsource ......................12
2.8.Displayingstringconstants .......................13
2.9.Declaringvariables ...........................13
2.10.Usingvariables .............................13
2.11.Built-invariables ............................13
2.12.Whatisacell? .............................14
2.13.Declaringandusingconstants .....................14
2.14.Built-inconstants ............................14
2.15.Usingbooleans .............................14
Zgłoś jeśli naruszono regulamin