When using this document, keep the following in mind:ntialGeneral Notice

1. This document is confidential. By accepting this document you acknowledge that you are boundby the terms set forth in the non-disclosure and confidentiality agreement signed separately and /inthe possession of SEGA. If you have not signed such a non-disclosure agreement, please contact
SEGA immediately and return this document to SEGA.

de2. This document may include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new versions of the
document. SEGA may make improvements and/or changes in the product(s) and/or the
program(s) described in this document at any time.

nfi

3. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without SEGA’S written permission. Request for copies of this document and for technicalinformation about SEGA products must be made to your authorized SEGA Technical Services
representative.

Co

4. No license is granted by implication or otherwise under any patents, copyrights, trademarks, orother intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third
party.
5. Software, circuitry, and other examples described herein are meant merely to indicate the characteristics and performance of SEGA’s products. SEGA assumes no responsibility for any intellectual
property claims or other problems that may result from applications based on the examples
describe herein.

GA

6. It is possible that this document may contain reference to, or information about, SEGA products(development hardware/software) or services that are not provided in countries other than Japan.
Such references/information must not be construed to mean that SEGA intends to provide such
SEGA products or services in countries other than Japan. Any reference of a SEGA licensed product/program in this document is not intended to state or simply that you can use only SEGA’slicensed products/programs. Any functionally equivalent hardware/software can be used instead.
7. SEGA will not be held responsible for any damage to the user that may result from accidents or any
other reasons during operation of the user’s equipment, or programs according to this document.

SE

NOTE: A reader's comment/correction form is provided with thisdocument. Please address comments to :(6/27/95- 002)

SEGA of America, Inc., Developer Technical Support (att. Evelyn Merritt)
150 Shoreline Drive, Redwood City, CA 94065
SEGA may use or distribute whatever information you supply in any way
it believes appropriate without incurring any obligation to you.

SE

GA

Co

nfi

de

nti
al

TM

Sound
Programming
Debugger
User's Manual
Rev. 0.93
Doc. # ST-65-R1-031494© 1994 SEGA. All Rights Reserved.

nti
al

READER CORRECTION/COMMENT SHEETKeep us updated!
If you should come across any incorrect or outdated information while reading through the attacheddocument, or come up with any questions or comments, please let us know so that we can make therequired changes in subsequent revisions. Simply fill out all information below and return this form to
the Developer Technical Support Manager at the address below. Please make more copies of this form if
more space is needed. Thank you.
General Information:

Phone

Document number
Document namedeYour Name

Date

ST-65-R1-031494

Sound Programming Debugger User's ManualCorrections:
Correction

nfi

pg. #

GA

Co

Chpt.

SE

Questions/comments:

Fax:

Where to send your corrections:(415) 802-3963
Attn: Manager,
Developer Technical Support

Mail:

SEGA OF AMERICA
Attn: Manager,
Developer Technical Support
275 Shoreline Dr. Ste 500
Redwood City, CA 94065

nti
al

REFERENCES

In translating/creating this document, certain technical words and/or phrases were interpreted with theassistance of the technical literature listed below.

Dictionary of Science and Engineering, 350,000 words, 3rd Edition
Inter Press
Tokyo, Japan
1990

2.

Computer Dictionary
Kyoritsu Publishing Co., LTD.
Tokyo, Japan
1978

3.

IBM Dictionary of Computing
McGraw-Hill, Inc.
New York, New York
1994

SE

GA

Co

nfi

de

1.

SE

GA

Sound Programming Debugger User's Manual

de

3
4
4
4
4
5
6
6
6
6
6
6
7
7
7
7
8
8
9
10
11
11
14
15
16
18
19
20
22
23
24
24
24
26
26
27
29
30
30
30
30
31
31
32
33
35
37
37
38
39
40
41
42
43
43
43
44
44
44
44
45
45

nfi

Co

Introduction
1.0
Setup
Operating Environment
Setup
Installation
Starting Up SSBug
2.0
Defintions
Constants
Variables
Unary Operators
Binary Operators
Symbols
Wild Cards
Registers
FunctionsTerms & Expressions
Order of Procedure of Operators
Statements
3.0
Console Commands
Execution Control
Register Operation
Memory Operation
Assemble
Software Breaks
Hardware Breaks
Access BreakBus Trace
File Operation
Symbol Operation
Macro Operation
Batch Jobs
BA
Other
4.0
Menual Environment
Apple Menu
File Menu
UploadVerifyWorking Directory
Close
Quit
Edit Menu
CPU Control Menu
SCSP Interrupt Controller
Memory Menu
Breakpoint Menu
Window Menu
Console Window
Dump Window
Code Window
Bus Trace Window
Register Window
Status Window
5.0
Use Restrictions
Problems with SCSI Interrupts
Vectors Hooked by SSBug
Memory Hidden by SSBug
Critical Time Periods
SCSI Noise
Carriage Returns
Symbol Files
Restrictions with Respect to Saturnnti
al

CONTENTS

1

2

GA

SE
nti
al

de

nfi

Co

nti
al

Introduction
SSBug is a symbolic remote debugger for the sound CPU (MC68EC000) on the
Saturn development board for use in Apple Macintosh computers.

It supports the conventional character terminal interface and the standard Macintosh
user interface, and debugging can be performed using either one or both of theseinterfaces.

deSSBug can be used with the sound board alone, but when used in conjunction withthe main CPU board, synchronized breaks with the main CPU are also supported.

SE

GA

Co

nfi

Apple, KanjiTalk 7 and System 7 are registered trademarks of Apple Computer.
Macintosh is a trademark of Apple Computer.
MS-DOS is a registered trademark of Microsoft Corp..
CP/M is a registered trademark of Digital Research.
Model names, chip names, etc. are generally makers’ brand names.

Sound Programming Debugger User's Manual3

