Professional Documents
Culture Documents
Varieties of Threaded Code For Language Implementation
Varieties of Threaded Code For Language Implementation
Language Implementation
Terry Ritter
Gregory Walker
Motorola Inc, Mail Drop M2880
3501 Ed Bluestein Blvd
Austin TX 78721
Between a high-level language (HLL) and its underlying tion is then executed in order to run the program. A com
machine architecture lurk many language implementa- piler is a computer program that translates high-level
. tion techniques . These include the older techniques of language programs into instructions of another language .
interpretation and compilation, as well as newer ones like Traditionally, assemblers and compilers translate their
intermediate languages and threaded code . In this article, input into machine-level code .
we will present four types of threaded code techniques for Interpretation: Interpretation techniques directly exe
implementing intermediate languages. We will examine cute the high-level language program . The interpreter is a
how these four logically equivalent techniques offer program that sees the high-level language source program
various trade-offs of execution speed, program storage, as a series of operation (op) codes used to guide its execu
and use of processor resources . tion. The interpretive system appears to the user as a
"virtual machine" that has the architecture of the high
lmplemention of a Language level language .
The implementation of a high-level language on Any form of interpretation offers significant oppor
various logical or physical machine architectures in tunities for implementing debugging tools. Tests per
volves such characteristic trade-offs as size of the formed as each command is interpreted can result in a
language implementation, si�e of generated code, and programmer-controlled display of debugging informa
speed of program execution . We will bypass other issues tion. This is the basis for trace or breakpoint facilities
of high-level language use (eg: interaction, debugging, that can be included in the interpreter.
testing, etc) and concentrate on language implementation Combinations: Combination techniques may translate
considerations. the sequence of characters representing a high-level
Language implementation techniques can be logically language keyword into a form that is easier to interpret.
divided into two categories: translation and interpre Most BASIC interpreters translate the BASIC keywords
tation. into one-byte tokens that are easier to identify. This
Translation: Translation techniques replace elements technique avoids the continual string searches of a tradi
of higher-level syntax with lower-level instructions that tional interpreter, but executes a language that is syntac
perform an equivalent operation. The resulting transla- tically unchanged from the high-level-language source
program. (For our purposes here, the term syntax will
About the Authors specifically refer to the structural relationship between
Terry Ritter and Gregory Walker are software engineers at the language elements . )
Motorola Microprocessor Design Group, wl1ere their exploration into Intermediate language: Intermediate-language (IL)
the structure of computer languages led them to examine FORTH and
other threaded languages for use as a possible software tool. Terry techniques translate the high-level-language programs in
Ritter is one of the co-architects of the M C6809 m icroprocessor and has to a language that is simultaneously easier to deal with
been involved with personal computing since 1 974. Gregory Walker is and syntactically different from the original . Many com
on the IEEE floating-point standards committee and has been involved pilers translate a high-level-language program into an
with microcomputers since 1975.
intermediate language, which is then translated into
of
w()sted trying to track down a "program bug" when actually
hardware was to blame!
Aspects Intermediate-Language Architecture
An intermediate language is composed of a set of
DIAGNOSTICS I als_o allows you to be confident of your system.
This can be critical when file merges or sorts and backups
primitive operations (which, in combination, can express
are involved. You want to be as sure of your computer as possible any algorithm) and storage capabilities for both internal
quring these critical times. Running DIAGNOSTICS I prior to and program data. In particular, it must be possible to
these and other important functions helps to insure that your pass data values between routines that make up the inter
system is operating at peak performance. mediate language. The intermediate-language program
·J�-
Code)
---- :: �
JSR A
JSR 8
( I L c od e ) ( Ma c h i ne Code )
A: m a c h i n e code 8: m a c h i n e code
for call rou t i n e
( I nto r m e d iota - L a n g u a g e cod e ) ( M a c h i n e code )
� L
A· JSR L 8: machine
language � M m a c h i ne code
for next
JSR M routine
� return
RTS
RTS
I
1 12-24 ,
R ETURN: � return
B CORPiJRATION
Figure 3 :Diagram of indirect-threaded code (fTC). Here, "in
J. KA fV;:)l � � I
1945 ROUTE 22
direct temporary storage" and "code temporary storage" store
Th e
mediate language representation. (A stack architecture is
certainly simpler than other architectures, but that does
not mean it is better; many complex trade-offs that are
is shaping up . . .
Threaded Code
Threaded code is an intermediate-language implemen
tation technique that organizes the control of program
flow into a sequence of subroutine invocations. No other
aspects of the language are represented in threaded code.
Threaded code is especially applicable to interpretation;
the interpretation process consists of transferring control
to the routines selected by the threaded-code op codes .
The functions available in the intermediate language are
provided by the subroutines that are invoked and are not
an inherent part of the threaded code itself.
[ The characteristics of the language FOR TH are in
dependent of its current implementation via threaded
code. FORTH enthusiasts often blur the distinction,
attributing the language 's speed and compactness to the
language instead of to its threaded-code implementation .
I think this is an important point t o remember when talk
ing about the advantages of FORTH. . . . GW)
i n co rporated
bodying zero-address architectures. As such, the tech
nique of using threaded code to implement a language
can be applied to, for example, Pascal (using the p-code
intermediate language), LISP interpreters, or, of course,
�5����.��. Software
FORTH. We classify four varieties of threaded code:
subroutine, direct, indirect, and token.
All varieties of threaded code consist of a data struc
ture that is a sequence of unique subroutine identifiers.
Crabt r e e B l v d .
Traditionally, threaded code has been kept close to the R a l e r g h , N o r t h Ca r o l i n a 27604 (9 1 9 ) 833-4094
machine level and has included actual pointers to the
AT LAST' A fu l l y implemen t ed computer based file m a n agement system.
subroutines (which themselves may be either interme On ly a few m i n u t es or i n s t r u c t i o n a n d you arc creating and using your own
diate language or machine code). Also traditionally, a client lists, mailing l i s t s . i n ve n t o r ie s . bibliographies, vendor l i s t s , and more.
solute pointers nor register resources need be used to im A L S O available with D B M SSO .
Build your own custom defined and formatted reports and data summaries.
Print lables with user specified format� t ha t w i l l f i t your ow n forms.
Implementing Threaded Structures DBMSSO and R E P O RTSO will r u n under either C P/ M o r T R S DOS
We will now describe the structures associated with the DBMSSO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $250.00
........... . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ 1 00.00
various types of threaded code. Figures 1 through 4 pre R E P O RTSO .
Manuals each .. . . . . . . . . $25.00
sent diagrams of subroutine-, .direct-, indirect-, and token OTHER P R O DUCTS O F M l C R O BYTE SOFT W A R E :
threaded code structures, respectively, along with a des EDIT80 . . . . . . . , . . . . . . . . . . . . . . . . , . , . . . . . . . . . . . . . . , . . , . . . . . . $ 100.00
Text editor and p r i n t formatte r w h ich runs under C P /M or T R S DOS
cription of the three operations, next, call, and return , UISK 8 0 . . . . . . . , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $50.00
which make up the complete threaded-code interpreter. U t i l i t y which allows you t o e x a m i n e and p a t c h a d i s k .
In the diagrams, the notation " - A " means a pointer to UTI LS . . . . . . . . , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $50.00
Apple PASCAL u t i l i t ies: extensions to Apple P a scal , together w i t h file
the memory location labeled "A" . control ut i l i t ies. cross-reference, etc.
Subroutine-threaded code: A sequence o f subroutine I' A Y R OI. I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ 100.00
Apple PASCAL payroll for 1 50 employees, full
calls with no other embedded instructions implements an dedu�.: t i o n opt i o n s , ell.: .
intermediate language. Each subroutine call may be con \\'rite or �.:all today for further detail.' on our product s .
sidered a single intermediate-language operation, which Source I D#TCE373
need not be related to the underlying machine architec AI-'1-'I.E is a lrademarL. u f Appll' l"ttnllllllt'r ( ·urp .
t o k e n end : - return
pointers, the compiler generates intermediate-language
( I L code) ( M a c h i n e c od e )
code that does not include machine-language code itself;
thus it is independent of the target machine . However, a
A: token col/ B: t ok e n bst
disadvantage of indirect-threaded code is that the inter
token L BST: m a c h i ne c o d e
rout ine preter has the overhead of an extra level of indirect ad
t oken M
dressing.
m a c h i n e code
Token-threaded code: The varieties of threaded code
token end
f o r next previously mentioned contained pointers that were actual
addresses of the subroutines in memory. Using memory
addresses to select routines wastes storage because the
next col/ return
number of subroutines in the system is far smaller than
next 1 . get current token from list the number of memory locations. A savings in inter
2. point list pointer to next list item mediate-language program size can be obtained by using
3. look up address corresponding to token short tokens to identify the subroutines to be invoked .
4. get indi rect token at address
5 . look up address corresponding to indi rect Typically, token-threaded code (TTC) can be im
token plemented by using the current token to index into a table
6 . jump to machine code at that address
of subroutine addresses . (See figure 4 . )
call 1 . push cu rrent list pointer onto stack
2. load list pointer with start of new list High-Level Descriptions o f Threaded-Code
3. do " next"
Interpreters
return 1 . load current list pointer from top of stack Listings 1 thru 3 illustrate the logical implementation of
2. do " next" direct-, indirect-, and token-threaded code, respectively.
The program descriptions are written in a high-level
Figure 4: Diagram of token-threaded code (TTC) . Since tokens
language that is similar in appearance to Pascal. It differs
can be made shorter than addresses, this makes the threaded from Pascal in that the variables are not declared as stan
code more compact, but the table lookup makes the resulting dard Pascal data types . Also, the next, call, and return
code slower. Here, the "indirect token" is the contents of the operations are not written as Pascal procedures; this was
table entry that matches the current token of code. . done to remain faithful to actual implementations where
means an actual machine address. If ip is a pointer var l i s t _p o i n t e r : p o i nter; { i nterpreted p r ogram c ounter }
l i st_item: p o inter; { c on t a i n s t h readed-c o d e i te m }
variable, then - ip means the value at the location label n e x t , c a l L return;
return: l i s t _p o i n t e r : = p o p _f r om_s t a c k ( ) ;
{ The f o l l owing c od e dup l i cates the '' n e x t '' o p erat i on.
l i st i tem : = A l i s t_p o i n t e r ;
Implementation Concerns l i s t _p o i n t e r
g oto Alist i tem;
: = l i st-p o inter + p o i n t e r _l e n g t h ;
return: l i s t _p o i n t e r : = p o p _f r om_s t a c k ( ) ;
{ The f o l l ow i n g code d up l i c a t e s the '' n � x t '' o p er a t i on .
l i s t _i t e m : = "" l i s t _p o i n t e r ;
l i s t _p o i n t e r : = l i s t _p o i n t e r + p o i n t e � _l e n g t h ;
c o d e _p o i n t e r : = .., l i s t i tem;
g a te ...... c o d .e _p o i n t e r ;
flh.
{ 8-b i t t o k e n
Disk drives, printers, }
________,..
var l i s t _p o i n t e r : p o i n ter; { i nterpreted p r o g ram c o unter
1'ii
____ _
}
8
c o d e _p o i n t e r : p o inter; { p o i n t er to mat h i ne c ode
peripherals, software Shown Is Level I. tab l e : a r r a y [ ! . . t o k n umb e r J of p o i nt e r ; { s u b r o u t i ne ta b l e }
Level II includes
and games . . . you
-� "
Alphanumeric keypad. t o k en item: s h or t to ken;
I
label n e x t:-c a l 1 . r e t u r n ;
n a me it, we've got it
' ' ' ' " . . .. .
(Both Radio Shack & ne x t : t o k en i tem : = A l i s t _p o i n t e r ;
/ - ' P
- -
l i s t_ o i nter : = l i st_p o i n t e r + t o k e n_l e n g t h ;
other brands). Write ��-- - c o d e _p o i n t e r : = t a b l e [ t o k e n_i t e m J ;
:�
or call for our t o k en_i t e m ....., c o d e_p o i n t e r J
c o d e_p o i n t e r : = t a b l e [ t o k e n_i t e m ) ;
complete price list. g oto A c o d e _p o i n t e r ;
C &S
call: p u s h_on_!i t a c k ( 1 i s t _p o i n t e r ) J
{ The va l u e of t h e c o d e _p o i n t e r was set by the preced ing
{ ' ' n e x t '' o p e r a t i on .
: = c o de_p o i n t e r + c a l l _c o d e _ l e n g t h ;
ELECTRONICS MART
l i s t _p o i n t er
The f o l l ow i n g c ode d u p l i cates the ' ' n e x t '' o p er a t i on .
t o k en_i t e m := A l i s t _p o i n t e r ; ·
l i s t _p o i n t e r ; = l i s t_p o i n t e r + t o k e n _l e n g t h ;
Ltd. c o d e _p o i n t e r : = t a b l e [ t o k e n _i t e m ) ;
goto Ac o d e _p o i n t e r ;
5 -)t h r e a d p tr 1
t h re a d ptr 2
Ma c h l R o u t i n e IL R o u t i n e
NEXT: LEAS -2. S MAKE SPACE
C A L L: P S H S Y PSHS X SAVE X
LEAY *+7, PCR STACK OLD THREAD PO INTER
JMP [ , Y++ J ADDR OF FOLLO W I N G IL CODE 5 ->x
JMP C. Y++J space
t h re a d ptr 1
FOB RETURN AOOR OF " R ETURN"
t h re a d ptr 2
processor when you want to manipulate the contents of RETURN: PULS y RECOVER OLD THREAD PTR
the interpreter registers . . . . GW ) The use of absolute loca BRA NEXT
w. ��,.;y! ·!'k :
�! -c
RETUR N : LEAS 2. S D I SC A R D "NEXT"
.....
y
.�:
P UL S GET SAVED THREAD PTR
�":.� {,,� l;l
WE EXPORT TO ALL COUNTRIES: CALLERS BY APPOINTMENT ONLY CONTACT TONY WINTER 01 -636-8210
BARCLAYCARD ACCEPTED 89 Bedford Court Mansions BARCLAYCARD ACCEPTED
CBM APPROVED Bedford Avenue CBM APPROVED
London WC1, U.K.
CP/M Ver. 9.00 is one 1 6 K core program CP/M Ver. 9.00 Is one 16 K core program
using random access releasing both drives for using random access releasing both drives for
data storage, and 250 word vocabulary Is data storage, and 250 word vocabulary is
translatable in any foreign language. translatable in any foreign language.
PRICES: Programs 1 ·23 EXC (19,20,22,23) £475 £575 Stock Integrated Option + £100 Bank Integrated Option + £100
routines .
NEX T : LEAS -4 , S MAKE FREE STACK SPACE
P SH S U, X , D SAVE R E G I STERS
Listing 6 is an example of a moderately complex direct
threaded code interpreter. It is somewhat slower than the s '-) d
simple interpreter in listing 4, but it uses a standard RTS X
5
ledger journals, revenue and expenses. Screen or 40 column printer reports. Handles up to 500 joumal
entries per period, up to 100 accounts, Instructions include a short primer in Financial Accounting. S49.95 -:> a d d r o f " n e x t "
0 UNIVERSAL BUSIN ESS MA C H I N E : This program is designed to S I M P L I F Y and SAVE TIME lor the tab l e a d d r
serious businessman who must periodically Analyze, Plan and Estimate. The program was created usinu our
Universal Computing Machine and it is programmed to provide the following planning and forecas1ing tools. i n d i re c t
t h r e a d p tr
PROFORMA P R O F I T & LOSS
CASH F L O W ANALYSIS P R O F O R M A BALANCE S H E E T S O U R C E ANO USE OF F U N OS
SALES F O R ECASTER JOB COST ESTIMATOR
Price, including documentation and a copy of the base program, Universal COillflll ling Machine. . . . . $89.95
01NVOICE: Throw away your pens. Use the E L E C T R O N I C INVOICE facsimile displayed on your CAT. C ALL : PSHS D SAVE D
The program prompts and you fill in the data. Includes 3 address fields (yours, Bill to and Shi11 to). Invoice
No., Account No., Order No., Salesman, Terms, Ship Code, FOB Pt. and Date. U p to 10 items per sheet with
5
these descriptions: Item No., No. of units, Unit Price, Product Code, Product Oescription, Total Dollar
amount per item and invoice total dollar amount. Generates, at your optiOn, hard copy invoices, shi11ping -> d
memos, mailing labels. audit copies and disc updates to master A/A files. (48K) . . . . . . . . . . 549.95
a d d r of " ne x t "
D BUSINESS C H E C K R E G ISTER: Expanded version of the Checkbook I I program. Handles up to 500 checks tab l e a d d r
per month wittl complete record keeping. (48K). . . . . . . . . . . . . . . . . . . . . . . . . . . S29.95
i n d ire c t
0 BUSINESS B U D G E T : As described above and companion program to Business Check Reaister. Handles
500 transactions per month, up to 20 cost categories. Accesses BCR files for actual costs. (48K) . . . . S29.9S
thread p tr
5
driven series of keyboard commands allows you to draw directly on the screen up to 15 different gate types,
including 10 gate shape patterns supplied with the program and 5 reserved for user specification. Standard -> d
patterns supplied are NAND, N O R , INVERTER, EX-OR, T-FLOP, J K-F L O P. 0 -FLOP, RS·F L O P, 4 Bit
C O U N T E R and N-BIT S H I F T R E G ISTER. User interconnects gates just as you would normally draw using
a d d r o f " ne x t "
line graphics commands. Network descriptions for L O G I C SIMULATOR generated simultaneously with the tab l e a d d r
CRT diagram being drawn. Drawing is done in pages of up to 20 gates. Up to 50 pages ( 1 0 per disc) can be
drawn, saved and recalled. Specify 1000 gate (48K) o r 500 gate (32K) system . . . . . . . . . . . . . . ·$89.95 o l d i n d i re c t
t h read p t r 1
0 MAT H E M A T I CS S E R I E S : C o m p lete Package $49.95 A1111le only
t h r e a d p tr 2
0 N U M E R I C A L ANALYSIS :HI-RES 2-0imensional p l o t of a n y function. Automatic scaling. At your OJJtion,
the program will plot the function, plot the INTEGRAL, plot the D E R IVATIVE, determine the ROOTS,
. . . . $19.95
find the MAXIMA and MINIMA and list the I N T E G R A L V A L U E. For 16K . LDD 4. S G E T T A B L E ADDR
0 MATAIX: A general purpose, menu driven program for deterrnininu the INVERSE and DETERMINANT of STD 6, S MOVE IT
any matrix, as well as the S O L U T I O N to any set of SIMULTANEOUS L I N E A R EQUATIONS. Disk 1/0 lor
data save. Specify 55 eqn. set (48K) or 35 eqn. (32K) . . . , S19.95 LDD Q, S R EC OVER D
0 3-0 S U R F A C E PLOTTER : Explore the E L E G A N C E and BEAUTY of MATHEMATICS by creating H I-R E S LEAS 6 , S D I SC A R D JUNK
P L O T S o1 3- dimensional surfaces from any 3-variable equation. Disc save and recall routines for plots. Menu
BRA NEXT
driven to vary surface parameters. Demos include BLACK H O L E gravitational curvature equations . . 51 9.95
SPECTRUM SOFTWARE
California residents add 6Yt% sales taK. Make checks payable to:
shipped within 3 days. Card users include card number. Add S 1 . 5 0 postage and handling with each order.
- O E A L E R I N Q U I R I ES P.O. B O X 20B4 · 142 CARL OW, SUNNYVALE, CA 94087 routine; this usually precludes the distribution of such
INVITED FOR P H O N E O R D E R S - 408-738-43B7
subroutines in read-only memory.
222 September 1980 © BYTE Publications Inc Circle 138 on inqu iry card.
Type of Threaded Code M C6809 M a c h i n e Ratio of C y c l es · R e l ative S ize of Can t h i s Code
C y c l es Used Used Resu l t i n g Be M arketed to
I ntermed i a t e- All Users of
Language a G iven
Code M i croprocessor?
Subroutine-threaded code 91 1 .0 3 no
Table 1: Comparison of threaded-code techniques. Notice that only two forms of threaded code, the relative subroutine-threaded
code and the token-indirect token-threaded code are sufficiently system-independent to be used for mass distribution to (poten-
· ·
tially) all users of a given microprocessor. ·
·
A possible alternative would be to modify the direct intermediate-language code unsuitable for distribution in
$ G OLD DISK $
CP/M® Compatible Z-80 Disassembler
$
• R EC R EATES Z-80 ASSEM B LY LA N G UAG E SOU RCE F I LES F R O M
6200
A B SO L U TE C O D E (.COM F I LES) FO R ALTERAT I O N .
_ FEAT U R ES M N EM O N I C LA B E LS F O R EASY P R OGRAM TRAC I N G .
- I N CLU D ES CO M P LETE D OC U M ENTAT I O N A N D F R E E U T I L ITY
.
FOR S P EC I FY I N G A N D D ECO D I N G ASC I I SECT I O N S O F CODE. .
• O P E RATES U N D E R M I N I M U M CP/M' CO N FI G U RATI O N ( 1 6 K RAM). POSTPA I D
• D OC U M ENTAT I O N O N LY: $ 1 2 (MAY B E A P PLI E D T O D I S K O R D ER).
��
.]
E
ONE DAY S RV I C E FOR CR E D IT BOWER-STEWART & ASSOCIATES "WORTH I TS W EI G HT IN GOLD"
�
CA R D C U STO M E RS: O R D E R DISK P.O. BOX 1 389
BY P H O N E FREE! (WE W I LL PAY HAWT H O R N E, CA. 902 50 S PE C I FY D R I VE A N D SYST E M
-.-r·:t,
Languages that have been historically associated with
threaded code will probably continue to use these tech
,- . �
·.
threaded-code implementor to prohibit the use of pre
� Ma1aalne ·
viously coded machine-language modules by eliminating
PRESENTS: parameter passage through microprocessor registers.
P R O BAB I L I TY Either the interpreter can be designed to keep these
HAN D I CAP P I N G registers free, or special routines· must be written by the
D EV I C E I implementor to save and restore these registers when
A 1 6 K BASIC PROGRAM FOR: using library routines stored in read-only memory .
H O R S E R AC E H AN D I CAP P I N G ! Similarly, the motivation for distributing software in
This amazing program was written by a professional software consultant to TAW Space an open market (to many different users with many dif
Systems and is being introducod by the publishers of Computers and Gambling Prowcts
Magazine. "PHI}. 1 " is a large complex basic program requiring a full 1 6 K. � is carefully human
ferent systems) leads directly to the requirement for posi
factored for easy use. PHD- 1 is a comprehensive horse racing system for spotting overlays in tion independence . While the MC6809 directly supports
thoroughbred sprint races (less than 1 mile). You simply s� down w�h your computer end the
Racing Furm the night before the raco and answer 5 or 6 questions about each horse's past position-independent code at the machine-language level,
performance. Your computer then accurately predicts the win probability and odds�ine for each it is also possible to devise threaded-code intermediate
horse allowing you to spot. overlaid horses while et the track. The users manual contains a
complete explanation of overlay betting. languages that are position independent. But any inter
(45C
Statistics for thousands of horses were used to davelop this handicapping system. The
appendix of the manual contains a detailed tab run of a 100 consecutive race system workout
mediate language or interpreter that requires particular
showing an amazing 45% positive return for each S 1 .00 wagered). A graph is absolute storage locations is so obnoxious as to be un
also included showing PHD- 1 's close fit to the 1deal predicted probabil� vs. actual win
percentage curve.
worthy of discussion in polite programming society.
This program features: D Win probability end odds for each horse D Verification Absolute-address storage requirements are simply unac
display of each horse's � rameters prior to en!Ty for easy error correction D Bubble� or!
routine for final display U Fecil�y for line printer output D Cassette ARCHIVE routine to ceptable in code written for mass distribution.
store PHD- 1 's output for later analysis D Complete users manual.
The user's manual may be ordered separately for your perusal for $7.95 and will be cred�ed
Within these constraints, the various forms of threaded
if you purchase PHD-1 . code offer different trade-offs of speed and code effi
Order now to get on our list and receive back issues FREEl
ciency . Because these forms are logically equivalent, a
PH D-1 User's Manual and 1 6 K Cassette for: Apple I I
Applesoft Challenger ( Specify Type), TRS-BOt Lave I l l . . . . $29.95 single compiler could be used tb generate any of them at
Ca. res. edd 6% the user's choice. Thus, without changing the source pro
Make checks pa yable to: J O E CO M P UTER
2 27 1 3 Ventura Blvd., Suite F, Woodland Hills, C A 9 1 364 gram, a threaded-code technique could be selected that
•BE A WINNER: Get on the Computers and Gambling Prowcts M111Jazine mailing list fnr $3.00 would give the desired trade-off between speed and code
and receiw available back issues.
t TRS-80 is a registered trademark of Tandy Corpora tion.
efficiency for a particular situation.
In the end, threaded-code implementation techniques
Th e 2nd
structures could result in a language representation that
would look more like Pascal p-code than threaded code.
Gen eration . . .
Threaded code does offer a conceptually simple and
general control-transfer technique that displays a clear
boundary be tween interpreta tion and language .
However, threaded code is probably not an optimal
representation for any particular language, including
FORTH . •
It's all that it's
B i b l iography
Cracked up to be.
1) Bartholdi, P, Stepwise Development and Debuging (sic) Using a
Small Well Structured Interactive Language for Data Acquisition and
Instrument Control. Copy received from the author. (Author's ad
dress: Observatoire De Geneve, CH-1 290-Sauverny, Switzerland.)
2) Bel l , James R, "Threaded Code," Communications of the ACM,
volume 1 6, number 6, June 1 973, pages 370 t h ru 372.
3) Dewar, Robert K, " I ndirect Threaded Code," Communications of
the ACM, volume 1 8, number 6, June 1 975, pages 330 thru 331 .
4) Dewar, Robert K and A P McCann, " MACRO SPITBOL-A
SNOBOL4 Compiler," Software Practice and Experience, volume 7 ,
number 1 , 1 977, pages 95 thru 1 1 3.
5) fig-FORTH Installation Manual, FORTH I nterest Group, San Carlos
CA, May 1 979.
6) FORTH Dimensions, volume 1 , numbers 1 to 4, FORTH I nterest
Group, San Carlos CA.
7) Gaebler, Robert F, " Make it Natura l , " Electronics, volume 52,
i n co rporated
volume 3, number 8, September 1 978, page 28.
9) Brinch Hansen, Per and C Heyden, " M icrocomputer Comparison,"
Software Practice and Experience, volume 9, number 3, 1 979, pages
2 1 1 thru 2 1 7 .
1 0) James, John S , " FORTH Dump Programs, " D r Dobb's Journal,
volume 3, number 28, September 1 978, pages 26 thru 27.
1 1 ) James, John, " FORTH for M i c rocomputers , " Dr Dobb's Journal,
CP/M® USERSf
volume 3, number 25, May 1 978, pages 26 t h ru 27.
1 2) Main, Richard B, " FORTH vs Assembly," Dr Dobb's Journal,
volume 4, number 3 1 , January 1 979, pages 45 thru 47.
1 3) Meinzer, Karl, " I PS, An U northodox H igh Level Language,"
$9900
Dead Ends, Old Trails and Apologies , " February 1 979 BYTE, volume • F i e l d P rove n - M ore tha n 2 Yea rs.
Terrific
Color Brochure
BYTE, volume 4, number 3, pages 46 thru 52.
22) Roichel, Ancelme, "SAM76-FORTH-STRU BAL," Dr Dobb's Jour
nal, volume 3, number 30, November and December 1 978, pages 44 Value -
thru 45.
23) Sachs, Joh n , STOIC (Stack Oriented Interactive Compiler), M IT Software Development & Tra i ning, I nc.
and Harvard Biomedical Engineering Center, Cambridge MA, 1 977.
Post Office Box 45 1 1 , Dept. B
24) Sirag, David J, " DTC Versus lTC for FORTH on the PDP-1 1 ,"
FORTH Dimensions, volume 1 , number 3, June and July 1 978, pages H u n ts v i l l e , Ala ba m a 3 5802
VISA or MC
25 thru 29.