Workshop_Users_Guide_Beta_Apr83 Workshop Users Guide Beta Apr83

Workshop_Users_Guide_Beta_Apr83 Workshop_Users_Guide_Beta_Apr83

User Manual: Workshop_Users_Guide_Beta_Apr83

Open the PDF directly: View PDF PDF.
Page Count: 124

DownloadWorkshop_Users_Guide_Beta_Apr83 Workshop Users Guide Beta Apr83
Open PDF In BrowserView PDF
WORKSHOP USER'S GUIDE
for the Lisa -

Beta Dmft
ApriJ 1983

CO ....... TENTS
1.

INTRODUCTION
The WorKshop proll i des tool s for program delJe 1opmen t.
It proll ides
fac iIi ties for ed it i ng, 1 anguage process i ng, and debugg i og, as we 11 as
commands for managing files and configuring the system. The system
al so i ncl udes many other ut iIi ties.

2. THE Fl LE MANAGER
The FileManager allowsyou tomanage andmanipulate files and volumes.
3. THE SYSTEM MANAGER
The System Manager allows you to set default
parameters for the Lisa, and manage processes.

and configuration

4. THE EDITOR
The Editor allows you to create andmodif>' text files. These text file,:.
are used as input to the Comp i leI' and the Assembl er.
5. THE PASCAL Cct1PI LER
The Compiler translates Pascal source code into object code.
Translation requires two steps: first the compiler translates Pascal
into I-code; then the code Generator translates the I-code into obj«Ct
code •.
6 • THE ASSEMBLER
The Assembl er trans 1a tes assembl y J anguage programs into obj ect code.
7. THE LINKER
The Linker combines object code fi les into executable programs.
8. THE DEBUGGER
The Debugger allows you to examine memory, set breaKpoints,
other run-time debugging functions.
9.

USlNG EXEC FILES
e:xec files allow you to execute
automatically.

a series of commands

and perform

and programs

10. THE UTI LITI ES
Util ity programs are provided for debugging, configuring the system,
and man i pul at i ng files.

APPENDICES
A. ERROR MESSAGES

WorKshop· User's Guide for the Lisa

Introdudion

Cha.pter 1

INTRODUCTION
1.1 The Workshop

•••••••••••••••••••••••••••••.••••••••••••••••••••••• 1-1

The WorKshop provides the functions necessary to develop and run programs
on the Lisa. The WorKshop can be booted from either a disKette or a. Profile.
1.2 Starting the Work$hop •. . . . . . • • • • • . . . . • . . . • . . . . . . . . . . . . . . . . ... . • . . .• 1-1
The WorKshop is started by booting the Lisa from a disK· containing the
WorKshop software. You can use the e:nvironments window to select one of
several available environments.

1.3 The WorKshop User Interface • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• 1-3
The WorKshop user interface consists of three command lines: the WorKshop
command line, the File Manager, and the System Manager.
1.4 File System Organization and Naming •••••••••••••••••••••••••••••• 1-4
Files are stored on disk volumes and are accessed by specifying the volume
name and the file name.
1.5 Using Utility Programs • • • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • •• 1-7
Utility programs provide additional functions for the WorKshop. A· utility
program is started by choosing the RUN command from the WorKshop
command line.
1.6 How do I Write and Run a Pascal Program? .......................... 1-8
A Pascal program is written with the e:ditor. The source file must be
compiled and linKed before it can be run.
1.7 How do I write and Run an Assembly language Program? ............ 1-8
An assembly language program is written with the e:ditor. It must be
assembled and linked with a Pascal main program before it can be run.
1.8 How do I Use the BASIC Interpreter? • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• 1-8
A BASIC program can be written using either the Editor or the BASIC
interpreter to create the source file. The BASIC interpreter will run the
program.
1.9 How do I write a COBOL Program? ................................. 1-8
A COBOL program is written with the e:ditor. After writing the program,
enter. the COBOL language system to compile and run the program. The
COBOL system is invoKed by pressing C in response to the WorKshop command
prompt.

1.1 e The Operating Syst8'm ............. . • . . • • . . . . . . . . . . . . . . . . . . . . • . . .. 1-8
The WorKshop runs under the Operating System for the lisa computer. You
can access operating system routines through the SYSCAll interface. More
information about this interface can be found in the Operating System
Reference Manual for the Lisa.

alpha draft

1-1

27 January 1983

WorKshop

a I pha draft

User's Guide for the lisa

Introduction

1-2

27 January 1983

WorKshop

User's Guide for

~he

Introduction

Lisa

INTRODUCTION
1.1

The WorKshop Manager.
The Workshop allows you to develop and run programs on the Lisa. It provides
tools necessary to write, debug, and run programs in Pascal, BASIC, and
COBOL. This manual explains how to use ~he WorKshop and all of its tools.
Access to all WorKshop functions is provided by command
command line, WORKSHOP allows you to edit programs, run
programs, and use the various languages available on the
provides access ~o two SUbsystems; the File Manager,
Manager.