Operating Environment
The following configuration is required to run SSBug.
•
•

nti
al

1.0 Setup

Apple Macintosh computer with a SCSI interface and KanjiTalk 7 or System 7 or later.
Saturn development system (can be used with sound board alone)de

SSBug distinguishes whether it is running under KanjiTalk 7 or any other Japaneseenvironment (or more correctly, an environment in which a Japanese script is operating). It displays Japanese when it is possible to use Japanese and English when
Japanese cannot be displayed, thus making it fully functional when running on an
English system.
Setup

nfi

Refer to the Sound Development Manual regarding connection to a Macintosh.
When only SSBug is used, connection can be made only via the SCSI port.
Also, since SSBug automatically distinguishes the SCSI ID of the sound board, no
settings are required with respect to SSBug-side SCSI.
Installation

GA

Co

SSBug is supplied in the following four files:

Descriptions of the files are given below.
••••

SSBug: the debugger program for the Macintosh
SSBug Target Code: debugger program for sound board
SSBug Startup: sample startup file described below
SSBug/ReadMe: latest information regarding SSBug

SE

To install, take the following steps:
1. Copy the SSBug Target Code file to the system folder on the startup disk by
dragging it to the system folder.
2. Copy the remaining files to any desired location. This completes installation,and there is no need to restart the Macintosh.

4Starting Up SSBug

SE

GA

Co

nfi

de

nti
al

SSBug can be started by double-clicking on its icon or by opening it up from theFinder. Since SSBug does not support Apple Events, SSBug will not startup evenwhen double-clicking on files produced using SSBug or use drag&drop.

Sound Programming Debugger User's Manual5Definitions

Constants
The constants that can be used in SSBug are listed below.
• Hexadecimal constants:• Decimal constants:• Binary constants:

nti
al

2.0

character strings of any desired length beginning with ‘$’ andcomprised of the characters [0-9A-Fa-f]character strings of any desired length beginning with ‘\’ andcomprised of the characters [0-9]character strings of any desired length beginning with ‘_’ andcomprised of the characters [0, 1]

deEvaluation is performed in the 32-bit mode without sign. Overflow amount isignored, and the Hexadecimal prefix ‘$’ can be omitted.

nfi

Variables
The variables that can be used in SSBug are listed below.
@0, @1, @2, ..., @9(These are variables that the user can freely assign and reference with no 32-bit code.)

Co

Unary Operators
The unary operators that can be used with SSBug are as follows.
+ positive sign
– negative sign
~ 1’s complement

SE

GA

Binary Operators
The binary operators that can be used with SSBug are as follows.
+ sum– difference* multiplication/ division& logical product| logical sum% remainder of the dyadic division^ not-if-then logical sum<<
arithmetic left shift>>
arithmetic right shift
Symbols
In SSBug, symbols are referenced by attaching a ‘.’ before the symbol name. The
characters that can be used as symbols are listed below.
[A-Z], [a-z], [0-9] and $, _, ?, @SSBug always distinguishes between upper case and lower in its symbols.

6

Wild Cards

ntialWild cards are meta characters which are used when specifying multiple character
strings. The following wild cards can be specified in SSBug.
*
Matches a character string of a specified length. However, characters appearing after these characters are ignored.
?
Matches any desired character.
Registers•

Case is ignored in register names.
When symbol names and register names conflict, the symbol name takes precedence.
The character “.” is added at the start only when referencing the value in a expression;
the character “.” is not specified during line assemble or when substituting values per
X command.
The value of CCR becomes the value of the lower byte of the SR register.

nfi

•
•
•

de

The CPU registers are also referenced in SSBug by attaching a period ‘.’ at the beginning. The following register names can be used.
D0 D1 D2 D3 D4 D5 D6 D7
A0 A1 A2 A3 A4 A5 A6 A7
SSP USP PC SR CCR

Functions

•
•

GA

Co

The SSBug’s built-in functions are listed below.
@B(expr):contents of one byte at address expr on sound board@W(expr):contents of one word at address expr on soundboard@L(expr):contents of one long word at address expr on soundboard@BP(expr):
address of the expr-th software breakpoint@EXTBL(expr):
value of expr code sign-extended from word to long
word
@EXTBW(expr):
value of expr code sign-extended from byte to word
@EXTWL(expr)
value of expr code sign-extended from word to long
word
Case is ignored in function names (characters between ‘@’ and ‘(‘).
BP(expr) returns a value regardless of whether or not the breakpoint is enabled.

Terms and Expressions

SE“Term” refers to character strings whose values can be evaluated.
Hexadecimal constants
Decimal constants
Binary constants
Symbols
Register names
FunctionsSound Programming Debugger User's Manual

7

nti
al

The terms and expressions on the previous page are the least divisible units with
their own values, and are referred to as elementary terms. Elementary terms canmake up terms as described below.
Terms: elementary term
unary operator + elementary termelementary term + binary operator + elementary term{+ binary operator + elementary term {+ ...}}
There can be any (arbitrary) number of white space characters (tab characters or
space characters) between an operator and an elementary term.

de“Expression” refers to character strings comprising an arbitrary number of terms
and with values that can be evaluated.
Expressions: term
unary operator + term
term + binary operator + term {+ binary operator + term {+ ...}}

Order of Precedence of Operators

High 0Statements

7() elementary term
1
~unary + unary2*/%
3binary + binary4
>> <<
5
&
6
^
|

GA

Low

Co

The order of precedence is as follows.

nfi

An arbitrary expression may be enclosed in parentheses, where the part enclosed in
the parentheses is treated as a single term.

Character strings that specify operations in SSBug are called commands. Command
names are formed by the following characters.
[A-F] [a-f] [0-9] ! # $ % & ( ) ? @SE

Some commands require an expression or an arbitrary character string as an argument. The character strings completed as command where include these required
arguments are called statements. There must be at least one white space character
between command names and arguments; further, multiple arguments must be
separated by a comma “,”. There may be any number of white space characters
before or after commas.
Statement:

8command argument{,argument{,argument{,...}}}

In SSBug, the maximum length of completed character strings of commands or statements is 255 characters.

3.0

Console Commands

nti
al

•

The console command environment is an operating environment that uses a character terminal interface. Operation is progressed per a console window like that below
by inputting commands from the keyboard. These are called console commands.

Co

nfi

de

ConsoleGA

Refer to “Menu Environment” in the next chapter for more information on how todisplay console windows and operate them.
Terms used in the following explanations have the following meanings.

SE

range

regexpspecifies a range of addresses or values; 2 expressions separated bycommas, where the first expression is referred to as “from” and thelast expression is referred to as “to” and the range of values becomesfrom <= value <= tocharacter strings including any selected number of the wild cardcharacters ‘?’ and ‘*’; these are especially used when specifying
multiple symbols.

In command notations, factors surrounded by brackets [] can be omitted.

Sound Programming Debugger User's Manual

9

nti
al

Execution Control
G

Format:Explanation:

G[expr1][,expr2]
Executes a user program from address expr1 and stops it ataddress expr2. When expr1 is omitted, the value of the current
PC is used. If expr2 is omitted, execution of the user program
continues unless it is stopped for some other reason.

Format:Explanation:

T[expr1][,expr2]
Executes expr1 commands from address expr2 and stops. The
register contents and the command to be executed next are
displayed with each command. If expr2 is omitted, the value ofthe current PC is used. If expr1 is omitted, “1” is used.

Format:Explanation:

TU[expr1][,expr2]
This is the same as the T command except that the register
contents of each command are not displayed.

Format:Explanation:

S[expr1][,expr2]
Executes expr1 commands from address expr2 and stops. The
register contents are displayed with each command. If expr2 isomitted, the value of the current PC is used. If expr1 is omitted,
1 is used. This command differs from the T command withrespect to the following points.
• bsr, jsr
Treated as 1 command from the execution of a subroutine until
return.
• trap, trapv, chk, A line trap, F line trap
Treated as 1 command from exception processing until return.

de

T

nfi

TU

SU

GA

Co

S

Format:Explanation:

STOP

STOP
Stops the execution of the user program.

SE

Format:Explanation:

SU[expr1][,expr2]
This is the same as the S command except that the register
contents of each command are not displayed.

RESET

Format:Explanation:

10

RESET
Resets the CPU registers and masks all the SCSP interrupt
enable registers.

SCOPESCOPE[arg]Can periodically display in the register window the status of the
CPU registers of the SSBug user program being executed. The
SCOPE command performs this setting. Specify the following
character strings for arg.
ON: switches display ON
OFF: switches display OFF
Omitted: displays the current settingsntialFormat:Explanation:

Register OperationdeX

Format:Explanation:

X
Lists the values of the CPU registers.

Format:Explanation:

Xreg,expr
Sets the value expr in the CPU register reg.
A period is not inserted in the register name with this command.

D,DB,DW,DL

Format:D[range]DB[range]
DW[range]DL[range]
Dump/displays the specified address area range to the display.
The commands DB, DW and DL result in byte display, word
display and long word display, respectively, and change thedefault display size to byte, word and long word.
The D command displays in the default display size.
Word display and long word display are possible from odd
addresses in SSBug. Either ‘from’ or ‘to’ may be omitted per
range. When ‘from’ is omitted, the next address where any of
the commands D, DB, DW or DL is previously completed will
result. When ‘to’ is omitted, ‘from+$7F’ will result.

SE

GA

Explanation:

Co

Memory Operation

nfi

X

F,FB,FW,FL

Format:Frange,expr
FBrange,expr
FWrange,expr
FLrange,expr

Sound Programming Debugger User's Manual11Fills the address range range with data expr. Fill means to put inas much as can be held. The FB, FW and FL commands specify
byte, word and long word operation, respectively, and change
the default fill size to byte, word and long word.

The F command executes fill using the default fill size.
ME,MEB,MEW,MEL

Explanation:

MEexpr1,expr2
MEBexpr1,expr2
MEWexpr1,expr2
MELexpr1,expr2
Writes data expr2 to address expr1. The MEB, MEW and MEL
commands write in bytes, words and long words, respectively,
and change the default write size to byte, word and long word.
The ME command executes in the default write size.

deFormat:ME[expr1]
MEB[expr1]
MEW[expr1]
MEL[expr1]
Performs interactive memory editing from address expr1. The
MEB, MEW and MEL commands write in bytes, words andlong words, respectively, and change the default write size tobyte, word and long word.
The ME command executes in the default write size.
During interactive editing, a prompt like that shown next is
displayed in the input area of the console window.

Co

Explanation:

nfi

ME,MEB,MEW,MEL

Format:SE

GA

Console

12

nti
al

Explanation:

nti
al

• Enter “/” or “.” to terminate interactive editing.
• Return to the previous address by entering “^” or “-”.
• By entering a space, advance to the next address without making any changes tothe contents of the current address.
MS,MSB,MSW,MSL

Explanation:

MSrange,expr
MSBrange,expr
MSWrange,expr
MSLrange,expr
Searches for the data expr in the address range range. The MSB,
MSW and MSL commands specify byte, word and long word
search, respectively, and change the default search size to byte,
word and long word.
The MS command is executed in the default search size.

deFormat:

MM

MC

nfi

MCrange,expr
Compares the contents of the address range range with thecontents after address expr.

SE

GA

Format:Explanation:

MMrange,expr
Copies the contents of the address range range to after address
expr.
• Since the MM command transfers the contents of the memoryon the target board to the host and performs a replacement
operation at the host, operation slows down if the transfer
origin and the transfer destination overlap.

Co

Format:Explanation:

Sound Programming Debugger User's Manual13

Assemble
A

Co

nfi

Consolenti
alA[expr]Performs line assemble from address expr. The mnemonic andaddressing mode notation used follows that used by Motorola,but please note that constant notation and overflow in expression evaluation are ignored. When expr is omitted, the address
following that used by the previous A command is used. During interactive line assembly, a prompt like that below is displayed in the input area of the console window.

deFormat:Explanation:

GA• Enter “/” or “.” to terminate interactive line assembly.
• You can return to the previous address by entering “^” or “-”.
• By entering a space, you can advance to the next address without making any changes
to the contents of the current address.
• Specifications of absolute addresses are interpreted as described below.
expr absolute long address
expr.1 absolute long address
expr.w absolute short address

SE

L

Format:Explanation:

14

LrangeDisassembles and displays the address area range. When fromis abbreviated, the next command where the previous L command is completed; when to is abbreviated, ‘from+$1F’ isadopted. If ‘from’ is an odd number, then it is made into aneven number.

Software Breaksntial

A software break stops the execution of the user program by generating an exception when a specified address is rewritten to illegal command. Therefore, a software
break can only be set at a location that is an even address in the DRAM area on thesound board, and is executed by the CPU as a command. SSBug has 16 of these kindof software breakpoints, and it is also possible to set the pass count.
The number of times they are passed through without stopping is referred to as thepass count, and the number of times they are actually passed through is referred toas the break count. When expressing software break numbers, specify them in an
expression with values from 0 to 15.

deB

Format:Explanation:

B
Displays a list of the software breakpoint and hardware
breakpoint settings.

Format:Explanation:

Bexpr1 [,expr2]
The software breakpoint is set at address expr1. The pass countis set in expr2. If it ‘0’, break is continually applied. When a passcount other than ‘0’ is specified, then break is applied continually when the break count exceeds the pass count. The values
that can be set in expr2 range from 0 to 65535, and becomes ‘0’ ifomitted. Of the software breakpoints currently canceled, the Bcommand sets the most recent at address expr1.

BC

Format:Explanation:

BCexprCancels the software breakpoint at number expr. When ‘*’ isspecified in expr, all software breakpoints are canceled.

Format:Explanation:

BEexprEnables the software breakpoint at number expr which has beencanceled by BC. When ‘*’ is specified in expr, all software
breakpoints are enabled. When this command is executed withrespect to a software break where no settings have been madesince startup, the setting may occur per a meaningless address,
so please use caution.

SE

BE

BNexpr1, expr2 [,expr3]
This is the same as the B command except that the number ofthe software breakpoint set is specified in expr1. The breakpoint
set at number expr1 is canceled up to that point. The address is
specified by expr2 and the pass count by expr3.

GA

Format:Explanation:

Co

BN

nfi

B

Sound Programming Debugger User's Manual

15

BR

BRexprClears the break count for breakpoint number expr. When ‘*’ isspecified in expr, the break count of all software breaks iscleared.

nti
alFormat:Explanation:

Hardware Breaks

A hardware break monitors the generation of the specified number of bus cycles via
CPU external hardware, and stops execution of the user program by providing an
NMI to the CPU when the target bus cycles occur. The following bus cycle conditions can be set.

de

• Address bus• Function codes• Read/write• Access data width• Access countnfi

Up to three hardware breaks can be set, and are called channel 0, channel 1 andchannel 2 respectively.
Be careful a break does not come after the bus cycles are generated or after access is
terminated. For example, in the case of write access, write is already terminated at
the time of the break.

Co

Also note that the MC68000 performs pre-fetch of program code and movem command data. Especially when a hardware break is used for program execution, thebreak may be applied before execution or a break may be generated by commands(immediately after jmp, etc.) which are not executed.
HB

HB

HB
Displays a list of the settings of software breaks and hardware
breaks.

GA

Format:Explanation:

HBbpnum,adr[,mask[,cnt[,<fc>[,<ds>[,<rw>]]]]]
Sets a break point in the hardware break channel bpnum.
adrr—address
mask—address mask (described below)
cnt—break count<fc>—function code<ds>—access data width<rw>—read/write

SE

Format:Explanation:

bpnum is 0, 1 or 2.
adr is the address in MC68000

16

de

nti
al

mask is explained below. It’s omission value is 0.
A value from 1 to 65535 can be specified for cnt. It’s omission
value is 1.
One of the following character strings is specified for <fc>.
user(user mode access)super(supervisor mode access)data(data access)prog(program access)ud(user data access)up(user program access)sd(supervisor data access)sp(supervisor program access)is set to an arbitrary mode when abbreviated.

nfi

One of the following character strings is specified for <ds>.
low(lower byte access, odd addresses)
high(upper byte access, even addresses)
word(word access)is set to an arbitrary mode when abbreviated.

Co

One of the following character strings is specified for <rw>.
read(read access)write(write access)
When abbreviated, both read and write will be the target.

HB

GA

Mask is equivalent to the undefined bit in most ICE, etc., andthe bit for which mask is 1 is ignored during address comparison. For example, if $1000 is specified for the address and $00FF
is specified for the mask, the address at which the break is
actually generated becomes a selected address from $1000 to$100FF.

Format:Explanation:

HBbpnum,adr,[mask],[cnt],PFTo apply a break to a program fetch, eliminate excessive specifications by writing the character string “PF” after cnt as shownhere.
• This can be used in both the user mode and the supervisor mode.

SE

HB

Format:Explanation:

HBbpnum,[level],[cnt],IA
To apply a break to an interrupt acknowledge cycle, Write thecharacter string “IA” after cnt as shown here. The interrupt levelis specified in level. If omitted, it becomes ‘Don’t care’.
• Do not specify ‘Don’t care’ or ‘level 1’ or ‘level 7’.

Sound Programming Debugger User's Manual

17

HBC

HBCbpnumCancels the hardware break in channel bpnum.
All channels are canceled when the character ‘*’ is specified inbpnum.

ntialFormat:Explanation:

HBE

Format:Explanation:

HBEbpnum
Enables the hardware break in channel bpnum.
All channels are enabled when the character ‘*’ is specified inbpnum.

de• The HBE command enables break regardless of the setting.
• The pass count for the hardware break is initialized each time user
execution is started.

Access Breaknfi

Access break sets whether or not read or write is allowed per every 4 Kbytes withrespect to the entire CPU area, and detects pass cycles in violation of these settings
via external hardware monitoring. As with hardware breaks, be careful that the passcycles are terminated when a break is generated.
MAP

MAP
Displays a list of access break settings.

Co

Format:Explanation:
MAP

MAPrange, acc
Sets the access break condition acc in the address range range.
acc specifies one of the following character strings.
RW
read/write is enabledRO
read only, break is generated with write accessNO
read is disabled, break is generated with a selected
accessIf the range does not have 4 Kbyte boundaries, then it isrounded up.

GA

Format:Explanation:

SE• In normal use, also set the following areas as read/write areas inaddition to the area used by the user program.

$600000-$67FFFF (ROM mounted area)$800000-$82BFFF (emulator-mounted area)$A00000-$A00FFF (MB89352A-mounted area)$E00000-$E07FFF (debugger area)$F00000-$FFFFFF (area used by sound tool only whensound tools exists together)• These settings are written in the accompanying startup file SSBug
Startup. Please use them as reference.

18

Bus Tracential

Bus trace records the bus cycles using external hardware. The sound board canrecord up to 8192 bus cycles. The signals recorded are as follows.
• Address bus• Data bus
• FC
• R/W
• MCCS (B-BUS select signal)
BHde

BHexpr
Displays the past “expr” times worth of history since the previous stop. Due to the MC68000 command prefetch, disassembly
display of this command is not necessarily correct. Specifically,
the instruction after a conditional branch (instruction) is likely
to be displayed incorrectly. Also, according to the hardware
specification, the operation of the debugger could be recorded.

nfi

Format:Explanation:

In the following examples, the SCSI communication condition of the debugger isrecorded.

Address

Data

Code

SE

GA

Count

Co

Bus Trace

The contents from a SCSI interrupt is received at count #294 until the bus trace isstopped at #276 are recorded.

Sound Programming Debugger User's Manual

19

nti
al

In the following example, a software break is set at $200. Since it has not reached
the pass count, user execution is not stopped and is continued.
Bus Trace
Address

Data

Code

nfi

de

Count

Co

In this example, from 4084 to 4072 becomes the extra debugger operation that isrecorded. In the interval between 4072 and 4071, the debugger code is executed
but is not recorded. Also, there is a command prefetch that was not executed at
4083, therefore the disassembly display from 4077 is shifted.
File Operation

A working directory is introduced as a concept to operate files via console commands. The working directory is similar to the current directory in MS-DOS, etc.,
and settings are changed by selecting “Working Directory” from the file menu.
The file used by console commands include:GA• the file when the full path name is specified• the path specification in relation to the working directory when a partial
path name is specified.

SE

For example, if the working directory is “:Macintosh HD:Development:SSBug
Folder”, then the command “r main.s28” would download the file “Macintosh
HD:Development:SSBug Folder:main.s28”. SSBug only handles the data forks offiles, and all files handled, including binary data, are ‘TEXT’.
PWD

Format:Explanation:

PWD
Displays the current working directory.

• SSBug remembers the working directory when the previous session is terminated,
and this is automatically set at startup.

20

R

R[filename[,expr]]
Reads the file filename to offset address expr. If expr is omitted, 0
is used. The file formats Motorola S19, S28 and S37, Intelex Hex
format, 2500 A.D. symbol file, ZAX symbol file and SDSS symbol file are automatically distinguished. Files that cannot beread are treated as binary files. In the case of symbol files, expr
is added to the symbol value. In the case of S28 and other files
with an address specification, expr is added to the specified
address. In the case of binary files, the top address for read is
used.

nti
al

Format:Explanation:de• In all of the file operation commands below, the same operation as
selection from the menu is performed when the file name is omitted.
RBRB[filename[,expr]]
Treats the selected file filename as a binary file and reads it toaddress expr. If expr is omitted, 0 is used.

Format:Explanation:

V[filename,[expr]]
Compares the file filename with the contents of memory or thecontents of symbol. The file formats Motorola S19, S28 and S37,
Intelex Hex format and symbol files are automatically distinguished. Files that cannot be read are treated as binary files. In
the case of symbol files, expr is added to the symbol value. In
the case of S28 and other files with an address specification, expr
is added to the specified address.

nfi

Format:Explanation:

Co

V

VB

Format:Explanation:

VB[filename[,expr]]
Treats the selected file filename as a binary file and compares itwith the contents of memory. If expr is omitted, 0 is used.

Format:Explanation:W[filename,range[,offset]]
Writes the contents of the address range range to the file filenamein the Motorola S28 format. offset is added to the address valueof the S record. ‘0’ is used when omitted.

SE

W

GA

• When verifying symbol files, value comparison will be against thesame-name symbols among those already loaded and those in the file.

Sound Programming Debugger User's Manual

21

WB

WB[filename,range]
Writes the contents of the address range range to the file filename
in binary format.

Format:Explanation:

WS[filename]Writes the currently loaded symbol to the file filename.

nti
alFormat:Explanation:

WS

Symbol OperationSR

SR[regexp]
Displays a symbol matching regexp. When regexp is omitted, thecharacter string “*” is used.

Format:Explanation:SV[regexp]
Treats the value of symbols matching regexp as signed integers,
sorts in ascending order, and displays them. If regexp is omitted,
then the character string “*” is used.

Format:Explanation:

SU[regexp]
Treats the value of symbols matching regexp as unsigned integers, sorts in ascending order, and displays them. If regexp is
omitted, then the character string “*” is used.

Format:Explanation:

SN[regexp]
Sorts symbols matching regexp in ascending order of the names
and displays them. Upper case and lower case are sorted in
dictionary order. If regexp is omitted, the character string “*” is
used.

de

Format:Explanation:

nfi

SV

Co

SU

SC

GA

SN

Format:Explanation:

SE

SS

SC[regexp]
Displays the number of the symbol matching regexp. If regexp is
omitted, the character string “*” is used.

Format:Explanation:

22

SSexpr
Searches for a symbol whose value is expr and displays it.

SD

SDregexp]
Deletes a symbol matching regexp.