lines. The main
utilities or user
system. It also
and the System

The File Manager allows you to copy, delete, rename, and list disK files. It
includes a bacKup function, and functions for manipulating volumes. These
functions . are listed in the FILE- MGR command line, which is similar to the
main command line. (See Chapter 2.>
The System Manager provides for system configuration and defaults and
process managment. Its commands are listed in the SYS-MGR command line.
(See Chapter 3.)
All command lines are displayed at the top of the Lisa screen. If there are
more commands than will fit on one line, a U?" is at the end of the line.
Pressing U?U will display the remaining commands. To access any command,
press the first character· of the command name. To redisplay the first
command line, press RE:TURN.
Most commands will asK for additional information. Type in the information
using the Lisa keyboard. Some questions have a default value, displayed in
square bracKets «(defaultJ). To accept the default value, press RE:TURN. If
you don't want the default value, type in the value you want.
The Lisa system can display one of two screens, called the main screen and
the alternate screen. The WorKshop system normally displays on the main
screen. The alternate screen is used by the system debugger. You can
change to the other screen display by pressing the right hand OPTION and
E:NTER Keys. The System Manager contains the Console command, which can
be used to spet:ify where the WorKshop should display.
The WorKshop can be used to write programs in Pascal, COBOL, and BASIC.
To use these languages, refer to the appropriate language manuals. In
addition to this manual, you will need:
For Pascal Programming:
• Pascal Reference Manual for the Lisa
• MC68000 16 Bii: Microprocessor
programming)
• Operating System Reference
system calls)

aJpha draft

User's Manual (for assembly language

Manual

1-3