Format:Explanation:

SAname,expr
Records the symbol whose symbol name is name using the value
expr. If the same name is already recorded, the value is updated.

ntialFormat:Explanation:
SAde• The maximum number that can be sorted by the entire symbol
display commands is 16,384. No more than 16,384 symbols can bedisplayed by “commands with sort,” and only the SR command canbe used when the number of symbols is more than 16,384.

Macro Operation

nfi

Macro’s make it possible for the user to define a selected number of statements as one command. Macro execution is performed by using the macro name as a command name as withother built-in commands. When an argument is desired, a“special character” is used in the macro definition for reference.
It is not necessary to describe a dummy argument.
MACRO

EXITM

Format:Explanation:

MACROnameSets the macro with name name. Defining is terminated by
inputting a blank line.

Co

Format:Explanation:

EXITMexpr
This command can only be executed during macro development. If expr is ‘0’, the macro being executed is exited.

GA

MLIST

SE

Format:Explanation:

MLIST[regexp]
Displays macro names matching regexp and their contents.
Displayed after being sorted in macro name dictionary order.
If regexp is omitted, the character string “*” is used.
• The same restrictions that apply to symbol operation commands
apply to sort display.

WM

Format:Explanation:

WMfilename
Writes the currently registered macro to file filename.

Sound Programming Debugger User's Manual

23

RM

RMfilename
Reads a macro definition from the file filename.

nti
alFormat:Explanation:de• Description and expansion example of argument
The nth macro argument is noted as “n” in the macro definition,
where n is an integer from 0 to 9.
•Macro definition
MACRO
wordwrite
mew‘0,’1•Command input
wordwrite
100,123•Expansion resultmew
100,123

Batch Jobs

nfi

Batch job is the reading and execution of a file in which a selected number of statements are described. These files arecalled batch files.
BA

BAfilename
Executes the batch file filename.

Co

Format:Explanation:

The commands RM and BA are actually the same. Macros canbe defined in a batch file and other statements can also be executed in a macro file.

GA

Startup Files

Startup files refer to batch files automatically executed when
SSBug is started. When the text file “SSBug Startup” is in theworking directory when SSBug is started up, this is treated as astartup file and executed.

Other
HELP

HELP
Opens the help window.

SE

Format:Explanation:

24

VERSION

VERSION
Displays the version of SSBug itself, the target program and the
SCSP.

nti
al

Format:Explanation:

MEMFREE

Format:
MEMFREE
Explanation: Displays the amount of memory that can be used for macros, symbols,
batches, etc.
ECHO

de

ECHO[arg]
ECHO ON
Echoes the input line from the current input destination (macro,
console, or batch) to the console. This becomes a local setting
for each nest of the macro, console or batch.
ECHO OFF
Switches echo off.
ECHO
Echoes other specified character strings to the console.