for the Lisa (for information

on

27 January 1983

WorKshop

User's Guide for the Lisa

Introduction

For BASIC Programming:
• BASIC User's Guide for the Lisa
For COBOL

Programming:

• COBOL User's Guide for the Lisa.
• COBOL Reference

Manual for the Lisa

If you have only a BASIC or COBOL system, you will not have all the software
described in this manual. The portions of this manual that will be most useful
to BASIC and COBOL programmers are:

• The Introduction,

which describes how to use the1NorKshop;

• The File Manager, which describes files and how to manipUlate them.
• The System
Manager,
which
configuration parameters.

describes

setting

up

the

system

• The E:ditor, which describes how to create and modify text files that are
used as source files.
You may also use some of the utilities if they are included in your software.
1.2

Starting the Workshop
The WorKshop can be booted from a disKette
commonly be used with a. Profile.

or a Profile.

It will most

To start the system, boot from a disK that contains the WorKshop software.
If your disK contains only· the WorKshop environment, the WorKshop command
line will appear at the top of the screen.
If you have more than one
environment (for example, the Workshop and the desKtop) you can use the
E:nvironments window to start up the environment you want, and switch
between them.
The E:nvironments Window allows you to seled the environment you wan1: to
s1:art.
You can also set a default environment that will be started
automatically when you boot the system. To access the environments window
while booting the system, press any Key while 1:he Lisa is starting up. The
environments window will be displayed.
The E:nvironments window is shown in Figure 1-1. It displays five buttons:
Power Off
Restart
Start
Set Default
No Default

Turn off the Lisa
Reboot or reset the Lisa
Start the selected environment
Set the default· to the selected environmen1:
The E:nvironments window will always be displayed on
startup.

To select an environment, move the pointer to the checKbox of that
environment and click the mouse button. Then move the pointer to the sta.rt
button and clicK. The selected environment will start. .
To access the Environments

alpha draft

window from the WorKshop,

1-4

and select another

27 ,January 1983

Workshop

User's C;",ide for the Lisa

Introduction

environment, use the Quit command from the WorKshop command line, or
press the on-off button.
To access the Environments window from the
DesKtop, press the on-off button while holding down the (apple) Key.

Environments

( Restart

o
•
o

au ice

System

( Set Dehult )

Workshop

as

Figure i -1.

1.3

( Power Off

Start

The Environments

J

Window

The Workshop User Inter-face.
When the worKshop environment· is selec1ed, the system will come up with the
WorKshop command line at the top of the screen. This command line lists all
the actions you can currently request of the system. The WorKshop line
displayed contains only some of the commands available. The rest of the
commands can be displayed by pressing "?" I the last symbol on the line. The
original command line can be redisplayed by pressing RETURN. A command is
executed by pressing the first letter of the command name.
There are two other subsystems that have separate command

a. Jpha. draft

1-5

lines; the

27 ,Tanuary 1983

WorKshop

Userls Guide for the Lisa

Introduction

File-Manager, and the System-Manager.
Their command lines can be
accessed from the WorKshop command line, and are used the same way.
You can terminate the operation of most commands by pressing (apple)
period. You can turn off the Lisa by pressing the on-off button at any time.
The system will shut down in a.n orderly ma.nner. A disKette can be inserted at
any time. It will automatically be mounted and accessible. DisKettes are
ejected by pressing the disKette button.
The main, or WorKshop, command line is as follows:
WORKSHOP: Fl LE-MGR, SYSTEM-MGR, Ed it, Run, Pasc a 1 , Bas i c, Cobol, Qu it, ?
The additional portion, displayed by pressing "?", is:
Assemble, Debug, Link, MakeBackground, Generah
All the main command line commands are described below.
FILE-MGR (F)
This command puts you into the File Manager subsystem, which is used to
manipUlate the files and volumes on the system. For more information on the
file manager, see Chapter 2 in this manual.
SYSTEM-MGR (S)
This command puts you into the System Manager subsystem. This subsystem
provides various configuration and utility functions. See Chapter 3 in this
manual for more information.
Edit (E)
The Edit command puts you into the text editor, which is used to create and
modify text files. The e:ditor is used to create source files for BASIC,
COBOL, and Pascal. It is also used for assembly language programming and to
create exec files. The e:ditor is described in Chapter 4 in this manua.l.
Run (R)

The Run command causes a compiled and linKed program to e>:ecute. This
command is used for user-written Pascal programs, utility programs, and any
other software that runs under the WorKshop. The Run command asKs you for
the file to run. This file must be an executable object file or an exec file. (An
exec file name must be preceded by a "<" .) If you do not give it a complete
pathname, the Run command will search through up to three default volumes
for the file.
These defaults can be set by the File-Managerls Prefix
command. See the Prefi>: command in Chapter 2 for more information.
The Run command will also accept an "exec file" as input. An exec file is a
scenario of commands for the WorKshop system to carry out. An exec file
name must be preceded by a "<" to be processed correctly.
For mor-e
information on e:
The Generate command converts intermediate code files produced by the
Pascal compiler into object code. It is used with the Pascal compiler and is
described in Chapter 5.
1.4

File system organization and naming
Files are stored on volumes, that are mounted on devices. A volume has a
name and a directory of files tha.t it contains. A file is specified by giving the
name of the volume and the name of the file:
-volumename-filename

aJpha draft

1-7

27 January 1983

WorKshop

User's Guide for the Lisa

Introduction

The WorKshop maintains a worKing directory; you can access files in it
without specifying a volume name. The worKing directory can be. changed by·
using the File Manager's Prefix command. Files on the worKing directory can
be specified by just the file name. with no leading "_":
filename
Further information on the file system can be found in Chapter 2 of this
manual and in the Operating System Reference Manual for the Lisa.•
1.5

Utility Progra.ms.
There are various utility programs provided with the WorKshop.
used for functions not as commonly used as the commands.
The utilities are described in Chapter

These are

1e.

You must Run utilities. Select the Run command from the main command line
by preSSing R when the main command line is displayed. The system will ask
you for the name of the file to run. Type in the name of the utility you want to
run.

1.6

How do I Write and Run a Pascal Program?
To write and run a Pascal program, proceed as follows:
1.

Use the Editor to create a text file with the Pascal source program. See
Chapter 4 in this manual for more information on editing the file. See
the Pascal Reference Manual for the LIsa for information on the
language.

2.

Compile the program using the Pascal command (press P while the
Workshop command line is displayed) from the main command line. The
output from the compiler is an intermediate file.

3.

The output from the Pascal command is an I-code file. Use the Generate
command to convert the I-code file into an object file. To use the
Generator, press G when the WorKshop command line is displayed. See
Chapter 5 for more information on compiling Pascal programs.

4.

linK the program using the linK command. In order to be executable,
the program must be linl? ds=
COpy to wha t new f i 1e? -bacl.
• The maximum number of files on the device. The default is a good value
unless you are using a large number of very small files or a few very large
files.
The volume is initialized, with an empty directory. (If the device is a disl:istin9 volume on it, and give you a. chance to change your
mind before destroying the existing volume.
After initialization, the device is automatically
2.9

mounted so it can be used.

How do I Change thlt Name of a File or Volume?
The Rename command allows you to change the name of any file.
i.

If you are not in the File Manager subsystem, enter it by typing F in
response to the Worl or on the alternate'
screen (where LisaBug 'displays), or on an external terminal connected to the
RS232A or B port.
FilesPrivate (F)
The FilesPrivate command selects whether or not the private system files
should be displayed by the List command. The default is to not display the
private files. Private files are any files with a name beginning with "{".
These file names are used by the system for files you should not normally need
a.ccess to.
Validate (V)
The validate command is used ~o set up defaults for verifying operations.
Currently the only default of this type tells if the system will verify file
copies or not. The system verifies a copy by comparing the original file with
the copy to be sure they are the same. The boot default is to never verify.
You should have no reason to verify unless you something is wrong with your
disK.
S.3

The Preferences Tool
The Preferences tool is started by pressing P in resporlse to the System
Manager command line. After you are finished with it, you can exit bacK to
the System Manager by selecting Quit from the Tools menu.
The Preferences tool allows you to set up your WorKshop system the way you
want it. It contains four sections:
• Convenience settings ~hat allow you to set up the screen contrast, the
speaKer volume, and repeat delays.
• Device connections that tell the Lisa system what external devices are
connected.
• Startup that tells the Lisa what device to use as a. startup device.
• WorKshop defaults that set up things the WorKshop needs to Know.
These default settings are stored in parameter memory, a small area of
memory that is preserved as long as the Lisa is plugged into a worKing outlet
and for up to 10 hours when the Lisa is unplugged. If your Lisa is without
power for longer than this, the preference settings will be restored from
information on the startup disK.
Any changes made with the Preferences tool change. Parameter Memory
immediately, but some of them, such as device connections and startup

Alpha draft

3-4

3

F~bl'uary

1983

WorKshop

The System Manager

User's Guide for the Lisa

options have no effect until the system is booted again.
The preferences tool displays a window containing a number of buttons and
You set the values you want by using the mouse to move the
checKboxes.
pointer to the desired options and clicKing.
These four areas are described briefly below. More information on the firs1:
three areas can be found in the Lisa Owners Guide Section D. Select the
area you want 1:0 view or change by moving the pointer with the mouse to the
checKbox in front of the section name and clicl:tthat is copied is placed on The Clipboard and also left in place in the
active document.
..
The contents of The Clipboard may be inserted at any point in the active
document by moving the insertion point to where you want the text inserted
and selecting Paste from the edit menu.

4.2.2

The Menus
Operations are provided in five menus: File, Edit, Search, Type Style,and
Print. The File menu is used to access things outside the e:ditor, such as
documents and stationery. The Edit menu contains the editing operations.
Search provides for finding strings in the active document. The Type Style
menu selects the font for document display. The Print menu controls
printing. e:ach of these menus is described in more detail below.
You select an operation from a menu by moving the arrow pointer to the menu
name on the menu bar and holding down the button. The menu is displayed.
Seled the menu item by moving the mouse up Dr down until the right item
appears in reverse video. Releasing the button starts the operation.

4.2.3

Creating and Using Stationery
Stationery for a special purpose (such as a letterhead) can be created with
the e:ditor. Stationery is just a regular document containing the desired
text. To use any stationery other than the default blanK paper, select Tear
Off Stationery from the File menu, and type the name of the document
containing the stationery when it asKs you for the stationery name.
To create stationery, maKe a document containing the standard text you
want on the stationery.
Save this document on the disK. To use this
stationery, selec1: Tear Off Stationel'Y from the Edit .menUt and give it the
file name of the stationery you created.

Alpha draft

4-4

27 .tal'lual'Y 1983

WorKshop
4.2.4

The Editor

User's Guide for the Lisa

Editing Multiple Files
More than one file may be open at one time, but only one document is the
active document. To read in a document when you already have an active
document, select Open from the File menu. Itwill asK you for the document
name. The new document will be read in to a window on the screen and will
become the active document. To maKe another document the active
document, . use the mouse to move the pointer into a portion of that document
and clicK.
This capability may be used to copy text from one file to another by using the
following sequence of operations:
• Open the document containing the text you want to copy.
• Select the text you want to copy and select Copy from the Edit menu.
This places a copy of the text onto the Clipboard. You can use Cut if you
want the text to be removed from its original file.
• Open the document
active document.

you want the ted to be copied to. It becomes the

• Move the insertion point to the place you want the text to be inserted.
• Select Paste, which will copy the text from the Clipboard to the active
document.
Further information on each of these operations may be found below.
4.3

Selecting Text
The basic editing functions are Cut, Copy, and
Copy text, you must select the text to be cut
move the insertion point to where you want the
text and move the insertion point by using the
the screen.

Paste. Before you
or copied. Before
text to be placed.
mouse to move the

can Cut or
you Paste,
You select
pointer on

When there is an active document, the pointer will have one of two shapes:
Text pointer in a document
Arrow pointer for menus and scroll bars
Use the mouse to move the pointer on the screen. The shape of the pointer
will change when you move in and out of the document display window.
Within the display window, the text pointer is used to move the insertion
point and to select text.
In selecting text, you may select characters, '....ords, or lines. You may also
select any number of characters, words, or lines. Selected text is displayed
inreverse video.
4.3.1

How do I Move the Insertion Point?
The insertion point is indicated by a blinKing vertical line where the ne>:t
character will be inserted. All insertion, whether from typing or pasting,
taKes place a:t this point in the file, even if it is not visible in the window.
To move the insertion point, move the text pointer to where you want it to be

Al pha draft

4-5

27 January 1983

WorKshop

The Editor

User:'s Guide for the Lisa

and clicK. Note that the insertion point is also moved when you select text.
4.3.2

How do I Select Characters?
To select characters, move the text pointer to the beginning of the
characters you want selected, press and hold the button while moving to the
last character you want selected.
An alternate way of selecting characters, which is especially useful when
selecting a. large blocK of text, is as follows. Move the pointer to the
beginning of the text you want selected· and clicK. Then move the pointer to
the end of the text you want selected and shift clicK (hold down the shift Key
on the Keyboard and clicl< the mouse button). You may use the scrolling
controls to display the. end of the, text you want selected if it is too big to fit
in the window.
. .

4.3.3

How do I Select Words and Lines?
To select a word, move the te>:t painter into the word and clicK twice.
select a line, move the pointer into the line and clicl< three times.

To

To select multiple words or lines, clicK the required number of times, and
hold. Move the pointer to the last word or line you want selected and release.
An alternate method, especially useful when you want to select more text
than will fit in one display window, is as follows. ClicK the required number of
times to select the first word or line. Scroll the wir.dow if necessary to
display the last item you want selected. Move the pointer to the last item you
want selected, shiH clicK, and the entire blocK of text will be selected.
4.3.4

4.4

How do I Adjust the Amount of Text Selected?
To change the amount of text selected, move the pointer to the position ~hat
you want the selection to extend to and shift clicl<. This can be used to either
expand or contract the selection.

Scrolling and Moving the Display
When a document is longer than will fit into the display window, only part of
the document is displayed at one time. You can change what part is displayed
by "scrolling" through the display. The vertical bar on the right side of the
active window is the scroll bar. An example of a text· window showing the
scroll bar is in Figure 4-1.
The display window can be changed in size and moved on the screen. This
allows you to have multiple files displayed on the screen. These operations
are done using the title bar and size control box.

4.4.1

Scrolling the Display
There are three ways of moving the display window through the document.
The first is by using the elevator. The elevator is the white rectangle in the
scroll bar. Its position in the "elevator shaft" (the grey portion of the bar)
indicates the relative position of the currently displaydtext window in the
document. If the elevator is near the top, you are near the beginning of the
document. If it is near the middle, the text displayed on the screen is near the
middle Ot the document, and so on. To change the position of the text window,
you can use the mouse to move the arrow pointer into the elevator, clicK and

AI pha draft

4-6

27 Jar.uary 1983

WorKshop

User's Guide for the Lisa

The Editor

hold the button down while you move the eleva.tor to the position in the
document you want to display. When you release the button, the display will
be updated to the new position.
The second way of moving the window maKes use of the view buttons. The
view buttons are the boxes at each end of the elevator shaft. If you move the
arrow pointer to a view button and clicK, the display will move one text
window toward the beginning or end of the document, depending on which
button you clicKed.
The third way of moving the window uses the scroll arrows, which are just
above and below the view buttons. If you move the arrow pointer to the
bottom scroll arrow and clicK, the display window will move' one line toward
I f you hold the button down, the window will
the end of the document.
continue to move a line at a. time until you release it. The upper scroll arrow
worKs the same way, except it moves the window towards the beginning of the
document.

4.4.2

Moving the Display
You can move the display window on the screen and change its size. This lets
you display multiple files on the screen. You can maKe any visible window be
the active window by moving the pointer into it and clicKing.
To move a window, move the pointer to the title bar, press the mouse button
and hold it while you move the window. When you release the button, the
window will be redisplayed at the new location.
To change the size or shape of the active windowt move the pointer to the
size control boxt press the button, and move the pointer until the window is
the right sin and shape. Release the button and the resized window will be
displayed. The size control box is the box in the lower right hand corner of
the window. Only the active window can be resized.

4.5

The File Functions
The file menu provides functions for communicating with the outside world.
Functions are provided for reading in and writing out documents, and for
exiting the Editor. The Filing menu is shown in Figure 4-2. Each function is
explained below.
fi J iogmenu

Figure 4-2.

Alpha draft

The Filing Menu

4-7

27 January 1983

Workshop

User's Guide for the Lisa

The Editor

Save & Put Away
This writes out the active document and closes it.
Save a Copy in ...
This writes out a copy of the active document to another file name. You are
prompted for the name of the file to write to.
Sa ve & Continue
This saves all changes made so far by writing out the document
without closing the document •.

to

Revert to Previous Version
This returns the document to the way it was before you started editing
when you lasi .saved it. This is done by reading in the file from the disK.

disi<~

ii~

or

Open ...
This tells the Editor to get a new document. 11: prompis you for the document
name~ then reads it in and mai:amplet to move a blocl< of te>:t from one place in a document to anothert
follow these steps:
1.

Select the blocl< of text to be moved.

2.

Select Cut from the Edit menu. The te>:t is removed from the active
document and placed on the Clipboard.

3.

Move the insertion point to where you want the ted to be.

4.

Select Paste from the Edit menu. The te>:t on The Clipboard is inserted
a t the insertion point.

The edit menu also allows you to adjust selected te>:t left
inserting or deleting spaces. It also allows you to set tabs.

01'

right by

Some edit functions may also be done by holding down (apple) and pressing
another Key. The Key that corresponds to each function is shown in the edit
menu. See figure 4-3.
Undo Last Change
This command puts the document bacK to the '/Jay it was before the previous
operation if possible. The system will tell you if the last operation cannot be
undone.
Cut
Cut places a copy of the currently selected text into The Clipboard a.nd
removes the text from the active document. You may also Cut by pressing
(apple) X.
Copy
Copy places a copy of the currently selected text onto Tn€' Clipboard, but
does not remove it from the active document. You can also Copy by pressing
(apple) C.
Paste
Paste inserts a. copy of the text on The Clipboard at the insertion point in the
active document. You can also Paste by pressing (apple) V.
Shift Left
Shift Left moves selected text left by deleting a single space from the left of
each line. It will not delete any characters other than spaces. It is most
often used to adjust the left margin of a blocK of text. You can shift left by
pressing (apple) L
Shift Right
Shift Right is similar to Shift Left, e}(cept that it moves the selected text to
the right by inserting spaces at the beginning of each line. This can also be
done by pressing (apple) R.
Set Tabs ...
Set Tabs allows you to set the spacing of the tab stops.
Select All of Document

Al pha draft

4-9

27 ,lanuary 1983

l..Jorl:t string in the active
document. The basic operation is Find. 'Nhich locates the newt occurrence of
the string and selects it. Find & Paste All will replace each occurrence of the
string with the contents of The Clipboard. Several options are provided to
specify how tt-Ie match isto be found. The Search menu is shown in Figure 4-4.

Find...

~~-~F

Find Some
Find & Paste All

:

tiS :

v'Separate Identifiers
All Occurrences
v'Cases Need Not Agree
Cases Must Agree

Figure 4-4.

The Search

Menu

All searches start at the insertion point, and go to the end of the file.
There are three search operations in the Search menu, as follows:

Find ...
Find prompts you for the string to search for, then finds the ne>:t occurrence
of the string. If a match is found, it will be selected al""d wisplayed. The Find
command can also be executed by pressing (apple) F.
Find Same
Find Same repeats a previously specified Find, and selects the
occurence of the string. You may do a Find Same by pressing (apple) S.

next

Find 8. Paste All
This finds all occurrences of the specified string from the current insertion
point to the end of the file, and replaces eacb of them with the contents of
the Clipboard.
The other four items in the search menu tell how a match
There are t'NO areas to describe: searching for tol;t file as input, and produces:. a machine language (.OBJ)file
as output.
6.3 The Assembler Opcodes ...•••..•.••••••••.•...••••.•••.•••••.•••••••••• 6-5

The assembler opcodes are the standard 6:::000 opcodes, with a few
0.1 ter·na te fc.rms for some instructions.
6.4 Assembler Syntax ••••••••••• ~ •••••••••••••••••••••••••••••••••••••••••• 6-7
An assembler statement consists of an optic.nallabel, the opcode, and one
ortwo operands. The operandscan contain e>:pressions.

6.5 Assembler Directives .................................................. 6-9
The assembler directives provide for procedure and function definition,
macros, label and constant declara tion tlisting control, storage allocation,
and conditional assembly.
6.6 COITHTIUnication wilh Pasca.l ....•...............•..................... 6-11

AI pha draft

6-1

7 January 1983

Wor!:ecuted.
Assembly language routines are used to implemerlt low level or time
critical functions. Thischapter describeshow to use the assembler/and the
syntax of asse mbly larlguage progr·ams. Irlforma tion on the machine
instructions available on the 6:::000 processor is found in the Mptorola
manual.

0.2 Using the Assembler
To assemble a program, pressA from the INorKshop comma.nd line. Then
specify the input file (the file that contains your source program) and two
output files: the object file (the file that contains the machine-language
code produced by the assembler)and an optionallistingfile.
The input file must be a te:d file containing assembly language source
statements. You can maKe this file with the editor. The output file
produced is an object file (.OBJ),that must be linKed with a Pascal main
program tobe run.

0.2.1 Assembler Options
When you start the assembler, the option settingsare displayed. You may
change the options by responding to the input file prompt with U?/I. There
are two assembler options:
P
S

Pretty Listing.
Print information about available space.

Each option may be sette + or-:
+

On
Off

When Pr·etty Listing is on, the forward jump addressesare filled in with the
correct values.
After setting any options desired,pressreturn,and the assembler asKs you
for the name of the input file. The assembler then asKs you forthe name of
thelisting, and the output files.

6.2.2 The Input File
The input file is a text file contairling assembler language source
statements. A file created using the Editorwillbe in te>:tfile format.
When the assembler asK·; you for the name of the input file, type "?" if you
want to change assembler options at this time; otherv.Jise type the
pathname of your source file.

Al pha draft

6-3

7 January 1983

Wori-. If Pretty Listing is ont the actual value will be filled in.
Source :.tatement error'sare flagged irl the listing. Refer to the Appendi:·:
for a listof assembler errormessages.
Arl e>:ample clf an assembler'listingfile isshown in Figure6-1.
assemblerl isting
TAIL
PAGE 00001
00001
00021
00041
00061
00061
OOOAI
OOOCI
OOOEI
OOOEI
00101
00121
00161
00181
OOlAI
OOlAI
OOlCI
001EI
OOlEI
001FI
00261
00201
00341
00381
00421
00451
00461
00461
00461
00461

Me --------1
5 ASMSTR

FILE: EX/ASM/STR. TEXT

205F
225F
2FOA

.proc
move. 1
move. 1

AsmStr
fa7l+' aO

move. 1

a2, - (a7)

45FA 0016
4280
1012

lea
clr. I
move.b

dO
(a2 ), dO

get size of string

120A
5340
6500 0006
120A
60F6

COP!;! subq
blo
move.b
bra

(a2)+,(a1)+
#l,dO

COP!;! size of string (first b!;!te of str ing )
done cop!;!ing string?

245F
4EOO

done

26
74
72
20
68
20
6C
00

68
69
66
65
61
65

move~b

move. 1

jmp
69
6E
72
20
73

73
67
6F
4C
73

20
20
60
49
65

73
69
20
53
60

74
73
74
41
62

size
m!;!Str

+~al

a7

return address

address of string passed from Pasca I pgm
save scratch reg a2

size~a2

done

yes,

(a2)+,(a1)+
COP!;!

COP!;!

f:~

l+' a2

return to pasca 1
one char of the string

restore scratch reg

return to pascal

"b!;!te
. asc i i

38
'this string is from the LISA assembler"

. align

2

72
just to be sure next

instruction

is on UJord

boundar!;! (even address)
j.

end

Figure 6-1. Assembler Listing

Al pha draft

6-4

7 January 1983

WorKshop Refererlce Manual for the Lisa

The Assembler

If you specify a device name such as -PRINTER or -CONSOLEforthe listing
file, the listing will be printed on that device. If you specify a.disK file, the

listing will be created as a textfileiYou may thenprintitby usingthe Copy
command in the File Hanager commarld line.
6.3 Assembler Opcodes
The 6:::000 opcodes are described in the Motorola MC68000 Microprocessor
User's Hanual. The assembler has two variant mnemonics for branches
(BHS for BCC arid BLOforBCS). The variantm.me!:. are more indicative of
how the instruction is being used afterl.Jnsigned comparisons. The default
radi:{ isdecimal.
The size of an operation (byte, 'Nord, or long) is !:.pecified by appending
either .B, .W, or.L tothe instruction. The default operation size isword. To
cause a short for ...... ard branch, append a .S to the instruction. The default
branch size is Long.
6.3.1 Optimization
It should be noted that the Assembler accepts generic instructions and
assembles the correct form. The instruction ADD, for e::t.
becomes

ADD
ADDA

D3,A5
D3,AS.

MOVE ,eMP, and SUB are handled in a similar manner.
6.4 Assembler Syrrtax
This section describes the form in which the assembler e: section of non code generating
operations. This is usually where any constants or macros are defined.
Ne:d itconains one or more procedures (.PROG) or functions(.FUNC). These
each contain a sequence of code generating opera.tionsand directives. A
procedure or function is ended when the a.ssembler encounters the ne}:t
.PROC or .FUNe. A .END directive is the last statement in the program.
Any te>:tbeyond the .8: ND is ignored.

Al pha draft

7 January 1983

The Assembler

WorKshop Reference Manual for the Lisa

non code gener'a ting opera tions
.PROC (or .FUND
code gener'a ting opera tionsand any directive:, needed
.PROC
etc •
.END
Figure 6-2. Structure of an Assembly Language Program
The non code generatingdirectivesare:
.EG.U
.RE:F
.DEF

.MACRO
.E: NDl1

.IF
.E:LSE:
.E:NDC

.LIST
.NOLIST
.PAGE:
.TITLE:

.MACROLIST
.NOMACROLIST
.PATCHLIST
.NOPATCHLIST

6.4.2 Constants
Constants in the A:.sembler ca.n be either'rlumeric clr string constants.
6.4.2.1 Numeric Constants
Numeric constar,ts in the assembler can be e>:pressed in decimal,
hexadecimal, octal, or·binary. Th~ defaultradi;( isdecimal. The otherthree
base:·are e:-:pr·e:.sedas follolNs:
He>:adecimal
He>: numbers can be e>:pressedin two ways:
1.

Preceed the number with a "$". E:>:amples of thisare:
$FF13
$127

2.

Fallow the number with an "H". UsinCl this farm, the number must
startwith a digit (0-9). E:xamples:
OFF13H
195H

Octa.l
Octal numbers are followed by the cha.racter "0". Note tha.t this i·:; the letter
O,not the chara.cter zero (0). E:>:amples:
770
1040

Al pna draft

7 January 1983

WorKshop Reference Hanual for the Lisa

The Assembler

Einary
Einarynumbers are followed by the character" B". E>:amples:
1011E
111000E

6.4.2.2 String Constants
String constants are delimited by matching pairsof single or dc.uble quotes.
E >: am pIe s of string cons tants are:
"thisis a str'ingconstant"
'using single quotesas delimiters lets you include "double" quotes'
6.4.3

IdentHiers
Only the first eight characters of identifier names are mea.ningful to the
assembler. The first character must be alphabetic; the rest must be
alphanumeric, period,underbar,or percent sign.
8::-:a.mples of identifiersare:
LOOP
EXIT_PRC

NUM

•
6.4.4 Labels and Local Labels
Labelsbegin in column one. They can be followed by a colon, if you liKe.
Local labels can be used to avoid using up the storage space required by
regular labels. The local label stacK can handle 21 labels at a time. ltis
cleared every time a regular label is encountered. Local labels in this
assembler start with the character ';iI. A local label is an '@ followed by a
string of decimal digits(O-9). E>:amples oflocallabelsare:
'@123
'@2
'@79
6.4.5 8:xpressionsand opera:tors
All quantities are 32 bits in size unless constr·a.ined by the instruction.
8::

There is no operator precedence in e>:pressions. For e:, or' the operand:. can be r·eorder·ed
as: 9 * 4 + 2.
6.4.6

Addressing Modes
The following i~. a ~·umrrta.ry of the addr'essing mode synta:< for the 6:3000.
Refer to the Motorola 6:::000 manual for information on the addressing
modes supported by the 6:::000. Table 6-1 gives a summa.ry of the
addressingmades including theirsynta.:<.
Table 6-1. Summary of Addressing Hodes
Made
0
1

2
3
4

5
6
7
7
7
7
7

Register
0 .. 7

0 •• 7
0 •• 7
0 •• 7
0 •• 7
0 •• 7
0 •• 7
0
1

..,
'"

3
4

Synta>:
Di
Ai
U-.i)

(Ai)+
-(Ail
e(Ail
e(Ai,Ril
e
e
e
e(Ri)
*Fe

Meaning

ExtraWords

Data direct
Addressdirect
Indirect
Postincre ment
Predecre ment
Inde>:ed
Offsetinde>:ed
Absolute shortaddress
Absolute long address
PC Relative
PC Relative inde::ample, to push registersDO through D2, D4, and AO through A4 onto the
top of the stacK:
II / " .

t10VEM. L

DO-D2/D4/AO-A4! -(An

6.5 Assembler Direc1:ives.
The Assembler directives (pseudo-ops}are:

Al pha draft

.PROC
.FUNC
.DEF
.REF
.SEG
,8:ND

C,E:{ pr J
:pr J

(identifier-list>
'(name>'

begin procedure with 8:::prargs
maKe identifierse:'


,WORD



.LONG
.ALIGN


<8::

place ASCII string in code
alloca te a byte in code for each value
allocate length bytesof value
a110ca te a word for each value
a.llocate a. long word for each value
allignrle>:t code on multiple of 8:>:pr

.ORG
.RORG




place next byte at 
same as .ORG

,8:G.U



setlabelequalto

c,value J

6-9

7 ,January 1983

WorKshop Reference M'anua] for theUs'a

The Assembler

.MACRO 
.ENDM

begin macro definition
end macro de fini tion

.IF
.ELSE
.ENDC

begin conditional assembly
optional 0.1 terna te to .1 F block
end conditional assembly



.LIST
.NOLIST
.PAGE
':pansionlisting
turnoff expansion listing
turnon patc:hlist
turnoff patchlist

.INCLUDe: 

insert< filename> into assembly

6.5.2 Space Allocation Directives.
The space allocatio,n directives are .ASCII, .BYTEl:, .WORD, .LONG, and
.BLOCK•

•ASCII 'string'
converts 'string'ir.to the equivalent ASCII byte constants and places the
bytesin the code stream. The string delimiters must be matching singleor
double quotes. To insert a single quote intothe code use double quotes as
delimiters. Similarly for double quotes:
.ASCI I

.ASCI I

"AB/CD"
'AB"CD'

; string containing a single quote
; string containing a double-quote

.EYTE 
allocates a byte of space in the code stream for each of the values giver,.
e:ach value must be between -128 and 255 •
•ELOCK  (,value J
allocates  bytes, each filled with the value given. If no value is
given, a blocl< of zeros is allocated •
•WORD 
allocates a word of space in the code stream for each of the values listed.
The values must be between -32768 and 65535.

Alpha draft

6-10

7 January 1983

WorKshop Reference Manual for the Lisa

TEMP

.WORD

The Assembler

0,65535,-2,17

creates the assembled output:

0000

FFFF
FFFE
0011
.LONG 
allocates two wordsof space foreach value in the list. Fore: .EG.U 
assigrls(value> to