nfi

Format:Explanation:

QUIT?
Format:Explanation:?

?
Displays a list of user variables.

?expr
Evaluates the expression expr and displays the result.

SE

GA

Format:Explanation:

QUIT
Terminates SSBug.

Co

Format:Explanation:

Sound Programming Debugger User's Manual25

Menu Environment

nti
al

4.0

SSBug can also be operated via the standard Macintosh user interface.
The same expressions as in the console environment can be used at all locations that
accept numerical input in dialogs.
Apple Menu
There are two items in the Apple menu.
File

Edit

CPU Control

deAbout SS BUG
Help

nfi

Control Panel
Scrapbook

SE

GA

Co

“About SSBug…” displays the version and other information about SSBug. The
window is closed by clicking in the window.

26

Help

nti
al

“Help” opens the help window shown below. Click on the subject to see in the “HelpIndex” in the left part of the window. A description of that subject will appear on
the right side of the window.

Hardware BreakHelp Index

HB

About this version
Handling files
Execution control
Memory operation
Register operation
Break
Assemble, Disassemble
Symbol operation
Batch and macro
Bus trace

Software and hardware break setting conditions arelisted:de

HB bpnum, adr[, mask[, cnt[, <fc>[, <ds>[, <rw>]]]]]
Set break point per hardware break channel bpnum.
adr- address
mask- address mask (described later)
cnt- break count<fc>- function code<ds>- access data range<rw>- read/write

File MenuCo

nfi

bpnum is either 0, 1, or 2.
adr is MC68000 address.
mask will be described later. The abbreviated value is1.
cnt can be specified from 1 to 65535. The abbreviatedvalue is 1.

This menu deals mainly with file operations.

File
File

Edit CPU Control

GA

Download...
Upload...
Verify...
Working Directory...
Close

SE

Quit

Download

Equivalent to the console commands R, RB, RM and BA. All file load operations foruser programs, symbols, macros and batches can be performed from this menu.

Sound Programming Debugger User's Manual

27

nti
al

1. When “Download” is selected, the following dialog for selecting a file is dis
played.

Eject

deDesktop

Cancel

nfi

Open

Co

2. When a file is selected, the following dialog for specifying the format or offset
address is displayed

Download

File "SCSPTOOL.S28" download
Format:Motorola S fileGA

Offset Address:

CancelEnter

SE

3. The format is set in a menu, and the offset address is set by inputting a formula.

28

UploadntialIs equivalent to the console commands W, WB, WM and WS. All file save operations
for user programs, symbols, macros and batches can be performed from this menu.
1. When “Upload” is selected, the following dialog for specifying the file to be
saved is displayed.
UploadBinary File

Format:deStart Address:
End Address
Offset Address:

Cancelnfi

New Line Code:

Enter

Co

2. The format is set in a menu, and the offset address is set by inputting a formula.
The new line designation is only valid when the output is text. The following
dialog for inputting a file name is displayed next.

GA

Desktop

Eject
Desktop
New

Canceluntitled

Save

SE

save binary file as:Sound Programming Debugger User's Manual29VerifyntialVerify is equivalent to the console commands V and VB. Operation is similar to
download, but the result of verify is displayed in an information window like that
below.

If there are tool many results, then the older information is lost from the window.

nfi

•

de

Info

Working Directory

Co

When you select Working Directory, the following dialog will appear. Please
select using the button at the bottom of the dialog box.

GA

Working directory setting:SE

Select "LOGIC Audio"

Close

Closes the front (active) window.
Quit

Quits SSBug.

30

Eject
Desktop

CancelOpen

Edit Menu

File

Edit

CPU Control

Memory

Cut
Copy
Paste
Clear
Select All• Undo is not supported.

CPU Control Menu

nfiShow Clipboard

de

Undo

nti
al

The Edit menu is used primarily to cut and paste text in accordance with the standard Macintosh interface.

This menu is used to control execution of user programs.

Co

Edit CPU Control Memory Breakpoint
Stop
Trace execution
Step execution

Execute up to selected position

GA

Reset

SCSP interrupt controller

Except for “SCSP Interrupt Controller”, the following commands correspond to theconsole commands as shown below.

SE

Run
Stop
Trace
Step
Run to Specified Point
Reset

Sound Programming Debugger User's Manual

G
STOP
T
S
G ,expr
RESET

31

nti
al

The following dialog for specifying an address is displayed for Run to Specified
Point.
Value Input

Evaluation result:

Hexadecimal 0
Decimal0SymbolCancelApply

nfi

SCSP Interrupt Controllerde(Execute up to selected position)

Allows the operation of the interrupt enable register (SCIEB) and the interrupt
pending registers (SCIPD, MCIPD) of the SCSP.

Sound CPUInterrupt allowed:
External Interrupt 0
External Interrupt 1

Sound CPUInterrupt pending:External Interrupt 0

External Interrupt 1

External Interrupt 1

External Interrupt 2External Interrupt 2

MIDI Input

MIDI Input

DMA End

DMA End

DMA End

CPU

CPU

CPU

Timer A

Timer A

Timer A

Timer B

Timer B

Timer B

Timer C

Timer C

Timer CMIDI Output

MIDI Output

MIDI Output

Sample Interval

Sample Interval

Sample Interval

SE

MIDI Input

SCSP version: 332

Main CPUInterrupt pending:External Interrupt 0

GA

External Interrupt 2

Co

SCSP Interrupt Controller

CancelSet

CPU Control MemoryntialMemory Menu
Breakpoint

Search...
File...
Compare...
Move...

These correspond to the console commands as shown below. Through each selection, a movable modal type dialog for inputting arguments is displayed.

de• Retrieve Corresponds to MS command. However, the results are displayed in
an information window.

Start address
End address

Co

Search value

nfi

Memory Search

Search size

Byte

Cancel

SearchCancelFile

GA• Fill Corresponds to F command.

Memory File

Start address
End address

SE

File value
File size

Byte

Sound Programming Debugger User's Manual33

Corresponds to MC command. However, the results are displayedin an information window.
Memory Compare

Start address
End addressComparing address

Corresponds to MM command.

nfi• MoveComparedeCancelntial• Compare

Memory Move

End address
Moving address

Co

Start address

SE

GA

Cancel34

MoveMemory

Breakpoint
Software break...
Hardware break...

Windownti
alBreakpoint Menu

deWhen selecting Software Break, the following movable modal dialog box will be
displayed: The same operations as can be performed by the console commands B,
BE, BC and BR can be performed.

Software Break
EnableBreakpoint #0

nfi

Address

Command CodeBus Count

Clear

Co

Break Count

Clear {illegible?}

Disable All

Cancel

Apply

SE

GA

When selecting Hardware Break, the following movable modal dialog box will
be displayed: The same operations as can be performed by the console commands
HB, HBE and HBC can be performed.

Sound Programming Debugger User's Manual35EnableBus Cycle:

Bus Cycle in general

Function Code:

Arbitrary

Data Range:

Arbitrary

Read/Write:

ArbitrarydeChannel #0

Address
Mask

nfi

Bus Count

CancelSE

GA

Co

Disable All

36

nti
al

Hardware Break

ApplyBreakpointntialWindow Menu

Window

ConsoleStatusRegister
Bus trace
Code
Dump
InformationdeClose allnfi

By selecting Close All, all open windows will be closed. Other menu items will
open their corresponding windows. Individual windows cannot be closed from thewindow menu.
Console Window

The following window is used to enter console commands.

GA

Co

ConsoleSE

The four buttons at the top of the window have a one-to-one correspondence withthe console commands as shown below, and when a button is clicked, the respective
console command is entered.
GO button
G
STOP button
STOP
TRACE button
T
STEP button
S
Sound Programming Debugger User's Manual

37

nti
al

Further, if the command is not entered from the keyboard, i.e., by execution of abatch job or a macro, the file name or macro name is displayed as shown below.
ConsoledeConsoleThe bottom part of the window is the input area. This is normal edited text, so cut
and paste can be used freely. The result of execution of console commands is displayed in the area between the input area and the buttons at the top. A backlog ofresults can be viewed by using the scroll bar.
If the backlog becomes too full, the older information is lost.

Dump Windownfi•

The contents of memory are displayed in this window. There is a total of eight dump
windows.

Start Address

Dump

GA

Dump Size

Co

Word

The dump start address can be input by clicking on Dump Address.
The display size can be selected (in byte, word or long word) from the Dump Sizemenu.
Also, by clicking on the dumped number in the window, the memory can be edited.
The dump window is not updated during execution of a user program. Updatingis performed when the user program is stopped by a break, etc.

SE

•

38

Code Windownti
al

The contents of reverse assembly are displayed in this window. There are a total ofeight code windows.

Code

nfi

de

Code address

The dump window is not updated during execution of a user program. Updating is
performed when the user program is stopped by a break, etc.

SE

GA

•

Co

The reverse assembly start address can be input by clicking on Code Address.
Also, line assembly can be performed by clicking on the reverse assembly display inthe window.

Sound Programming Debugger User's Manual39Bus Trace Windowntial

Bus trace results are displayed in this window.

Bus Trace
Address

Data

Code

Co

nfi

de

Count

SE

GA

The bus cycles are distinguished as explained below when displaying on a color
display.
Black Bus cycle for the MC68EC000
Red Bus cycle in which the EXT signal is asserted
Green Bus cycle in which control is completely passed to the debugger
Blue Bus cycle from B-BUS

40

Register Window

nti
alDisplays the contents of the CPU registers.

Co

nfi

de

Register

The register values can be input or changed by clicking on the respective registervalues. Also, by clicking on the flag indicator of the SR register, the value of the SR
register can be changed in bit units as shown below.
Status Register

SE

GA

Interrupt vector level

Supervisor mode

Trace mode

Expansion carry flag
Negative flag
Overflow flag

Zero flag
Carry flag

CancelSound Programming Debugger User's Manual

Apply

41

Status Window

nti
alDisplays execution of the user program. The following display appears duringexecution of auser program.
StatusUser program is executingdeWhen the user program is stopped, the following display appears.

nfi

Status
Idle

SE

GA

Co

However, when a break is not applied without reaching the pass count with software breaks, an idle display or debugger program PC display may temporarily
appear even when the user program is normally being executed.

42

5.0

Use Restrictionsnti
alProblems with SCSI Interrupts

Communication between SSBug and the sound board is done via the SCSI (level 1
auto vector). Therefore, when the sound board is at interrupt level one for long
periods, the message (in the dialog box) “No response” is displayed.

deNo response from Saturn sound board.
Execute again?

Force quit

Cancelnfi

If the sound board should hang up at this time, the SCSI bus is taken over andstopped, thus hanging up the Macintosh as well. This happens when display of themessage (in the dialog box) “No response” is attempted, the resource cannot be readin because the SCSI bus has been taken over, thus resulting in a window being
displayed with nothing in it and hanging up the system.

Co

If this should happen, attempt execution again after releasing the SCSI bus by resetting the sound board or supplying a break from the main side.
Vectors Hooked by SSBug

The exception vectors (re-written at the time of execution of the user program) usedby SSBug are listed below.

SE

GA

reset
bus error
address error
illegal instruction
zero divide
chk instruction
trapv instruction
privilege violation
trace
un-initialized interrupt
spurious interrupt
level 1 auto vector
level 7 auto vector

The operation of programs that automatically rewrite the above vectors or reference
them during execution cannot be guaranteed under SSBug. Programs that hold thevector table static present no problem.

Sound Programming Debugger User's Manual43interrupt:ntial

In a condition in which control has shifted to the debugger and not the user program, the two interrupts level 2 auto vector and level 3 auto vector are replaced by
the following routine.
move.w #-1,SCSP_SCIRE
rte

Therefore, as long as the sound tool rules (use only level 2 and 3 SCSP interrupts) are
observed, interrupts will not be applied to the user program during debugger
standby.
Memory Hidden by SSBug

When an ICE, etc., is also used, seemingly conflicting conditions may be experienced.
User program code cannot be placed.
Even if memory is dumped from SSBug, an exception vector onto which the aforementioned SSBug hooks cannot be viewed.

nfi

•
•
•

de

Since SSBug hooks to the user vector, the first $80 bytes of memory is given special
treatment, and the memory $000000-$00007F as viewed from the debugger is not
actually the target $000000-$00007F. Therefore, the following restrictions apply to the$000000-$00007F memory area.

Critical Time Periods

Co

There are critical time periods in the operation of the current version of the debugger
when an emulator break, etc., of a hardware break, etc., and a CPU exception, including software breaks or trace executions, occur almost simultaneously. This iscurrently being addressed.
SCSI Noise

There are cases in which the SCSI signal of SSBug appears as noise in the analog
output of the sound board. If this should be a problem, open up a dialog box. SSBug
does not communicate with the sound board during dialog display.

GA

Carriage Returns

SE

The carriage return characters in text files used by SSBug can by either a CR
(Macintosh) or a CR+LF (MS-DOS) in all batch, symbol or hex files. However, theEOF character used in CP/M or MS-DOS is not supported.

44

Symbol Filesntial

The SDSS symbol format is defined as follows in SSBug.

[<WS>]<symbol value (hex)><WS><symbol name><WS>, an arbitrary number of
repeat + new character.
However, <WS>: an arbitrary number of white spaces, new line character: CR or
CR+LF.

Therefore, by selecting the SDSS format, the following symbol files can also be used.
Iwasaki Giken’s IR80 or other CP/M class symbol files
Computex company’s ID68000 symbol files

de

•
•

Restrictions with Respect to Saturn

SE

GA

Co

nfi

The TAS command cannot be used with the Saturn and development board
MC68EC000. Also, external devices cannot be reset with the RESET command.

Sound Programming Debugger User's Manual45