PG3
PG3
Preface
Sasm - Assembler
Slink - Linker
Sbug - Debugger
Sdisasm - Disassembler
Sload - Up/Downloader
I was hired as a member of the team to develop the software for the next
generation of controllers, known as the "PCD". PCB was not used because
that means "printed circuit board", and PCC means "pour copie conforme" in
French, so they settled on "PCD". This also stands for "Process Control
Device", but that wasn’t realized until some years later.
First, the hardware was developed around the enormous 16-bit Motorola 68000
microprocessor. This was one of the most advanced microprocessors available
at that time. It was big!
In the end, it was I who developed the entire software product, which was
known as the "PG3" (PG = Programmiergerät in German). The full name was
"SAIA PCD Programming Utilities".
The PG3 product was a great success. It remained in use for over 15 years.
Nearly 40 years later, much of the original PG3 "C" code still exists deep
inside the latest version of the programming tools (the PG5 "Controls
Suite").
Now, you can have many hours of fun reading my original specifications for
the PG3. It’s only just over 570 pages...
Matt Harvey
2023.06.24
*********************************************************************
* *
* SAIA PCD PROGRAMMING UTILITIES MENUS *
* FUNCTIONAL SPECIFICATIONS *
* FILENAME PCDMENU.DOC *
* AUTHOR Matt Harvey, SAIA AG, Murten *
* *
*********************************************************************
REVISION HISTORY
05-Jan-98 V2.1
1) On Connect menu, add function key F7=PCD shortcut for PCD
type selection.
14-Jan-97 $205
1) The Connect menu now allows S-BUS DATA MODE protocol to be
selected, for use with public line or radio modems.
21-Jun-96 V2.0
21-Feb-96 $19F
1) SWER 801: Resource table menu now creates FB parameter
cross-reference list file (.FBR).
2) SWMR 807: S-BUS can now be configured via an S-BUS link
from the "coNnect" menu when F4 is pressed (previosly, was
only via a PGU connection).
3) SWMR 602: File and directory names can be max. 8 characters.
File types can be max. 3 characters.
16-Oct-95 $198
1) "Connect" menu: P800 changed to PGU mode.
24-Apr-95 V1.9
1) The default file extension for the disassembler menu's
"File to disassemble" file name is now ".UPL" (was .PCD).
29-Mar-95 $18C
1) The "Link/Make" menu's "Check FB parameters" switch has
been changed to "Check Bloctec/Graftec", and SFBREF now
also verifies the Graftec step/transition structure.
13-Mar-95 $18B
1) Added "AUTO-ANSWER MODE" command to "Connect" menu, see
4.10.
2) Added error message ERROR 44: MISSING "AnswerOn" OR
"AnswerOff" STRING IN MODEM.INI.
06-Feb-95 $18A
1) Added password protection mechanism, see 4.10.3.
2) Added "read station number" feature, see 4.10.
05-Jul-94 $186
1) All file name entry fields can now accept a file name
up to 128 characters long. If the file name is longer
than the field, is can be scrolled using the left or
right arrow, home and end keys. If larger than the field,
< or > is shown at the start or end of the field to
indicate that is can be scrolled.
2) The "coNnect" screen now allows the S-BUS signalling mode
to be selected. The "Protocol" switch is now:
P800
S-BUS MODE 1 (PARITY)
S-BUS MODE 0 (BREAK)
3) The "coNnect" screen now processes some function keys for
short-cut configuration:
F3 = Configure S-BUS (runs SCONFIG)
F4 = Download S-BUS (runs SDNLD /S)
F5 = Configure serial ports (runs SCONFIG)
F6 = Select modem (runs SCONFIG)
4) The SCONNECT.EXE program, which is a DOS command line
replacement for the "coNnect" menu now has two extra switches
for selecting the S-BUS mode, the default is /S1:
/S1 = use "parity" signalling, mode S1
/S0 = use "break" signalling, mode S0
24-Sep-93 $175
1) Improved modem error messages:
ERROR 41: CAN'T CONNECT, MODEM RESPONSE: "...."
ERROR 42: CTS NOT RETURNED BY MODEM
ERROR 43: NO RESPONSE OR CARRIER FROM REMOTE MODEM
Also displays actual response strings received from
modem.
Removed errors 37 and 38.
2) Now accepts foreign characters in file names. Lower case
foreign letters are converted to standard ASCII upper case
characters. E.g. ä -> A.
09-Jun-93 V1.7
1) Whenever the cursor is in a filename entry field, pressing
function key F5 displays a pop-up directory window, from
which a filename can be chosen. See section 3.
2) Function key F1 now displays help.
3) Extended or expanded memory can now be used to provide up
to 100K bytes of extra memory for child programs (SEDIT,
SASM etc). See section 2.
4) New "coNnect" menu, with modem dialler and "phone book".
See section 4.10. Also SCONNECT program, see 4.10.2.
5) New documentation generator menu layout and new switches
"List LD values in binary" and "Use temporary file". See
section 4.7.
6) New disassembler menu switches for disassembly of the new
extension memory segment. See section 4.8.
7) New error messages 10..41. See section 5.1.
8) New sections "2.1 Logo screen", and "2.2 Use of directories",
and 3.1 to 3.4.
9) Prompt line texts changed.
10) If the assembler, linker etc. detects an error, the message
"WARNING: ERROR(S) OCCURRED" is displayed on the error
message line, accompaied by a beep. This notifies the user
that the operation failed, even if the error messages have
scrolled off the screen.
17-Jan-92 $155
1) Added "Remove blank lines" switch to Documentation Generator
menu, which also has a new layout.
09-Oct-91 $153
1) Disassembler menu start/end addresses now up to 6 digits
(0..262143) for new 1MB R600 memory module. Change "Start
address" to "Code start line", and "End address" to "Code
end line" for clarity.
2) New ERROR 10: INVALID ADDRESS.
30-Aug-91 $152
1) Add ERROR 9: OUT OF ENVIRONMENT SPACE.
2) Increase lengths of file names where possible.
3) Add "List Graftec parameters" and "List EQU/DEF statements"
switches to Documentation Generator menu.
4) Add "Assemble" option to Link menu - this allows "No files/
Changed files/All files" to be assembled before linking. It
provides a kind of "make" utility.
09-May-90 V1.4
1) Add macro switch to Assembler menu.
2) Add line numbers switch to Documentation menu.
3) "Texts & Data Blks" on resource table generator menu.
CONTENTS
════════
Page
1. OVERVIEW . . . . . . . . . . . . . . . 2
1.1 Package Diagram . . . . . . . . . . . . 3
4. MENUS . . . . . . . . . . . . . . . . 11
4.1 Main Menu . . . . . . . . . . . . . . 11
4.2 Editor Menu . . . . . . . . . . . . . 13
4.3 Assembler Menu . . . . . . . . . . . . 14
4.4 Linker Menu . . . . . . . . . . . . . 16
4.5 Graftec Menu . . . . . . . . . . . . . 18
4.6 Resource Table Generator Menu . . . . . . . 19
4.7 Documentation Generator Menu . . . . . . . 21
4.8 Disassembler Menu . . . . . . . . . . . 23
4.9 Ms-dos Command Menu . . . . . . . . . . 25
4.10 Connect Menu . . . . . . . . . . . . . 26
4.10.1 The Phonebook . . . . . . . . . . . . 29
4.10.2 SCONNECT Program . . . . . . . . . . . 30
4.10.3 Password protection . . . . . . . . . . 31
5. ERROR HANDLING . . . . . . . . . . . . . 32
5.1 Error Messages . . . . . . . . . . . . 32
MENUS - Page 2
1. OVERVIEW
════════════
Each utility has its own menu, which is either part of this front-
end menu program, or is an integral part of the utility itself.
The diagram on the next page illustrates this.
This document describes the main menu and sub-menus which are part
of the PCD.EXE menu program. Menus and screens controlled by
utilities invoked from the menus are described in their respective
functional specifications.
The menu package allows the user to work in any directory, for
example, a "project" directory, with his own configuration and
menu data.
MENUS - Page 3
Boxes drawn with '─' characters are part of this menu program.
Boxes drawn with '═' characters are stand-alone programs, which
contain their own integral menus, the names of these programs are
also shown, refer to the relevant functional specifications for
details of these programs and their menus.
v
│ ┌────────────┐ ╔════════════╗
│ dIsassemble │Disassembler│ ║Disassembler║
├───────────────>│ Menu ├──>║ SDISASM.EXE║
│ │ │ ║ ║
│ └────────────┘ ╚════════════╝
│ ╔════════════╗
│ Program eproms ║ Eprom Prog ║
├────────────────────────────────>║ SPROM.EXE ║
│ ║ ║
│ ╚════════════╝
│ ╔════════════╗
│ Transfer data ║ ║
├────────────────────────────────>║ SDAT.EXE ║
│ ║ ║
│ ╚════════════╝
│ ╔════════════╗
│ File handling ║ ║
├────────────────────────────────>║ SFILE.EXE ║
│ ║ ║
│ ╚════════════╝
│ ╔════════════╗
│ Word processor ║ User- ║
├────────────────────────────────>║ defined ║
│ ║ text editor║
│ ╚════════════╝
│ ┌────────────┐
│ Ms-dos command │ Ms-dos │
├───────────────>│ Command │
│ │ Handler │
│ └────────────┘
│ ┌────────────┐
│ coNnect │ Connect │
├───────────────>│ menu and │
│ │ dialler │
│ └────────────┘
│ ╔════════════╗
│ Configure ║ ║
├────────────────────────────────>║ SCONFIG.EXE║
│ ║ ║
│ ╚════════════╝
│ ┌────────────┐
│ Quit │ Quit │
└───────────────>│ Command │
│ Handler │
└────────────┘
MENUS - Page 5
The menu program is invoked from the DOS prompt with one of these
commands:
The /X switch is given, the menu program will page itself out of
main memory into extended or expanded memory before invoking a
child program. Once /X has been specified, it is remembered and
remains active every time the menus are used, until a /NX switch
is given to disable this feature. When paging to extended or
expanded memory, the text "USING EXTENDED/EXPANDED MEMORY" is
displayed on the error message line every time the menu program
is first executed.
The /X switch will not use additional memory unless the correct
memory management drivers have been loaded, usually by statements
in the CONFIG.SYS file. MS-DOS has HIMEM.SYS for extended memory,
and EMM386.EXE for expanded memory. Refer to your DOS user manual
for details. If there is no additional memory present, or the
memory manager has not been correctly loaded, the menu program
will page itself out to disk instead, which will be rather slow.
MENUS - Page 6
When the menu program is first executed, the SAIA logo and copyright
notice screen is displayed. Pressing any key clears the screen and
displays the top-level menu. If a key is pressed while the menu
program is being loaded, the logo is not displayed.
┌──────────────────────────────────────────────────────────────────────────────────┐
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ████████████████████████████████████████████████████ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ████████▀▀▀▀▀██▀▀ ▀████ ▀█████▀▀▀▀▀████████ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ████▀ █▌ ▐███ ████ ▀█████ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ██▀ ▄▄██ ▄▄ ███ ███ ████ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ██ ▄█████▌ ▐██▌ ▐██ ██▌ ▐██ ▐███ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ██▌ ▐█████ ████ ██ ██▌ ███▌ ███ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ███ ▐████ ▐████ ██ ██ ████ ███ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ████ ████ █████ ██ ██ ████ ███ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ █████ ▐███ █████ ██ ██ ████ ███ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ █████▌ ▐██ █████ ██ ██ █▀▀▀ ███ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ██████ ██ ▀███ ██ ██ ▐██ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ██████▌ ██ ██ ██ ▄▄██ ▐██ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀▀██ ▐█ ███▄▄ ██ ██ ████ ▐██ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ██ █████ ██ ██ ████ ▐██ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ██▄▄ ▄██ █████ ██ ██ ████ ▐██ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ██████▄▄▄████ █████ ██ ██ ▄████▄▄▄▄███ │
│ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ██████████████▄▄▄█████▄▄▄▄▄██▄▄▄▄███████████████████ ▄▄▄▄▄▄▄▄▄▄▄▄▄ │
│ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ │
│ ╔════════════════════════════════════════════════════════════════════════╗ │
│ ║ SAIA PCD PROGRAMMING UTILITIES PCD8.P3 V2.1 ║ │
│ ║ Copyright (C) SAIA-Burgess Electronics AG, 1987-1998 ║ │
│ ║ Written by Matt Harvey ║ │
│ ║ PRESS ANY KEY TO CONTINUE ║ │
│ ╚════════════════════════════════════════════════════════════════════════╝ │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘
The menu data file PCDMENU.DAT, which should reside in the current
directory, is then read. This file contains all the information
that appeared in the menus the last time they were used. When the
menu program is exited (see "Quit" command, Section 4.1), all the
data and selections currently in the menus are written to this file.
If PCDMENU.DAT is not found, all the menu entry fields will be blank
and default switches selected. If the PCDMENU.DAT file is from an
older version of the utilities, program PCDCONV.EXE is called, which
attempts to convert the file to the new format.
Once PCDMENU.DAT and PCDSETUP.DAT have been read, the main menu
prompt is displayed, and the first menu function "Edit" is selected.
MENUS - Page 7
If "PATH" and "SET PCD=" statements have been executed, usually from
the AUTOEXEXC.BAT file, the PCD Programming Utilities can be run
from any drive and directory.
The PCD Programming Utilities use several special data files (.DAT).
These files are always created in the current directory (except for
PCDCOLOR.DAT which is only in the PCD directory).
Other .DAT files may be used to store data for individual programs.
For example, SBUG.DAT stores the Debugger's "Refresh" window's
contents, so that it can be restored the next time Debug is run from
that directory.
1) Line 1 is the title line, indicating the menu name. On the main
menu title line, the menu program version number is shown.
2) Lines 2-22 contain the menu entry fields and their accompanying
descriptions. All entry fields are highlighted to separate them
from other text on the screen. Lines 2-4 of the top level menu
are used to display the Registered User name.
4) Lines 24 and 25 are the prompt lines. These lines describe what
information is required and which keys are valid. The prompts may
change when the cursor is moved to another field on the menu.
Three types of input fields are used. When the cursor is on a field,
the entire field is always displayed in reverse video, indicating it
is the selected field. Movement from one field to another is by the
arrow or tab keys.
1) Select field
2) Entry field
If the entry field is for a file name, only valid DOS filename
characters are accepted. DOS file names consist of an optional
drive (e.g. A:, B:), a directory path, an file name of up to 8
characters and an optional 3-character file type. File name
entry fields allow file names of up to 128 characters to be
entered. If the file name is longer than the entry field, which
is indicated by < or > characters at the start or end of the
field, then the field can be scrolled left or right using the
left or right arrow, HOME or END keys. If no path name is entered,
it is assumed the file is in the curent directory (shown on the
main menu). If a file name ends in ".", no default extension is
appended. If an invalid file name is entered, an error message is
displayed when ENTER is pressed. Pressing function key F5 when the
cursor is in a file name entry field will display the pop-up
direcory window, allowing a file name to be chosen.
3) Switch field
3.4 Help
─────────
F9, F10 F9 moves back to the previous help screen that was disp-
layed, F10 moves to the next help screen. A circular
buffer of the last 50 help screens is stored, F9 and F10
can be used to retrace the help path.
PgUp,PgDn Displays the help screens in the order in which they are
catalogued. Some help items have more than one screen,
indicated by --PgDn->, pressing PgDn displays the next
page, PgUp displays the previous page.
Home,End Moves the cursor to the first or the last highlighted help
item on the screen.
Help texts are stored in the file PCD.HLP, this file contains binary
index data and CANNOT be printed.
MENUS - Page 11
4. MENUS
═════════
From this screen all the sub-menus and programs can be selected.
The display shows the current disk and directory name, the date and
time, and the registered user's name.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD PROGRAMMING UTILITIES V2.1 MAIN MENU │
├────────────────────────────────────────────────────────────────────────────────│
│ ╓────────────────────────────────────────────────────────────────────────────┐ │
│ ║ SNORELOUDER BEDS LIMITED, SLEEPY STREET, SNOOZEVILLE │ │
│ ╚════════════════════════════════════════════════════════════════════════════╛ │
│ Directory: C:\PCD\PILLOWS 25/01/88 15:45 │
│ │
│ │
│ ┌──────┐ │
│ │ Edit │ Graftec File handling │
│ └──────┘ │
│ Assemble View program Word processor │
│ │
│ Link Resource tables Ms-dos command │
│ │
│ Debug dOcumentation coNnect │
│ │
│ Up/download dIsassemble Configure │
│ │
│ Program eproms Transfer data Quit │
│ │
│ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────│
│ ARROW, SPACE or TAB selects, ENTER or capital Command letter executes. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
This menu has a single entry field, the name of the file to be
edited:
┌────────────────────────────────────────────────────────────────────────────────┐
│ EDITOR MENU │
├────────────────────────────────────────────────────────────────────────────────│
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ ┌─────────────────────────────────────────────┐ │
│ Name of file to edit (.SRC) │ ___________________________________________ │ │
│ └─────────────────────────────────────────────┘ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────│
│ Enter file name (F5=directory), ENTER executes, ESC exits. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
The file name field accepts a drive and path name, with optional
extension ".ext", the default file extension is ".SRC".
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD MACRO ASSEMBLER MENU │
├────────────────────────────────────────────────────────────────────────────────│
│ ┌────────────────┐ │
│ File(s) to assemble (.SRC) │ ______________ │______________ ______________ │
│ └────────────────┘ │
│ ______________ ______________ ______________ │
│ │
│ ______________ ______________ ______________ │
│ │
│ │
│ │
│ Object file . . . . . (.OBJ) Yes Use temporary files . . . . No │
│ │
│ Listing . . . . . . . (.LST) No Abort assembly on 1st error No │
│ │
│ Cross-reference list . . . . No │
│ │
│ Expand macros in listing . . Yes │
│ │
│ Listing to printer . . . . . No │
│ │
│ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────│
│ Enter file name (F5=dir), ARROW or TAB moves cursor, ENTER executes, ESC exits.│
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
File(s) to assemble:
Listing switch:
If "Yes", any macros used are expanded into their full source
code in the listing. If "No", the code generated by the macros
is not listed.
After entering the file names and setting the switches, pressing
ENTER begins the assembly process. If the menu contains the name of
a non-existent file, or listing is to the printer which is not ready,
an error message is displayed, and the cursor is placed on the bad
field. The assembler is not invoked until everything is correct.
If there are no problems, the screen is cleared, and the assembler
SASM.EXE is invoked. SASM then outputs its messages to the screen.
When all the files have been assembled, the following prompt is
displayed, pressing any key returns to the main menu:
├────────────────────────────────────────────────────────────────────────────────│
│ OPERATION COMPLETE: Press any key to continue _ │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD LINK/MAKE MENU │
├────────────────────────────────────────────────────────────────────────────────│
│ ┌──────────┐ │
│ File(s) to link (.SRC/.OBJ) │__________│ __________ __________ __________ │
│ └──────────┘ │
│ ╓──── "MAKE" FEATURE ────┐ __________ __________ __________ __________ │
│ ║ All SRC files, or only │ │
│ ║ the changed files, can │ __________ __________ __________ __________ │
│ ║ now be assembled from │ │
│ ║ this menu by setting │ __________ __________ __________ __________ │
│ ║ the "Assemble" switch. │ │
│ ║ Enter all the SRC file │ __________ __________ __________ __________ │
│ ║ names on the right. │ │
│ ╚════════════════════════╛ __________ __________ __________ __________ │
│ │
│ │
│ Absolute object file (.PCD) ______________ Assemble Changed files │
│ │
│ │
│ Map . . . . . . . . . . (.MAP) Yes Sort map symbols by Symbol name │
│ │
│ Map to printer . . . . . . . No Check Bloctec/Graftec No │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────│
│ Enter file name (F5=dir), ARROW or TAB moves cursor, ENTER executes, ESC exits.│
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
File(s) to link:
Assemble switch:
The corresponding .SRC files from the "File(s) to link" list can
be assembled before linking if required. The switches from the
"Assemble" menu are used. The "Assemble" switch has three options:
Map switch:
This can be "Symbol name" or "Type and value". The MAP file
contains a list of global symbols. This list can be sorted either
by symbol name or by the symbol's type and value. NOTE: If any
foreign characters are used in symbol names, they may not be
sorted correctly because of their non-standard ASCII codes.
Check Bloctec/Graftec:
This menu has a single entry field, the name of the Graftec source
file to be edited:
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD GRAFTEC MENU │
├────────────────────────────────────────────────────────────────────────────────│
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ ┌──────────────────────────────────────────┐│
│ Name of Graftec source file (.SRC) │ ________________________________________ ││
│ └──────────────────────────────────────────┘│
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────│
│ Enter file name (F5=directory), ENTER executes, ESC exits. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
When ENTER is pressed, the screen is cleared and the Graftec editor
program SGRAF.EXE is invoked. Refer to the Graftec Functional
Specifications for details.
MENUS - Page 19
This is the name of the absolute object file from which the
resource table or FB parameter reference list will be generated.
It must be a valid absolute object file (.PCD or .UPL). The
default file extension is .PCD.
If "Yes", the resource table is created from the ".PCD" file and
all switches in the resource table box become active. If "No",
no resource table is created.
If "Yes", the resource controls (on the next 3 lines of the menu)
are ignored. This switch has the same effect as setting all the
resource controls to "Yes".
When data has been entered in the menu, pressing ENTER clears the
menu and invokes either the resource table generator "SRES.EXE",
and/or the FB parameter reference list generator "SFBREF.EXE". When
processing is complete, the "OPERATION COMPLETE: Press any key to
continue" prompt is displayed, pressing any key returns to the main
menu.
MENUS - Page 21
Enter here the name of the map file (produced by the linker)
which contains the list of files linked, start addresses, global
symbols etc. File extension ".MAP" is automatically used.
Source file(s):
Enter here the names of the source files for which documentation
modules are to be generated. File extension ".SRC" is automatic-
ally used. These files must be files whose object files were
linked to produce the .MAP file entered above. If not, a fatal
error occurs.
If the source files were created using SEDIT, two comments may
be available for each program line. This switch selects which
comments appear in the documentation:
When "Yes", blank lines in the .SRC file are listed as normal.
This may spoil the documentation format, because EQU, DEF and
DOC statements may be being removed, and all $INCLUDEs, macros
and false conditional statements are removed, but the blank
lines which were used as spacing between these statements will
not be removed. This produces blank areas in the documentation.
To solve this problem, set the "List blank lines" switch to "No".
However, this also removes blank lines which may be needed, so
instead of using blank lines for spacing, use empty comment lines
which are not removed. For example:
; <──┬─ empty comment lines for spacing
; This is a comment │
; <──┘
When "Yes", the source file line numbers are included in the
documentation files.
If "Yes" the incoming and outgoing parameter lists for step (ST)
and transition (TR) instructions are listed. If "No", these
parameter lists are removed.
When data has been entered in the menu, pressing ENTER clears the
menu and invokes the documentation generator "SDOC.EXE". Once
the documentation is complete, the "OPERATION COMPLETE: Press any key
to continue" prompt is displayed, pressing any key returns to the
main menu.
MENUS - Page 23
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD DISASSEMBLER MENU │
├────────────────────────────────────────────────────────────────────────────────│
│ │
│ ┌───────────────────────────────────────┐ │
│ File to disassemble (.UPL or .PCD) │ _____________________________________ │ │
│ └───────────────────────────────────────┘ │
│ │
│ Listing or source format output . . Listing │
│ │
│ Output to printer . . . . . . . . . No │
│ │
│ Output file name . . (.DLS or .DSR) _____________________________________ │
│ │
│ │
│ Disassemble code/text/extension mem. Entire file │
│ │
│ Code start line . . . . . . . (0) 0_____ │
│ │
│ Code end line . . . . . . (999999) 999999 │
│ │
│ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────│
│ Enter file name (F5=dir), ARROW or TAB moves cursor, ENTER executes, ESC exits.│
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
This must be the name of a file uploaded from the PCD (.UPL) or
created by the linker (.PCD). If no extension is entered, the
default is ".UPL".
Output to printer:
When data has been entered in the menu, pressing ENTER clears the
menu and invokes the disassembler "SDISASM.EXE". Once disassembly is
complete, the "OPERATION COMPLETE: Press any key to continue" prompt
is displayed, pressing any key returns to the main menu.
MENUS - Page 25
From this menu, any program can be executed without exiting the PCD
menus.
The menu shows the DOS version number and the DOS prompt. The prompt
is shown with two ">>" characters to distinguish it from the actual
DOS prompt.
The up and down arrow keys can be used to recall any commands that
were previously entered, so that they can be edited or re-executed.
The last 10 commands are buffered. The very last command entered is
saved in the PCDMENU.DAT file on exit of the menus, and is available
next time the menus are run by pressing the up or down arrow key.
This menu has three commands. The CONNECT command attempts to connect
to the PCD and displays an error message if it fails. The HANG UP and
AUTO-ANSWER MODE commands are for use with public-line (dial-up)
modems, and are only available if S-BUS MODEM mode is selected. The
modem type is defined from the "Configure/Modem for PC" menu. Each
command is described in detail delow.
The menu selects the communications mode which will be used when
communicating with a PCD:
F3 = Configure S-BUS
F4 = Download S-BUS (runs SDNLD /S)
F5 = Configure serial ports
F6 = Select modem
F7 = Select PCD type
If using the utilities from the DOS prompt, the SCONNECT program
can be used to select a communications mode, CPU, S-BUS station,
COM port and baud rate. See section 4.10.2.
CONNECT
If using S-BUS, and the entered station number does not respond, a
"read station number" telegram is broadcast. If only one station
exists, it will be connected and the correct station number will be
displayed. This is useful if the station number is unknown. If more
than one station replies, an "INVALID RESPONSE" error occurs, and
the correct station number must be entered.
HANG UP
AUTO-ANSWER MODE
To disconnect the remote modem and hang up, either put the modem
back into auto-answer mode again, or execute a HANG UP command.
With the cursor on the "Number to dial" field of the "coNnect" menu,
pressing function key F2 displays the phonebook window. This is a
list of up to 300 telephone and S-BUS station numbers, read from the
user-editable PHONES.DAT file. A number is chosen from this list by
selecting it with the cursor keys, then pressing ENTER. ESCape aborts
the selection.
Phonebook File:
010-41-37-123456 12 Station 12
0,71422 0 Internal number, ','=2 second delay
MENUS - Page 30
If running on-line programs such as SDNLD and SUPLD from the DOS
prompt or from a batch file, program SCONNECT.EXE can be used to
select a communications mode, S-BUS station and a CPU. It replaces
the "coNnect" menu, but does not provide dial-up MODEM support.
The default serial ports, baud rates and S-BUS timing are defined
from the "Configure/Serial ports for PC" menu (read from file
PCDSETUP.DAT).
Usage:
Where:
PCDs with the latest firmware (PCD2 V003, PCD4 V005, PCD4.M4 V001,
PCD6.M5 V004, PCD6 V007) now have a password protection mechanism.
╔══════════════════════════════════════════════════╗
║ ONLINE PASSWORD PROTECTION IS ACTIVE ║
║ ║
║ Enter password: _________________________ ║
║ ║
║ Press ENTER to continue, ESC for reduced access. ║
╚══════════════════════════════════════════════════╝
5. ERROR HANDLING
══════════════════
(If these programs are run directly from DOS, DOS error handling is
not disabled, and the "Abort, Retry or Ignore ?" prompt IS used to
handle errors (allows the use of these programs in a batch file).)
The program which has just been executed from the menu
detected some errors, for example the assembler detected
syntax errors. This notifies the user the operation failed,
even if the error messages have scrolled off the screen.
The file does not exist in the current directory (if reading),
or the file cannot be created because the drive is not ready,
or the disk or directory is full (if writing).
The PCD2 and PCD6.M5 have one CPU (0), the PCD4 can have two
CPUs (0, 1), and the PCD6 can have up to 7 CPUs (0..6).
Occurs when PGU mode is selected, and the PCD is not returning
the CTS (RDYOUT) signal.
Power off the PCD and re-connect the PCD8.P8. Ensure that the
connectors are clean and free from dirt or grease.
A "HANGUP" command will not work unless the modem has been
initialized by a "CONNECT VIA MODEM" command.
The dialled number has been answered, but the remote modem
is not responding. Is the dialled number correct?
AnswerOn="ATS0=1\r"
AnswerOff="ATS0=0\r"
ERROR 45: CONNECT A PCD WITH THE "CONNECT" COMMAND BEFORE CONFIGURING
S-BUS
A PCD must be connected in order to use the F4=Download S-BUS
command from the @coNnect@ menu.
REVISION HISTORY
05-Jan-98 V2.1
21-Jun-96 V2.0
26-Jun-95 $191
1) Max. no. of symbols increased to 5000 (was 4000).
24-Apr-95 V1.9
06-Feb-95 $18A
1) Scollable file name entry fields now allow entry of file
names up to 128 characters in length. (641)
2) Illegal operands (e.g. STH F Tom+Dick+10) are now
highlighted as invalid lines. If this occurs in an EQU
statement, then the EQU is ignored and the symbol is added
to the resource table without a type and value. (631)
18-Jul-94 $186d
1) A warning message is now issued to prevent resources being
deleted when editing an ST or TR from SGRAF. It is possible
to delete resources which are not referenced by code in the
module being edited, but used resources cannot be deleted.
It is therefore possible to delete resources which are not
used in the ST or TR being edited, but ARE used by other STs
or TRs in the module. A warning message is now displayed to
notify the user of this potential problem:
WARNING 90: RESOURCE(S) MAY BE USED IN OTHER STEPS/TRANSITIONS
08-Jun-94 $185d
1) Now handles new TFRI/STXMI/SRXMI instructions, which use
register indirect addressing. See section 15.
2) TFR now transfers data blocks.
3) New section 15: Entering non-standard instructions.
18-Apr-94 $182
1) SWMR 622: Add $IFINC and $IFNINC support. Also, if type/
value is multi-defined only add it to the symbol table
once.
11-Oct-93 V1.8
1) SWMR 560: Now creates backup files. Old files are renamed
to "filename.BAK".
27-Sep-93 $175
1) Add special handling for pre-defined symbols, see section
4.9. New error message: ERROR 89: PRE-DEFINED SYMBOL, SASM
ASSIGNS A VALUE.
09-Jun-93 V1.7
1) New CPBI and TFR instructions.
2) Can now be called from the Graftec editor, to edit the code
inside a STep or TRansition.
3) Public labels can now be defined by preceding the label in
the LABEL column with a "%" character.
For example: %LABEL STH I 0
Generates: PUBL LABEL
LABEL EQU $
STH I 0
4) The sort order of constants in the resource table has been
changed so that they now appear after the K constants when
the resource table is sorted by type and value.
5) Function key F5 now displays the pop-up directory window
when the cursor is on a filename entry field.
6) Now supports extension memory texts and DBs 4000..7999.
7) Will use extended or expanded memory in the IBM PC if
the PCD Programming Utilities menus were invoked with
the /X switch.
8) The standard ANSI mnemonics for special characters can now
be entered into texts, enclosed in angle brackets. SASM
converts these to their binary characters. E.g. "<CR><LF>" =
"<13><10>", "<BEL>" = "<7>".
31-Jan-91 $155
1) Can now insert and delete FB parameter definitions, and
all FB parameter references in the program are renumbered.
2) Sequential Blocks (SB) can be defined in the resource table,
and called from the program (CSB), but cannot be defined.
These must be defined using the Graftec editor SGRAF.
3) SB, ST and TR numbers *can* be changed now, and if not
referenced, they can be deleted from the resource table.
The "Block Renumber" command can also be used.
4) New ERROR 76: MORE THAN 255 FB PARAMETERS (old error removed).
5) Added "Locate neXt" command (same as F6).
6) FB parameters cannot have the same symbol name as any
other resource.
7) Now detects attempts to delete a marked block containing
FB parameter definitions and gives ERROR 77 unless all
references to these parameters are included in the marked
block, and will also be deleted.
8) "Block Renumber" now works for all data types except constants.
9) Changed error message ERROR 51: MUST MARK ENTIRE INSTRUCTION
10) Changed error message ERROR 55: CAN'T RENUMBER THIS TYPE
11) Added check for APPEND /X, which prevents the "File Assemble"
command from working with DOS version 3.3. New error message:
ERROR 84: CAN'T EXECUTE SASM: "APPEND /X" LOADED
06-Dec-91 $154
1) "File Os command" changed to "File dOs command".
22-Aug-91 $152
1) Changed texts for ERROR 27 and 62.
2) "Locate Operand" changed to "Locate Type/value".
3) Graftec structure instructions cannot be edited. Only ST
and TR names can be changed (not numbers), and comments
can be edited.
4) ESC is either "undo" if data has been entered in a field,
or "Quit" if no data has been entered.
03-Dec-90 Version 1.4
1) Pop-up directory window can now be used to choose a filename
if a filename containing wildcard characters or an empty
filename is entered.
1. INTRODUCTION . . . . . . . . . . . . . . . . . . 1
1.1 Invocation . . . . . . . . . . . . . . . . . . 2
2. EDIT SCREEN . . . . . . . . . . . . . . . . . . . 3
2.1 Title line . . . . . . . . . . . . . . . . . . 3
2.2 Prompt line . . . . . . . . . . . . . . . . . 3
2.3 Command line . . . . . . . . . . . . . . . . . 4
2.4 Status line . . . . . . . . . . . . . . . . . 4
2.5 Error message line . . . . . . . . . . . . . . 4
2.6 Entry fields . . . . . . . . . . . . . . . . . 4
2.7 Label field . . . . . . . . . . . . . . . . . 5
2.8 Mnemonic field . . . . . . . . . . . . . . . . 6
2.9 Operand field . . . . . . . . . . . . . . . . 6
2.10 Symbol field . . . . . . . . . . . . . . . . . 6
2.11 Comment field . . . . . . . . . . . . . . . . 7
4. RESOURCE SCREEN . . . . . . . . . . . . . . . . . 12
4.1 Title line . . . . . . . . . . . . . . . . . . 13
4.2 Prompt line . . . . . . . . . . . . . . . . . 13
4.3 Command line . . . . . . . . . . . . . . . . . 13
4.4 Status line . . . . . . . . . . . . . . . . . 13
4.5 Symbol name field . . . . . . . . . . . . . . 13
4.6 Type and value field . . . . . . . . . . . . . 13
4.6.1 Resource data types . . . . . . . . . . . . . 14
4.7 Include/Scope "IS" column . . . . . . . . . . 14
4.8 Automatic comment field . . . . . . . . . . . 14
4.9 Pre-defined symbols . . . . . . . . . . . . . 14
6. THE KEYBOARD . . . . . . . . . . . . . . . . . . . 19
7. HELP . . . . . . . . . . . . . . . . . . . . . . . 21
7.1 F1 Help . . . . . . . . . . . . . . . . . . . 21
7.2 F3 Instruction info . . . . . . . . . . . . . 21
Table of contents continued
──────────────────────────-
12. ERRORS . . . . . . . . . . . . . . . . . . . . . . 32
12.1 Source file errors . . . . . . . . . . . . . . 32
12.2 Edit errors . . . . . . . . . . . . . . . . . 32
12.3 Assembler errors . . . . . . . . . . . . . . . 32
12.4 Fatal errors . . . . . . . . . . . . . . . . . 33
12.5 Error messages . . . . . . . . . . . . . . . . 34
SEDIT has two screens, the "edit screen" and the "resource screen".
The edit screen is where the program code is entered. The resource
screen is where the resource list (symbol names, data type, values
and automatic comments) can be edited.
Program code can be entered either using symbol names such as "Fred"
or using absolute values "I 0". Symbol names and absolute values are
entered into the resource table if not already there, so that symbol
names, data types and automatic comments can be assigned to them
later from the resource screen.
1.1 Invocation
───────────────
SEDIT can be run from the PCD Programming Utilities main menu
with the "Edit" command, or can be invoked directly from DOS.
SEDIT filename[.ext]
If a file name is given and the file exists, the file is loaded
by SEDIT. If the file doesn't exist, the "NEW FILE" warning is
displayed on the error message line.
2. EDIT SCREEN
═══════════════
The edit window is a scrollable window with five entry fields on each
line. A large reverse-video cursor can be moved to select a field
using the arrow or tab keys etc. If the selected field can be edited,
the small flashing cursor appears inside the field, and new data can
be entered if required. The prompt line is updated according to the
cursor field.
┌───── File modified indicator
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD CODE EDITOR V2.1 MODULE: TEST.SRC * │ <──── Title line
├────────────────────────────────────────────────────────────────────────────────┤
│┌─────┬────────┬─────────────┬────────────┬────────────────────────────────────┐│
││LABEL│MNEMONIC│ OPERAND │ SYMBOL │ AUTOMATIC COMMENT ││ <───── Header
│È═════¤════════¤═════════════¤════════════¤════════════════════════════════════¥│
│ ════ Start of module ════ │ ─┐ <── Start indicator
│ ; Full 80-column comment lines can be entered by typing a ';' character in │ │
│ ; the first column of the LABEL field. User comments can also be entered in │ │
│ ; the comment field after an instruction line. │ │
│ PB 0 GetBit │ │
│ ADD R 1 SrcReg Source register │ │
│ R 2 TagReg Tag register │ │ Scrollable
│ R 100 Scratch register │ ├──── Edit window
│ INC C 0 BitCount Counts bits produced │ │
│ CMP R 0 OldValue Holds old number of bits │ │
│ C 0 BitCount Counts bits produced │ │
│ JR E OK │ │
│ OUT O 0 AlarmLamp Turn on alarm lamp │ │
│ JR END │ │
│ OK LD R 0 OldValue Holds old number of bits │ │
│ C 0 BitCount Counts bits produced │ │
│ ════ End of module ════ │ ─┘ <── End indicator
│ │
│ ERROR: INVALID OPERAND │ <───── Error message line
├────────────────────────────────────────────────────────────────────────────────┤
│ OPERAND: I 0-8191, O 0-8191, F 0-8191, T 0-450, C 0-1599 │ <───── Prompt and command
├────────────────────────────────────────────────────────────────────────────────┤ line
│ Line: 5 Free Memory: 406981 Symbols: 9 Errors: 0 F1=Help F3=Info │ <───── Status line
└────────────────────────────────────────────────────────────────────────────────┘
While a file is being loaded or saved, the prompt line shows the name
of the file and the line number being processed.
SEDIT - Page 4
"Errors" shows the number of source file errors (detected when the
source file was read in, see section 12.1), or the number of errors
found when the file was assembled (see section 12.3). Errors can be
located with the F11 (SHIFT+F1) and F12 (SHIFT+F2) keys, or the
"Locate Error" command, and corrected before saving the file.
Full editing facilities are provided for every entry field. The "Ins"
key toggles between insert and overtype mode (a block cursor means
insert mode, an underline cursor means overtype mode). "Del" deletes
the character under the cursor, backspace "<-" deletes the character
to the left of the cursor. The left arrow and right arrow keys move
the cursor within the field. Home and End move the cursor to the start
or end of the field. "Esc" is "undo" if a field has been edited (the
original data is restored), or "Quit" if the field has not been
edited.
a) Jump labels
Labels can contain characters A..Z, a..z, digits 0-9, the '_'
underline character or the foreign characters Ä, á etc. Labels
cannot begin with a digit and, for SEDIT, must be between 2 and 6
characters long. Mnemonics and assembler reserved words cannot be
used as labels, and labels must not have the same name as a symbol.
Labels are not case sensitive (unless foreign characters are used),
the SHIFT key can be used to enter lower case letters.
The ':' terminator (required by the Assembler) is not needed by
SEDIT, this is appended by SEDIT when the file is saved.
Labels are local to the block (COB, PB, FB etc) where they are
defined. The same label can be used many times in a single module,
providing it is not used twice within the same block. It is illegal
to jump to a label in another block. These errors are detected only
when the file is assembled.
b) Comment lines
To turn a line into a comment line, type ';' in the first column.
c) Assembler directives
--> If the first character is not ';' or '$', SEDIT will assume that
it's a jump label.
d) Texts
e) Data Blocks
For block call instructions (CFB, CPB etc), the condition code and
optional block number must be entered in this field.
For the jump instructions (JR and JPD) the condition codes and labels
are both entered in this field, for example "JR Z FRED". Absolute
values can also be used for jumps, for example "JR H -1", but it is
safer to use labels. Also put the label in this field to load a
register with the value of a label, e.g. LD R 0, LABEL.
Commands are executed by pressing the ALT or the CTRL key, then the
capital command letter of the desired command. Some commands can
also be executed using the function keys, see section 6.
3.1 Resources
──────────────
Switches to the resource screen.
3.2 Insert
───────────
Inserts a line at the current cursor position. Note that lines
cannot be inserted between the operands of a multi-line instruction.
This command can also insert new FB parameters in an FB parameter
definition list, see section 8.1.
3.3 Delete
───────────
Deletes the current cursor line. To delete an entire instruction,
the cursor must be on the first line of the instruction which
contains the mnemonic. It is not possible to delete a single line
of a multi-line instruction. When an instruction is deleted, all the
operand lines associated with the instruction are also deleted.
Thsi command can also delete unreferenced FB parameters in an FB
3.4 Block
──────────
A block of lines can be marked for deleting, moving, copying, print-
ing or saving in an intermediate file. A second command letter must
be typed to select the mark operation, a second command line is
displayed:
├────────────────────────────────────────────────────────────────────────────────┤
│ BLOCK: Mark Delete moVe Copy Unmark Print Save <ESC> │
└────────────────────────────────────────────────────────────────────────────────┘
Block Mark: The line containing the cursor is marked as the start
or end of the marked block. The marked line cannot be
within a multi-line instruction. The marked block is
displayed in reverse video.
Block moVe: Moves the marked block to the present cursor line.
The block is automatically unmarked after the move.
The marked block at the original position is deleted.
Block Copy: Copies the marked block to the current cursor line.
The original block is not deleted and remains marked.
SEDIT - Page 9
3.5 Locate
───────────
Moves the cursor to a specified label, mnemonic, operand, symbol,
or to the next error. The search commences from the line AFTER the
present cursor line (except for "Locate line Number"), to the end
of the file. To search from the start of the program, first move
the cursor to the first line using CTRL+HOME. If the item is found,
the cursor is moved onto the item. If not found, an error message
is displayed.
Once a valid "Locate" command has been executed, the F6 function key
can be used to locate the next occurrence of the item. Remember that
the search begins at the line AFTER the present cursor line. To use
F6 to search for the first item again, first press CTRL+HOME to move
to the start of the file.
├────────────────────────────────────────────────────────────────────────────────┤
│ LOCATE: Label Mnemonic Symbol Type/value Error line Number neXt <ESC> │
└────────────────────────────────────────────────────────────────────────────────┘
Locate Error: If there are any errors logged, this command moves
the cursor to the next highlighted error, and the
associated error message is displayed. The F11
(SHIFT+F1) and F12 (SHIFT+F2) function keys can also
be used to locate the previous/next errors.
Locate line Number: Moves the cursor to the specified line number,
if it exists.
3.6 Comments
─────────────
Switches the comments column from the display of automatic comments
the display of user comments, and back again.
3.7 Print
──────────
Prints the entire module on the printer. Either the automatic or the
user comments are printed, depending on which is displayed when the
print is started. The user is prompted to ready the printer, then
press Enter to start the print. Escape can be used to abort the print
at any time.
3.8 File
─────────
This command can assemble the file, load or save code to a file,
load Function Block parameter definitions, display the contents of
any directory on any disk, or execute any DOS command.
When saving files, if a file exists with the same name (the original
file) it is renamed to "filename.BAK", so it can be restored in case
of error.
├────────────────────────────────────────────────────────────────────────────────┤
│ FILE: Assemble Load code Save code Fbs Directory dOs command <ESC> │
└────────────────────────────────────────────────────────────────────────────────┘
SEDIT - Page 11
File Load code: Loads the code and symbols from the specified file
(.SRC) and inserts the code at the current cursor
line. Any resources defined in the file are added to
the resource list. If a symbol name is already defined,
it takes the new type, value and automatic comment of
the symbol read from the file. The name of the file
must be entered first, or press F5 to select a file
from the directory window.
File Save code: Saves all the code and symbols in the specified file
(.SRC). The name of the file must be entered first,
or press F5 to select the file from the directory
window. If the file already exists, a prompt "Over-
write (Y or N)?" is displayed.
3.9 Quit
─────────
Exits to DOS or to the PCD Programming Utilities main menu. If the
file being edited has not been saved, the user is asked if he wants
to save the file.
4. RESOURCE SCREEN
═══════════════════
This screen is entered from the edit menu by the "Resources" command
or by pressing function key F7.
If the program has been written using only absolute values, then
symbol names can be assigned to each absolute value from this screen.
Each resource can also be assigned an automatic comment from this
screen, which is displayed in the automatic comment field of the Edit
screen.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD CODE EDITOR V2.1 MODULE: TEST.SRC │ <──── Title line
├────────────────────────────────────────────────────────────────────────────────┤
│┌─────────────┬────────────────────┬──┬────────────────────────────────────────┐│
││ SYMBOL NAME │ TYPE AND VALUE │IS│ AUTOMATIC COMMENT ││ <───── Header
│È═════════════¤════════════════════¤══¤════════════════════════════════════════¥│
│┌──────────────────────────────────────────────────────────────────────────────┐│
││ Switch I 0 I Red start button ││ ─┐
││ EndStop I 1 I End of motor travel ││ │
││ MotorOn O 32 Turns on the motor ││ │
││ MotorOff O 33 Turns off the motor ││ │
││ Fault O 34 Turns on the red fault lamp ││ │
││ EndTimer T 0 G Times movement to EndStop ││ │ Scrollable
││ ItemCount C 100 G Counts number of items moved ││ ├──── Resource
││ Main COB 0 Main motor control ││ │ Window
││ Control0 PB 0 Controls Motor 0 ││ │
││ ExtBase X This is defined externally ││ │
││ ││ │
││ ││ │
││ ││ │
││ ││ │
││ ││ ─┘
│È══════════════════════════════════════════════════════════════════════════════¥│
│ │ <───── Error message line
├────────────────────────────────────────────────────────────────────────────────┤
│ RESOURCE LIST: Edit or enter the symbol name. │ <───── Prompt and command
├────────────────────────────────────────────────────────────────────────────────┤ line
│ Line: 12 Free Memory: 406981 Symbols: 9 Errors: 0 F1=Help F3=Info │ <───── Status line
└────────────────────────────────────────────────────────────────────────────────┘
SEDIT - Page 13
5.1 Editor
───────────
Returns to the edit screen.
5.2 Sort
─────────
The resource list is sorted either by symbol name, or by type and
value. The "Sort" command changes the sort order and re-sorts the
list. The sort order is indicated by either "SYMBOL NAME" or "TYPE
AND VALUE" displayed in bold video on the header line.
When sorted by symbol name, all resources without symbolic names are
moved to the front of the list. When sorted by type and value, all
resources without type and value are moved to the front of the list.
This makes it easier to edit the undefined resources.
New symbols or types and values can be entered anywhere in the list,
and the list can be re-sorted later using the "Sort" command.
5.3 Insert
───────────
Inserts an empty line into the resource list at the cursor position.
5.4 Delete
──────────-
Deletes the line at the cursor position. If the line contains a
symbol name or type and value which is used by the program, the
resource cannot be deleted. To delete used resources, first remove
all references to them from the edit screen. If a resource is defined
in an include file (marked with 'I'), it cannot be deleted, this can
only be done by editing the include file itself.
5.5 Next
─────────
Inserts the next element into the resource list. For example, if the
cursor is on "I 32", the "Next" command will insert a line containing
"I 33", and move the cursor onto the new line. If executed again it
inserts "I 34" and so on. Each element can then be given a symbol
name and an automatic comment. This saves typing when defining all
the inputs or outputs for a card etc.
This works for all data types, except floating point constants, and
Steps and Transitions which can only be created using the Graftec
editor SGRAF.
5.6 Block
──────────
A block of resources can be marked for deleting, renumbering, printing
or saving in an intermediate resource file. A second command letter
must be typed to select the block operation, a second command line is
displayed:
├────────────────────────────────────────────────────────────────────────────────┤
│ BLOCK: Mark Delete Unmark Renumber Global eXternal Print Save <ESC> │
└────────────────────────────────────────────────────────────────────────────────┘
Block Mark: The line containing the cursor becomes the start or
end of the marked block. The marked block is displayed
in reverse video. A single line can be marked if
required.
Block Delete: Deletes all the unused resources in the marked block.
Used resources are not deleted. If any resources are
not deleted, a warning message is displayed.
5.7 Locate
───────────
Moves the cursor to a specified symbol or type and value. It the
resource is found, the cursor is moved onto the resource. If not
found, an error message is displayed.
├────────────────────────────────────────────────────────────────────────────────┤
│ LOCATE: Symbol name Type and value <ESC> │
└────────────────────────────────────────────────────────────────────────────────┘
5.8 Global
───────────
Any resource which has been defined with a symbol name and a type
and value can be flagged as global (PUBLic) with this command. When
a symbol is global, a 'G' is displayed in the scope column. The
"Global" command toggles the resource's scope between global and
local.
5.9 External
─────────────
This command makes the resource which the cursor is on into a
resource which is defined externally. External resources are marked
with an 'X' in the scope column. The resource must be declared
global in another module using the "Global" command. When the
modules are assembled and linked together, external resources are
matched with their global counterparts. The "eXternal" command
toggles the reseource's scope between local and external. External
resources cannot have a type and value, only a symbol name and an
automatic comment. (External symbols which are PB, FB and SB types,
referenced by CPB, CFB and CSB instructions *ARE* given a type,
but no value.)
5.10 Print
───────────
Prints the resource list as it is currently sorted. Ensure the
printer is ready, then press Enter to start the print. Escape can
be used to abort the print at any time.
5.11 File
──────────
Can load or save resources to or from a file, display the contents
of any directory on any disk, or execute any DOS command.
When saving files, if a file exists with the same name (the original
file) it is renamed to "filename.BAK", so it can be restored in case
of error.
├────────────────────────────────────────────────────────────────────────────────┤
│ FILE: Load resources Save resources Directory dOs command <ESC> │
└────────────────────────────────────────────────────────────────────────────────┘
5.12 Quit
──────────
See section 3.9.
SEDIT - Page 19
6. THE KEYBOARD
════════════════
Editing keys:
Other keys:
╔═════╤═════╗
Help ║ F1 │ F2 ║ Save and exit │ The "File Save code"
╟─────┼─────╢ │ command also saves
Instruction Info ║ F3 │ F4 ║ Save, don't exit │ the file.
╟─────┼─────╢
File Directory ║ F5 │ F6 ║ Locate Next, repeats a Locate command
╟─────┼─────╢ (Edit screen only)
Editor/Resources ║ F7 │ F8 ║ Comment/Sort
╟─────┼─────╢
Left Field ║ F9 │ F10 ║ Right Field
╚═════╧═════╝
F2 Save and exit Saves the code in the work file and exits to
DOS or the PCD Utilities menu. If the file
exists, it is overwritten. If no file name
has been supplied (editing a new file), the
user is prompted to enter a file name.
F4 Save, don't exit Saves the code in the work file, but does not
exit. Editing can continue. If the file exists
it is overwritten. If no file name has been
supplied (editing a new file), the user is
prompted to enter a file name.
7. HELP
════════
7.1 F1 Help
────────────
SEDIT is supplied with a HyperHelp system. F1 displays the main help
index. A topic can be selected by moving the cursor onto a high-
lighted item, then pressing Enter. Help texts are stored in the file
SEDIT.HLP, this file contains some binary data and CANNOT be printed.
F9, F10 F9 moves back to the previous help screen that was disp-
layed, F10 moves to the next help screen. A circular
buffer of the last 50 help screens is stored, F9 and F10
can be used to retrace the help path.
PgUp,PgDn Displays the help screens in the order in which they are
catalogued. Some help items have more than one screen,
indicated by --More-->, pressing PgDn displays the next
page, PgUp displays the previous page.
Home,End Moves the cursor to the first or the last highlighted help
item on the screen.
The parameter type is used for checking parameters when they are
entered after the CFB call. It is also used to check that the param-
eter is used correctly within the FB. For example, the instruction
"STH =1" generates an error if parameter 1 is defined as a register.
If parameter 1 is a register, and "I 0" were entered as parameter
1 of a CFB instruction, an error is also generated.
When the cursor is moved into the operand field of a parameter, the
prompt line shows a description of the parameter to be entered. The
parameter number, its name, the type, valid values and the automatic
comment (all as entered when the parameter was defined) are shown:
├────────────────────────────────────────────────────────────────────────────────┤
│ FB PARAMETER 1: Fred I 0-8191 Automatic comment for Fred │
└────────────────────────────────────────────────────────────────────────────────┘
| | | | |
| | | | +---- Automatic comment
| | | +------------------- Value range (added by SEDIT)
| | +----------------------- Parameter type
| +-------------------------------- Parameter name
+------------------------------------- Parameter number
a) Comment lines
─────────────────
These use a complete line (up to 80 characters). To enter a line
comment, move the cursor into the label field (far left), and type
a colon ';' character in the first position to define the line as
a comment line. Type the comment on the rest of the line.
b) User comments
─────────────────
These comments are entered in the comment field on the right. They
can be entered only if user comments have been selected for display
in this field with the "Comments" command or with function key F8.
User comments should be used to describe what the program is actually
doing.
c) Automatic comments
----------------------
These are automatically displayed in the comment field on the right
if automatic comments have been selected for display using the
"Comments" command or F8. Automatic comments can be used to describe
the resource (what it is, its location, wiring information etc).
SEDIT - Page 26
NOTE: SEDIT was not designed for ease of enetring Texts and Data
Blocks. For applications with a large number of Texts or DBs it will
be easier to edit these in a separate source module using a standard
ASCII editor, and "$include" this module, or assemble and link it.
In SEDIT, Texts and Data Blocks are entered as comment lines, with a
';' in the first position of the label field. The ';' character is
removed by SEDIT when the line is saved to the source file. When a
source file is read, any Text or Data Block lines are turned back into
comments so that SEDIT can handle them. Entering these as comments
allows SEDIT's full line editing facilities to be used.
10.1 Texts
───────────
A Text is defined on a comment line as follows:
Texts can contain ASCII characters with decimal codes 32..126 (' '..
'~'). Other characters (control characters with codes 1..31 or
special characters 127..255) can be entered as either decimal numbers
or ASCII mnemonics enclosed in angle brackets, e.g. <255> <10> <13>
<STX> <CR> <LF> <SOT>. Characters with codes 128..255 can be entered
as the IBM extended ASCII characters (e.g. foreign language characters
Ä, ü etc, and graphics characters « õ ┌ ┐ ╔ ║ etc). If the keyboard
cannot produce the character, it can be entered by holding down the
ALT key and typing its decimal ASCII code on the numeric keypad, the
character is displayed when ALT is released. To insert an angle
bracket or a double inverted comma into the text, these must also be
entered in angle brackets, e.g. <<> <>> <">
The ASCII code 0 (NUL) is NOT allowed in texts 0..3999 because NUL is
used as the text terminator. The first character of a text 0..3999
should NOT be 253, 254 or 255 (FD..FF hex), these are reserved to
indicate that the text is a binary LAN text or a Data Block. Texts
4000..7999, in extension memory, do not have these restrictions.
Texts can be any number of lines, up to a total size of 3072 (3K)
characters.
Text examples:
6
SEDIT - Page 27
Separate the "text" and the symbols using commas. The value of the
symbol is inserted into the text by the Assembler. The optional
".format" must be separated from the symbol name by '.' (no spaces).
The format defines the width of the field for the number, whether the
number is to be left or right justified in this field, whether it
should have leading zeros, and whether it should be prefixed by the
symbol's type. Symbols are added to the resource list.
Texts and Data Blocks share the same addresses (0-7999), i.e. if
TEXT 0 exists, then DB 0 cannot be used.
SEDIT - Page 28
If the DB definition occupies more than one line, the preceding line
must end with a comma ',', so SEDIT knows that more values are
expected.
If symbols are used as data values, the symbol names are added to
the resource list. Data Blocks can have comments on the same line,
as shown below.
Once the program assembles without errors, exit SEDIT, ensuring that
the file is saved, using F2 or "Quit". The file must then be linked
using the "Link" option from the main menu (or SLINK from the DOS
prompt). The file can also be assembled from the "Assemble" menu, or
SASM from the DOS prompt.
The linked PCD file can then be loaded into the PCD using the
"Up/download" option from the main menu, or using "Debug".
Each module will typically contain one COB, and a set of PBs and
FBs. A library of PBs and FBs can also be developed, placing these
in a separate source file, which can then be linked with other
modules to produce the program.
$INCLUDE filename
The "filename" can contain a drive, path and file extension, for
example D:\FRED\GLOBALS.INC. The $INCLUDE directive must be entered
in the label field, see section 2.7(b).
SEDIT reads the include file and adds any resources defined in the
file into the resource table. Resources defined in an include file
are marked with an 'I' in the "IS" column of the resource screen,
see section 4. If any FBs are defined in the include file, the FB
parameter definitions are also read.
SEDIT ignores any code contained in the include file - but the
assembler will process this code as though it were part of the
source module.
Graftec programs, created with the Graftec editor SGRAF, must not
use $INCLUDE files. SGRAF does not support this directive.
SEDIT - Page 31
Format:
Example:
...
STH I 0
$IF 0 ; | This code has been patched out.
SET F 32 ; | When this code is needed again,
.... ; | change "$IF 0" to "$IF 1".
$ENDIF ; |
SET F 96
For example:
12. ERRORS
═══════════
If errors are found during assembly (with SASM V1.3 or above), they
are stored in a temporary error log file called SEDIT.ERR. When the
module is next edited using SEDIT, the SEDIT.ERR file is read and
any lines containing errors are highlighted. Some errors such as
missing operand, missing text etc. may highlight the line after the
error.
Errors which are accepted by SEDIT, but are trapped by the assembler
SASM are:
ERROR 29: SYMBOLIC OPERANDS NOT ALLOWED FOR MOV DATA TYPES
The MOV instruction does not allow the data type to be a
symbol, it must be an absolute value.
ERROR 88: CAN'T EDIT GRAFTEC STRUCTURE, USE GRAFTEC EDITOR (SGRAF)
Editing of the Graftec structure SB, ST and TR instructions
has been disabled in SEDIT. These can only be edited using
the Graftec editor SGRAF.
ERROR 100-200:
Generated by the Assembler SASM, see section 12.3 and the
Assembler documetation.
SEDIT - Page 41
The source file created is a standard ASCII source file (.SRC), which
can be assembled using SASM.
* EQUate and DOC statements must contain absolute values, not other
symbols. For example, "Symbol2 EQU Symbol1" is not allowed,
instead use "Symbol EQU I 1".
* Jump labels cannot have more than 6 characters, they are truncated
to 6 if longer. This may cause multi-defined label errors.
STH =Input
OUT =Output
* The largest single module which can be edited is about 5000 lines,
on an IBM PC/XT/AT with 640K memory. This depends on the size and
number of comments in the source file, and on available memory.
If an "Out of memory" error occurs, split the source file into
two modules. We recommend a maximum size of about 500 lines for
each module.
* The resource list is created from the EQUate and DOC statements.
The automatic comment for each resource is taken from the comment
on the same line as the EQUate or DOC. For example:
* You cannot alter the Graftec structure with SEDIT. The SB, IST,
and TR instructions, and their incoming/outgoing parameter lists
cannot be changed.
* SBs, STs, and TRs can be renumberd from the resource screen, and
unused SB, ST and TR definitions can be deleted.
Some new data types have been introduced for SEDIT which are not
handled by the existing version of the assembler (SASM V1.x). EQUate
or DOC statements containing these are commented out with double
semicolons ';;' at the start of the line. Thus they are not processed
by the assembler, but are available to SEDIT. A declaration of the
symbol which can be processed by SASM is included.
XOB StartUp
SASI Channel ;Initialize Channel 0
Init0
LD R 0 ;User comment.....
Fred
EXOB
; Comment line
COB MainBlock ;User comments.....
0
STH Start ;if red start button pressed
ANL Alarm ;and no alarm
SET Motor ;then turn on the motor
ECOB
For example, using "*.SRC" as the mask, will display all the ".SRC"
type files. "ED*.SRC" will display all the source files whose names
begin with "ED". Directories are excluded from the masking process.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD CODE EDITOR V2.1 MODULE: TEST.SRC │
├────────────────────────────────────────────────────────────────────────────────┤
│┌─────┬────────┬─────────────┬────────────┬────────────────────────────────────┐│
││LABEL│MNEMONIC│ OPERAND │ SYMBOL │ AUTOMATIC COMMENT ││
│╘═════╧════════╧═════════════╧════════════╧════════════════════════════════════╛│
│═══ Start of module ═══ │
│ ┌───────────────────────────── E:\SEDIT\*.* ──────────────────────────────┐ │
│ │ FBDEMO.SRC FBPARAMS.DOC HARDWARE HASH.OBJ │ │
│ │ HEADER PCDMENU.DAT PCDSETUP.DAT PRNT.BAT │ │
│ │ Q.LST Q.SRC README SASM.EXE │ │
│ │ SEDIT.DOC SEDIT.EXE SEDIT.HLP SEDIT.INF │ │
│ │ SEDITHLP.SAV SHIFTKEY.H SOFTWARE STRMCPY.C │ │
│ │ STRMCPY.OBJ STROVL.C STROVL.OBJ STRTAB.C │ │
│ │ STRTAB.OBJ SYMBOLS.SRC TCCONFIG.TC TURBOC.CFG │ │
│ │ VIDEO1.C VIDEO1.H VIDEO1.OBJ X.SRC │ │
│ │ Y.SRC 8-MAR\ JEAN\ MAMI\ │ │
│ │ SAVE1\ SAVE2\ SAVE\ TEST\ │ │
│ │ ..\ │ │
│ │ │ │
│ │ │ │
│ ╘═════════════════════════════════════════════════════════════════════════╛ │
│ SET O 33 Motor Turns on the motor │
│ ECOB │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ FILE DIRECTORY: Use ARROW, PGDN, HOME etc. Enter selects a directory. <ESC> │
├────────────────────────────────────────────────────────────────────────────────┤
│ Line: 5 Free Memory: 406981 Symbols: 9 Errors: 0 F1=Help F3=Info │
└────────────────────────────────────────────────────────────────────────────────┘
SEDIT - Page 46
REVISION HISTORY
05-Jan-98 V2.1
1) Added "Error 167: Forward reference to macro: <name>"
21-Jun-96 V2.0
29-May-96 B2.0d
1) Added Warning 8: More than one Initial Step (IST) in SB.
2) Added note to $AUTO (6.15):
NOTE: $AUTO must NOT be used in user-coded programs, it is
for use by the PG4 code generators ONLY. The syntax of this
directive will be changed for the next release.
03-May-96 B2.0c
1) SWMR 815: Simplified the $PCDVER PCD types to a set of
7 fixed types, see section 6.17.
2) I and O can now be mixed, this is now allowed:
Sym EQU I 0
STH O Sym
14-Mar-96 $19G
1) SWMR 680: Added $CPU and $STATION directives, see section
6.16.
2) SWMR 815: Added $PCDVER directive, see section 6.17.
New PCD TYPE segment in object file, see section 11.
29-Feb-96 $19E
1) SWMR 812: Added $IFTYPE and $ELSEIFTYPE directives, see
section 6.4.
23-Jan-96 $19C
1) SWMR 780: Changed AUTO declaration to $AUTO directive.
(moved 4.9 to 6.15).
2) Added Error 177: Auto-allocation array overflow: <symbol>.
30-Oct-95 $199
1) For blocks, there is now no need to use an AUTO declaration
because blocks can always be auto-allocated. If there are
any collisions with blocks defined with absolute numbers,
the SLINK now allocates a new number.
30-Aug-95 $197
1) Added collision detection for auto-allocation, data defined
with an absolute value which falls within the auto segment
generates this error:
Error 174: Auto-allocation collision: <symbol>|<type><value>
2) Added Error 175: Auto-allocation not allowed for type: <type>
Error 173: Illegal use of auto-allocated symbol
3) ST and TR numbers can now be auto-allocated.
03-Aug-95 $194
1) Added local symbol segment to OBJ file with /SYM switch,
see sections 2 and 11.
2) AUTO declaration now allows a range (e.g. start..end)
as well as a count (e.g. [count]), see 4.9.
28-Jul-95 $193
1) Added /$Iinclude switch, see section 2.
2) External symbols can now be given a type, see 4.2.
3) New automatic resource allocation feature, using the new
AUTO declaration, see 4.9. There is a new AUTO record in
the object file, see 11.
4) EQUate statements can now be used to define auto-allocated
symbols, where SLINK assigns a value to the symbol from a
range defined by the AUTO statement, see 4.3 and 4.9.
5) Added these error messages, see 9.2:
Error 170: Multi-defined AUTO type
Error 171: Auto allocation overflow
Error 172: No AUTO declaration for this type
6) Document the "@cmndfile" feature, where the SASM command
line can be supplied from a command file, see 2.
03-Jun-95 $191
1) Added $ONERROR directive, see 6.14.
2) Added Warning 7: Invalid expression between @..@ in $directive
24-Apr-95 V1.9
06-Feb-95 $18A
1) If an error occurs inside a macro, and the /NM switch is
active (don't expand macros in listing), then the line in
error is now always listed.
2) Macro replacement was carried out on macro parameter
names appearing in the $ERROR, $WARNING, $TITLE and
$STITLE directives if the directive was used inside a
macro.
e.g. FRED MACRO TOM
$WARNING TOM IS HERE
ENDM
...
FRED SMITH ---> $WARNING SMITH IS HERE
...
Macro replacement in these directives is now disabled
unless the macro parameter name is enclosed in @..@
characters, which cause the expression between them
to be evaluated.
3) Added symbol name to multi-defined error messages (685):
Error 37: Multi-defined label: <label name>
Error 41: Multi-defined symbol: <symbol name>
4) Changed error "Error 153: Too many initializers" to
"Error 153: Text/DB data too long" (686).
5) Texts can now contain formatted absolute R/T/C/I/O/F
addresses. This is useful in macros so the parameter
can be either a symbol or an absolute address. Note
that there must be a space between the mc and the
address, e.g. "R 100" not "R100" (which would be
interpreted as a symbol).
e.g. TEXT TOTO "ABCDE$", R 100.04T
generates TEXT TOTO "ABCDE$R0100" (689)
6) Added $FATAL <message> directive, which generates
"Fatal Error 20: FRED.SRC: Line 123: <message>" (714).
7) Removed $MINCLUDE directive, it caused too many problems.
$INCLUDE statements are read only when the macro definition
is assembled, NOT when the macro is called.
11-Aug-94 $187
1) Forward references are not allowed in $IFxxx statements
anymore. These now generate "Fatal error 14: Symbol in $IF
no defined: <symbol name>".
2) Changed "Fatal error 14: Out of symbol space" to "Fatal
error 8: Out of memory" (they mean the same thing).
05-Jul-94 $186
1) New error message:
Error 166: Local symbol has same name as macro parameter.
2) $INCLUDE statements can now be used in macros and the
include file name can be given as a macro parameter.
3) $INCLUDE statements now work inside conditional statements
in macros, such as $IFB <>.
4) Jump labels are now local to each $INIT..$ENDINIT section,
even if there are multiple $INIT sections in a single macro.
Labels in the macro are also local, and cannot be seen by
statements in the $INIT section.
5) $INIT..$ENDINIT sections are now allowed outside a block.
6) The $REPORT, $ERROR and $WARNING statements can now evaluate
and output an expression containing symbols and operators.
The expression must be delimited between @...@ characters,
so that SASM can determine what is text and what is the
expression to be evaluated. Full expression evaluation is
supported. See sections 6.5, 6.11 and 6.12.
E.g. FRED EQU R 10
TOM EQU FRED+1
...
$REPORT TOM is @TOM@, same as @FRED+1@
Outputs: TOM is R 11, same as R 11
7) In section 6.12, describing the $WARNING statement, the
example $IFNDEF statement contained an illegal forward
reference, which might generate a "Pass 2 phase error".
E.g. $IFNDEF Axis <────── Forward reference
$WARNING "Axis" not defined ┌─ to Axis definition
Axis EQU 0 <────┘
$ENDIF
"Axis" is not defined on pass 1, then *is* defined on pass
2. This will often cause a "Pass 2 phase error". Forward
references should NEVER be used in conditional directives,
although SASM allows it.
8) If a local symbol or label in a macro has the same name as
a macro parameter (it is inserted by macro string replace-
ment), then this does not reference the local symbol anymore.
Macro definition:
FRED MACRO ONE
SYMBOL LEQU I 10
STH SYMBOL <-- references local symbol
ANL ONE <-- references macro parameter
ENDM
Old macro call was expanded as:
FRED SYMBOL
_0SYMBOL LEQU I 10
STH _0SYMBOL
ANL _0SYMBOL <-- Error, references local symbol
29-Apr-94 $184
1) Add "Fatal Error 19: Program too big for n/n Starter Package".
24-Sep-93 $175
1) "/Iincludedir" switch.
2) Pre-defined symbols _BLOCKNUM_ and _BLOCKTYP_, see
section 4.8.
19-Aug-93 $174
1) Add "Error 55: Operand must be zero".
28-Jul-93 $173
1) Add CASI, CRD and CWR instructions. Add "Error 109: Invalid
counter channel".
2) New $NOXINIT and $ENDNOXINIT directives.
3) Don't process $INIT/$ENDINIT/$ERROR in false conditionals or
$SKIP sections!
4) New $WARNING directive.
5) Add "Error 29: Multi-defined macro parameter".
09-Jun-93 V1.7
1) $INIT..$ENDINIT directives, code between these is placed
in the cold start XOB 16 (6.9).
2) $ERROR directive, generates a user-defined error (6.10).
3) Supports new CPBI instruction.
4) $SASI text processing updated for new S-BUS definitions.
5) The standard ANSI mnemonics for special characters can now
be entered into texts, enclosed in angle brackets. SASM
converts these to their binary characters. E.g. "<CR><LF>" =
"<13><10>", "<BEL>" = "<7>" (3.5).
User-defined symbols for ASCII characters can also be used.
6) New "$$" constant, which is the offset from the start of the
code. This is similar to the "$" constant, which is the
offset from the start of the block. E.g. SYMBOL EQU $$ (3.3).
7) New LEQU and LDEF declarations, for defining symbols which
are local to a macro (7.5).
8) The DOC declaration now supports all data types. COB, XOB,
PB, FB, SB, ST, TR, TEXT, DB and SEMA have been added (4.5).
9) New /TEMP switch (use temporary file), which allows larger
files containing many macros to be assembled. Assembled macro
definitions are stored in a temporary file (in the "SET TEMP=
path" directory) instead of in memory (2.).
10) Check that each ST or TR has an output, issuse "Warning 4:
STep or TRansition has no output" if not.
11) Check that each SB contains an IST, issue "Warning 5: SB has
no initial step" if not.
12) Add error messages 62, 95, 160..164.
13) $LAN text processing now supports the new indirect LAN text
format.
14) On completion, SASM now outputs the number of warnings as
well as the number of errors.
22-Nov-92 $164
1) Add binary units for PUBLics.
2) Add $$ flag.
20-May-92 $162
1) Now supports TEXTs and DBs 4000..7999 in the new data
segment. TEXTs 4000..7999 can now contain the NUL <0>
character. DBs 4000..7999 can contain up to 16384 elements.
2) Supports the new indirect LAN texts.
3) New TFR instruction.
06-Dec-91 $154
1) New "/Dysm[=typ]" switch for defining symbols on the
DOS command line (SWMR 244).
2) External symbols can now be used inside Texts and Data
Blocks (SWMR 117).
3) Texts do not have to begin with "", they can now start
with a symbol. For example: 'TEXT 0 "", Fred.1' can now
be written as 'TEXT 0 Fred.1'.
4) New object file format of the text segment has be changed
to support externals in Texts and Data Blocks, and for the
forthcoming extended memory data segment.
5) Added errors 151 to 153.
04-Oct-90 $139
1) Added "Data Blocks", section 3.6. New "DB" data type,
sections 4.6, 8.2.
2) TEXTs can now have an optional length, section 3.5.
3) Object file format changed (new DB type etc.), section 11.
Add description of binary LAN text and Data Block formats.
4) Instruction set changes (see instruction set description):
PUT and GET instructions now allow X and DB media types
for copying data between Registers, Texts and Data Blocks.
5) ALGI/ALGO instructions now allow symbols for both the
channel and the base address (channel CANNOT be external).
6) TEXTs can also be defined with 'X', e.g. "SYM EQU X 10" is
the same as "SYM EQU TEXT 10", section 4.6.
7) SWMR 145/146: Added /NG switch to suppress Graftec ST/TR
IO parameter lists in listing.
8) Now detects labels defined outside a block, added
Error 38: Label outside block.
9) Sequential Blocks can only be called from COB's, added
Error 39: Illegal SB call
10) Changed description of Error 92 and Fatal Error 17.
11) Added error messages 144-149 for Data Blocks.
11-Sep-90 $137
1) SWMR 123. Indirect addressing (with @) added to $LAN texts.
2) SWMR 124 and 125. $SASI text format updated.
3) Add "Error 37: Multi-defined label".
01-Aug-90 $136
1) If an include file is not found in the current directory,
SASM now searches in the PCD directory given in the
environment string with "SET PCD=d:directory".
2) Add Error 37: Multi-defined label.
08-May-90 $133
1) New conditional directives $IFINC, $IFNINC (if included, if
not included) and $ELSEIFINC, $ELSEIFNINC.
02-Mar-90 $132
1) Now supports new data types COB, XOB, PB, FB, SB, ST, TR, TEXT,
SEMA and =, these can be used in EQU and DEF statements (4.6).
2) Added "Error 54: FB param numbers (=) can't be public",
changed error 93 to "Error 93: Missing $ENDSASI or $ENDLAN".
3) New data types in object file (11).
14-Feb-90 $131
1) Added MACROs, new section 7. SASM is now "SAIA MACRO
ASSEMBLER".
2) $IFB and $IFNB directives added, these can be used to check if
an actual macro parameter has been supplied.
3) $IFE and $IFNE directives added, these check macro parameter
strings.
4) Now allows $ELSEIFxxxx.
5) /M /NM switches added to enable/disable macro expansion in
listing.
6) New errors 71-79 for macros.
7) New warnings 2 and 3 for macros.
22-Nov-89 V1.3
1) Allows 'K' constants for LD, LDH and LDL (SWMR 17).
NOTE: K constants CANNOT be passed as FB parameters to LDH/LDL,
to do this requires a PCD firmware change.
2) Labels are now local to a block (SWMR 21).
3) Allows international character set in labels and symbols
(SWMR 32).
4) Symbols can now be referenced from inside texts according to
(SWMR 33).
5) Creates SASM.ERR file containing error messages (SWMR 71).
6) Added $SASI..$ENDSASI directives. SASI texts are checked and
converted to upper case (SWMR 74).
7) Added $SKIP..$ENDSKIP directives.
8) Now supports nested $INCLUDE files (10 deep), nesting depth
is shown in the "I" column of the listing.
9) Now supports nested $IF..$ELSE..$ENDIF statements (30 deep).
10) Gives help if invoked with an incorrect command line from DOS.
11) Put type in MC field for EQU and DEF statements.
12) The units of a symbol are now stored. The symbol is shown
in the xref list in the correct units (was always decimal).
Units are now stored in the OBJect file, so that global
symbols are shown in the correct units in the MAP file (was
always decimal). OBJect file is upward compatible with V1.2.
13) Allows IBM graphics characters in texts (┌ ═ ║ õ ü etc).
14) Supports 4-character (32-bit) ASCII constants 'abcd' etc.
15) Can now assemble a much larger file. The file is not read
entirely into memory anymore.
16) $LLAN and $NOLLAN changed to $LAN, $ENDLAN ($LLAN and $NOLLAN
are still supported by SASM).
25-Nov-88 V1.1
1) INSTALL.DAT file renamed to PCDSETUP.DAT
2) Add information about SFBREF program.
3) SASM now dsplays "To: file.SRC file.LST".
4) SASM now shows "Free memory: 123567" after assembly.
5) $LLAN and $NOLLAN directives added.
6) New listing format, without PG1 opcodes etc.
7) New "Fatal Error 17: Total text size > 64K".
8) Change "Error 100: Illegal use of mc/sc/cc" to Error 59.
9) Change Error 100 to "Illegal use of reserved word".
10) Add DOC definition (4.5).
30-May-88 V1.0
CONTENTS
========
PAGE
1. INTRODUCTION 2
1.1 Assembler Package 2
1.2 File Naming Conventions 2
1.3 Package Diagram 3
2. INVOCATION FROM DOS 4
2.1 Return Values 6
3. SOURCE FILE FORMAT 7
3.1 Instructions 7
3.2 Symbols 7
3.3 Numeric Constants 8
3.4 Labels 9
3.5 Texts 10
3.6 Data Blocks 14
3.7 Comments 15
3.8 Reserved Words 15
4. DECLARATIONS 16
4.1 PUBLic 16
4.2 EXTerNal 16
4.3 EQUate 17
4.4 DEFine 17
4.5 DOCumentation 17
4.6 Typed Symbols 18
4.7 Scope of Symbols 19
4.8 Pre-defined Symbols 19
5. EXPRESSIONS 20
5.1 Arithmetic Operators 20
5.2 Bitwise Operators 21
5.3 Relational Operators 21
5.4 Operator Precedence 21
6. DIRECTIVES 22
6.1 $INCLUDE 22
6.2 $TITLE, $STITLE 22
6.3 $LIST, $NOLIST, $EJECT 23
6.4 $IFxxxx..$ENDIF 23
6.5 $REPORT 27
6.6 $LAN, $ENDLAN 27
6.7 $SASI, $ENDSASI 28
6.8 $SKIP, $ENDSKIP 28
6.9 $INIT, $ENDINIT 29
6.10 $NOXINIT, $ENDNOXINIT 30
6.11 $ERROR 31
6.12 $WARNING 31
6.13 $FATAL 32
6.14 $ONERROR 32
6.15 $AUTO, Automatic Resource Allocation 33
6.16 $CPU, $STATION 35
6.17 $PCDVER 35
7. MACROS 37
7.1 Defining a macro 37
7.2 Calling a macro 39
7.3 $IFB, $IFNB, $IFE, $IFNE and EXITM 40
7.4 LEQU and LDEF 41
7.5 Macro Examples 42
8. LISTING FORMATS 44
8.1 Listing 44
8.2 Cross Reference List and Symbol Table 47
9. ERROR HANDLING 49
9.1 Fatal Errors 49
9.2 Assembly-time Errors 52
9.3 Warnings 64
10. PERFORMANCE AND LIMITATIONS 65
10.1 Lexical and Syntax Analysis 65
10.2 Performance 67
10.3 Limitations 68
11. OBJECT FILE FORMAT 69
SASM - Page 2
1. INTRODUCTION
================
This document describes the use of the SAIA PCD Macro Assembler
(SASM). The assembler reads an ASCII text file (.SRC) and converts
it into a binary object file (.OBJ). This must be linked using the
linker (SLINK) to produce a file which can be loaded into the PCD
(.PCD).
SASM - Assembler
SLINK - Linker
SDISASM - Disassembler
Several different types of files are used by the package. Each type
of file has a special 3 character extension, these are the defaults:
+++++++++ +++++++++
+ .FBR + + .RES +
+--->+ to + +-->+ to +
| +printer+ | +printer+
| +++++++++ | +++++++++
| |
********* | +------+ ********* | +------+
* * | | | * * | | |
*SFBREF *---+--->| .FBR | * SRES *--+-->| .RES |
* * | file | * * | file |
********* +------+ ********* +------+
^ ^
| |
+------------------------------+-------------+
|
+------+ ********* +------+ ********* +------+
+------+| * * +------+| * * | |
| .SRC ||--+-->* SASM *--+-->| .OBJ ||------>* SLINK *--+-->| .PCD |
|files |+ | * * | |files |+ * * | | file |
+------+ | ********* | +------+ ********* | +------+
| | |
| | +------+ | +++++++++
| | +------+| | + .MAP +
| +-->| .LST || +-->+ to +
| | |files |+ | +printer+
| | +------+ | +++++++++
| | |
| | +------+ | +------+
| | | .ERR | | | |
| +-->| file | +-->| .MAP |
| | | | +---------| file |
| | +------+ | +------+
| | |
+--------------|---------------------+ |
| | |
| v v
| +++++++++ ********* +------+
| + .LST + * * +------+|
+-->+ to + * SDOC *--+-->| .DOC ||
+printer+ * * | |files |+
+++++++++ ********* | +------+
|
| +++++++++
| + .DOC +
+-->+ to +
+printer+
+++++++++
All programs use printer set-up information from file PCDSETUP.DAT for
page formatting of output files and printouts, see "Configure" program
SCONFIG.
SASM - Page 4
C:\>SASM SOURCE/L/X
C:\>_
The "Free memory" value shows the ammount of memory left after the
assembly. Memory is used to hold the source and include files, and
the symbol table. The maximum size of source file which can be
assembled is dependent on the memory size. If this value is small,
for example less than 50K, you should not increase the size of
the source file, otherwise an "Out of memory" error may occur.
3.1 Instructions
-----------------
3.2 Symbols
------------
Symbolic names can be any length, but only the first 10 characters are
significant, and only the first 10 characters appear in any symbol
tables etc.
Symbols are not case sensitive unless they contain foreign characters,
"MotorOn" is the same as "MOTORON", but "FÜHRER" is NOT the same as
"führer".
A-Z
a-z
0-9
_ (underscore)
Foreign characters with ANSI character codes
The default base for numeric constants is decimal. All constants are
stored as 32-bit signed integers. If a constant is too big or too
small to be represented as a signed 32-bit value, an error is
generated.
* DECIMAL CONSTANTS
* BINARY CONSTANTS
* HEXADECIMAL CONSTANTS
Binary and hex constants have the range 0 to FFFFFFFFH. Note that
FFFFFFFFH is -1 decimal and 80000000H is -2147483648 decimal.
* $ CONSTANT
This has the value of the address offset into the current code
block (COB, XOB, PB, FB, SB, IST, ST or TR). It is used primarily
when and address needs to be made public (for loading into a
register etc).
$ must NOT be used to create labels for relative jumps (JR), but
may be used for direct jumps (JPD), for loading a register with
an address using the LD instruction, or as an address for the
RCOB instruction. $ cannot be used inside a $INIT segment.
* $$ CONSTANT
Similar to the $ constant above, but this has the value of the
offset from the start of the code (always 0), and is assigned a
value by the Linker. This value can also be made PUBlic. The
value of the constant may be useful for documentation or debug
purposes if its public value is listed in the MAP file.
3.4 Labels
-----------
The value assigned to a label is its offset within the code block
where it is defined. All labels are local to the block in which they
are defined, the same label can be used many times in a the same
source module, providing it is always in a different block. Jumps to
labels defined in another block are not allowed.
Labels cannot be PUBLic, since all labels are local to the block
in which they are defined, and jumps between source modules are not
allowed. '$' can be used to create untyped symbols containing the
offset into the code block, which may be made public or can be
referenced from another block (by the LD or RCOB instructions).
Example:
...
PUBL LAB1 ; LAB1 is declared public
LAB1 EQU $
...
LAB2: STH I 0 ; LAB2 is a label for a wait loop
JR L LAB2
...
SASM - Page 10
3.5 Texts
----------
Format:
Examples:
Texts can also contain symbolic references. The value, and optionally
the type, of the symbol is inserted into the text. The symbol is
written outside the text in double quotes, and must be separated from
this or other symbols by a comma. After the symbol, an optional field
width and prefix type can be given. Symbols in texts have this format:
symbol[.[[-][0]width][t|T]]
Where: symbol The symbol name. This can actually be any expr-
ession which includes a symbol, for example:
MotorOn+100, IOBase+Offset etc.
Symbols with floating point values are not
permitted.
. The dot immediately after the symbol indicates
that a field width and/or prefix is present.
width The field width, the number of digits or spaces
for the number (1..20). If the number is longer
(e.g. width=3, number=1234), then the width is
automatically increased so the number is not
truncated.
0 If the width begins with a 0, leading zeros are
inserted to padd the field to "width" characters.
- If "width" is preceded by a '-' sign, the data is
left justified in the field, the default is right
justified. No leading zeros are inserted, even if
the width begins with '0'.
SASM - Page 11
Texts continued
---------------
Any character can be entered into a text, except that TEXTs 0..3999
do not allow the NUL character (ASCII code 0) because this is used
as the end-of text character.
SASM - Page 12
Texts continued
---------------
To include the <, > and " characters in a text, these must also be
enclosed in angle brackets: <<>, <>>, <">.
Examples:
EndOfText EQU 2
TEXT 103 "<EndOfText>" ; SAME AS "<2>"
TEXT 104 "<EndOfText+1>" ; SAMD AS "<3>"
Texts continued
---------------
Texts and Data Blocks share the same numbering. For example, if TEXT
10 is defined, then DB 10 cannot be defined, and vice versa.
Texts 0..3999 are stored in text memory. Texts 4000..7999 are only
available on a PCD with extension memory. The PCD2 supports only
Texts/DBS 0..5999.
An empty text ("") does not create a text in a .PCD file, but it DOES
define the text number for the assembler and linker, thus preventing
that text from being re-defined. However, the PCD's CPU treats an
empty text as though the text doesn't exist.
SASM - Page 14
The PUT instruction transfers data from Registers into a Data Block,
and the GET instruction transfers all the data from a Data Block into
a block of Registers. The number of Registers copied depends on the
Data Block length, which is defined in the source file in the DB
declaration. The TFR (TRansFer) instruction transfers single elements
to or from a Data Block.
Format:
Examples:
Data Blocks share the same numbering as Texts. For example, if Data
Block 10 is defined, then Text 10 is unavailable, and vice versa.
SASM - Page 15
3.7 Comments
-------------
Comments can appear anywhere in the source file (except after some
directives such as $TITLE, $ERROR, $REPORT), even between lines of
multi-line instructions. Comments begin with a semi-colon character
';'. All characters after ';' are ignored until the start of the
next line. Comments can contain any characters.
The comments appearing after EQU, DOC or EXTN statements are used as
the "automatic comments" by the Documentation Generator (SDOC).
Format:
[statement] ; [comment]
The following words are reserved, and cannot be used as symbol names:
4. DECLARATIONS
================
4.1 PUBLic
-----------
Format:
When a symbol is declared PUBLic, its value is global, the symbol can
be referenced from any module as an external, see section 4.2.
One or more symbolic names can follow the PUBLic statement. Each symbol
must be separated by one or more spaces or tabs, and/or by a comma. The
comma is not required, but can be present if prefered.
Forward references are allowed, the <symbol name> can be defined after
the PUBLic statement.
4.2 EXTerNal
-------------
Format:
One or more symbolic names and optional types can follow the EXTN
statement. Each symbol must be separated by one or more spaces or
tabs, and/or by a comma. The comma is not required, but can be used
if preferred.
Forward references are allowed, the <symbol name> can be defined after
the EXTN statement.
4.3 EQUate
-----------
Format:
4.4 DEFine
-----------
Format:
DEF defines a variable. This is the same as EQUate, except that the
<symbol name> can be re-DEFined in the module, and the <expression>
cannot contain an external. The symbol must not be defined anywhere
else in the module unless it is re-defined with a DEF statement.
4.5 DOCumentation
------------------
Format:
If symbols are given a type, the type is checked whenever the symbol
is used and provides added security. It is illegal to use a symbol
with an invalid type in an instruction, or to mix symbols of different
types in an expression. PUBLic symbols retain their type information
which is checked by the Linker in the same way.
I Input
O Output
I|O Input or output (both use the same numbering)
F Flag
R Register
T Timer
C Counter
T|C Timer or Counter (both use the same numbering)
K Constant (13-bits unsigned)
The symbol's type appears in the TYPE field of the cross reference
list, see section 8.2.
SASM - Page 19
Symbols defined with DEF have scope from the definition point to the
end of the source file (unless re-DEFined), allowing backward
references only.
Labels are usable only within the code block in which they are defined,
and are local to that block. To create a label which can be referenced
from any block or can be made PUBLic (for use by the LD or RCOB
instructions), "<label> EQU $" can be used, see section 3.3.
All COB, XOB, PB, FB, SB, IST, ST, TR, TEXT and DB numbers are global,
even if their symbols (if used) are not explicitly declared PUBLic.
There can be only one block or text with the same type and number in
each program.
5. EXPRESSIONS
===============
& AND
| OR
^ XOR
! NOT (1's complement)
>> Shift right
<< Shift left
AND, OR, XOR and NOT behave as unary operators on TRUE and FALSE
values generated by the relational operators below.
= equal to
<> not equal to
> greater than
>= greater than or equal to
< less than
<= less than or equal to
High
1 ! + - (unary)
2 * / %
3 + - (binary)
4 << >>
5 = <>
6 > >= < <=
7 &
8 ^
9 |
Low
SASM - Page 22
6. DIRECTIVES
==============
6.1 $INCLUDE
-------------
$TITLE provides the title which appears on the second line of every
page of the listing, $STITLE provides the subtitle which appears on
the third line of every page of the listing.
The title or subtitle <text> begins from the first character following
the directive which is not a space or a tab, and ends at the end of the
line. The maximum length of a title or subtitle text is 70 characters,
characters after this are ignored. If no text appears after the
directive, any existing title or subtitle is removed.
The title appears on each page of the listing, the subtitle appears on
all pages following the one in which the $STITLE directive appears.
If more than one $TITLE appears, the last one in the module is used.
SASM - Page 23
Format: $LIST
$NOLIST
$EJECT
6.4 $IFxxxx..$ENDIF
--------------------
$IFDEF <symbol>
If the <symbol name> is DEFined, EQUated, declared EXTerNal,
or is a label declared in the current block.
$IFNDEF <symbol>
If the <symbol name> is NOT DEFined, EQUated, declared EXTerNal
or a label.
$IFINC
If $INCLUDE file (TRUE if this module has been included in
another module).
$IFNINC
If not $INCLUDE file (TRUE if module is main module).
$IFB If blank. } These are for use inside macros for checking
$IFNB If not blank. } macro parameter strings, and are described
$IFE If equal. } in section 7.3.
$IFNE If not equal. }
SASM - Page 25
$IFxxxx..$ENDIF continued
-------------------------
Format:
$ELSEIF $ELSEIFN
$ELSEIFDEF $ELSEIFNDEF
$ELSEIFB $ELSEIFNB
$ELSEIFE $ELSEIFNE
$ELSEIFINC $ELSEIFNINC
$ELSEIFTYPE
Examples:
$IF Version = 1
STH I 1000 ; Code for version 1
$ELSEIF Version = 2
STH I 10 ; Code for version 2
$ELSE
STH F 100 ; Code for all other versions
$ENDIF
SASM - Page 26
$IFxxxx..$ENDIF continued
-------------------------
Examples:
;------------------------------------
;------------------------------------
;------------------------------------
6.5 $REPORT
------------
The <text> begins from the first character following $REPORT which is
not a space or a tab. If no text is present, a line feed is output to
the console.
Example:
FRED EQU R 10
TOM EQU FRED+1
...
$REPORT TOM is @TOM@, same as @FRED+1@
Format: $LAN
<text definitions>
...
$ENDLAN
These two directives are used to delimit texts which are to be pre-
processed by the assembler into a special binary format for the SAIA
LAN 2 (PCD6.T100 with firmware V003 or above).
Example:
$LAN
TEXT 0 "2:I0-255:F0-255" ; These are binary LAN texts
TEXT 1 "2:O0-255:O0-255"
$ENDLAN
TEXT 10 "This a standard ASCII text"
SASM - Page 28
Format:
$SASI
<SASI text definitions>
. . .
$ENDSASI
These directives are used to delimit texts which are used by the
SASI instruction (Assign Serial Interface). These SASI texts are
fully checked by the assembler and invalid texts are detected. The
texts are also converted to upper case as required by SASI. If
$SASI..$ENDSASI are not used, it is possible to enter an invalid
text which may cause incorrect initialization of the serial port.
Example:
. . .
SASI 0 ; Initialize serial channel 0
100 ; using text 100
. . .
Format:
$SKIP
<statements to be ignored>
. . .
$ENDSKIP
All code between these directives is placed in the start-up XOB 16,
and executed on power up or restart cold. This allows initialization
code to be written close to the code which uses it, rather than in
the XOB 16 module, and improves modularity.
PB 1 PB 2 XOB 16 XOB 16
$INIT $INIT LD R 0 LD R 0
LD R 1 LD R 2 0 0
100 200 EXOB LD R 1 \ from Module 1
$ENDINIT $ENDINIT 100 /
... ... LD R 2 \ from Module 2
EPB EPB 200 /
EXOB
Ok: PB 10 Fails: PB 10
$INIT $INIT
LD R 0 LD R 0
LABEL LABEL
$ENDINIT $ENDINIT
LABEL EQU $ LABEL: NOP
NOP
Because SASM does not know the location of the $INIT segment, use of
the $ and $$ symbols is not allowed between $INIT..$ENDINIT, because
the value would be incorrect.
SASM - Page 30
Format: $NOXINIT
<text and DB definitions, TEXT/DB 4000..7999>
$ENDNOXINIT
6.11 $ERROR
------------
Example:
6.12 $WARNING
--------------
Example:
$IFNDEF Axis
$WARNING "Axis" is not defined
$ENDIF
6.13 $FATAL
------------
Example:
$INCLUDE fred.inc
$IF fred_version < 3
$FATAL Wrong version of FRED.INC
$ENDIF
6.14 $ONERROR
--------------
Example:
Numbers are allocated from within a range defined by the new $AUTO
directive:
Excluding code blocks, texts and data blocks, each type to be auto-
matically assigned must have its own $AUTO directive. The user
program must not access any elements within the defined auto range
using direct addressing, this will generate an "auto-allocation
collision" error. This data can only be accessed via auto-allocated
symbols.
For code blocks, texts and data blocks, the $AUTO directive is
optional. If not supplied, then blocks are automatically allocated
from 0. If a block is defined with a direct address, e.g. FB 100,
then that address is reserved and is not used for automatic alloc-
ation. However, if a $AUTO directive supplied for the block, then
any blocks defined with direct addresses within the auto range will
generate a collision error.
Every source file to be linked must contain EXACTLY THE SAME $AUTO
directives. This is checked by the Linker. It is recommended that
all $AUTO directives are placed in a single include file, which is
$included at the start of every source module.
SASM - Page 34
Once the ranges for automatic allocation have been defined, symbols
can be assigned with EQUate statements, leaving out the expression
which defines the element's number, only the type is required. The
Assembler and Linker will assign absolute values to these symbols
from within the auto range.
ADD TenRegs
TenRegs+1
TenRegs+2
STH FiveFlags+4 ; References the last flag
6.17 $PCDVER
-------------
<type> The PCD type, which must be one of the strings listed
below. This is compared with the PCD type read from
the PCD. If the types match, then the <version> and
optional <internal version> are compared.
$PCDVER Continued
-----------------
Examples:
7. MACROS
==========
Whenever a macro name is found in the program, the block of text from
the macro definition is assembled. The macro name is "expanded" into
the full text of the macro. This is similar to an include file, but
the power of macros lies in their ability to be called with different
parameters.
Format:
Example:
The ENDM statement ends the macro definition. ENDM must not be preceded
by a label on the same line, e.g. LAB1: ENDM is illegal. Instead, put
the label on the preceding line.
* Macro names and macro parameters cannot have the same name as any
other symbol or reserved word (including mnemonics).
* Macro parameters can have the same name as symbols or labels defined
outside the macro - the macro parameter names are local to the
macro.
* The DEF statement should be used to define the names of symbols used
in macros. If EQUate is used in a macro, an error occurs if the
macro is called more than once in the same module.
* $IFDEF and $IFNDEF do not work with macro parameters. Use $IFB and
and $IFNB instead, see section 7.3.
* To compare actual macro parameter strings use $IFE and $IFNE, see
section 7.3.
Format:
Example:
ANDGATE I 0, O 32
or ANDGATE (I 0, O 32) ; The brackets are optional
STH I 0
ANH I 1 ; This is a comment
OUT O 32
As the macro is expanded, the formal parameters inside the macro body
are replaced by the actual parameters. This is done by simple string
replacement. The parameter name is replaced by the string supplied
as the actual parameter. The assembler detects errors where the actual
parameters are used in the macro body.
If parameters are left out, the correct number of commas must still
be present so that the parameters are in the correct positions. For
example, in this macro call parameters 1 and 3 are not supplied:
"FRED ,param2,,param4". If the last parameter (or last few parameters)
will be left out, the trailing commas should also be left out, unless
the parameters are enclosed in brackets, e.g. "FRED (param1,param2,,)".
Because parameters can be on more than one line, the string after the
last comma is interpreted as a parameter if brackets are not used.
* Macros cannot be called before they have been defined, the macro
definition must appear first in the source file.
$IFB and $IFNB mean "if blank" and "if not blank". These are used to
determine if an actual parameter was supplied or not.
Format:
$IFB <parameter> ; The < and > must be present!!
... ; $ELSE and nested $IF's are allowed
$ENDIF
Example:
ANDGATE MACRO INPUT, OUTPUT
STH INPUT
ANH INPUT+1
$IFNB <OUTPUT> ; If "OUTPUT" is defined,
OUT OUTPUT ; then write to output, else
$ENDIF ; leave result only in ACCU
ENDM
$IFE and $IFNE mean "if equal" and "if not equal". These compare an
actual parameter string with a given string, or compare two actual
parameter strings. The comparison is not case sensitive (unless the
foreign characters are used). NOTE: The STRINGS themselves are
compared, NOT the symbol values. To compare symbol values and numbers
use $IF or $IFN. To check symbol types use $IFTYPE.
Format:
$IFE <param1> <param2> ; Enclosing < > must be present!!
... ; $ELSE and nested $IF's are allowed
$ENDIF
EXITM ends the expansion of the macro, this can be used inside
conditional directives. This is useful to exit from deeply nested
$IFxxxx statements. For example:
These are exactly the same as the EQU and DEF statements in
sections 4.3 and 4.4, except they are for use inside macros, and
define symbols which are local to the macro. This allows symbols
to be defined within macros which do not produce "multi-defined
symbol" errors if the macro is called more than once in the same
module. Keep local symbol names as short as possible.
Format:
; RESULTING CODE:
PUBLIC Reg, R 100 ; PUBL Reg
; Reg EQU R 100
PUBLIC CBase, C 16 ; PUBL CBase
; CBase EQU C 16
PUBLIC Float, 1.2e6 ; PUBL Float
; Float EQU 1.2e6
PUBLIC Char, 'C' ; PUBL Char
; Char EQU 'C'
SASM - Page 43
The following example defines the old PCA instructions WIH and WIL
which are not included in the PCD's instruction set. If shows how
macro call can be nested. NOTE: These macros are not suitable for
true cyclic programs (because they may wait forever in a loop), and
are included as an example only.
;; WAIT IF HIGH
;; WAIT IF LOW
COB 0
0
WIH 0 ; WAIT IF INPUT 0 IS HIGH
...
WIL 256 ; WAIT IF TIMER 256 IS LOW
...
WIH 288 ; WAIT IF FLAG 288 IS HIGH
...
ECOB
SASM - Page 44
8. LISTING FORMATS
===================
For unsatisfied conditionals (an $IFxxxx which is not TRUE), the ADDR,
OPC M OPERAND and IP fields are left blank, statements within the
unsatisfied block are not processed. Statements between $SKIP..$ENDSKIP
directives do not appear in the listing.
8.1 Listing
------------
*** SAIA PCD MACRO ASSEMBLER V1.7 *** FILE: X.SRC ( 2.01.90 9.23 ) ASSEMBLED: 2.01.90 9.23 PAGE 1
<registered user name>
<title>
<subtitle>
Listing continued
-----------------
TOP LINE:
The top line of each page shows the Assembler version number,
the source file name and its creation date and time, the date
and time of assembly, and the page number. The date and time
are formatted according to the country, month first if US etc.
LINE field:
ADDR field:
IEM field:
Listing continued
-----------------
SOURCE field:
Error Messages:
The cross reference list and symbol table are merged into one list,
called the "cross reference list".
*** SAIA PCD MACRO ASSEMBLER V1.7 *** FILE: X.SRC ( 2.01.90 9.23 ) ASSEMBLED: 2.01.90 9.23 PAGE 1
<registered user name>
SYMBOL field:
SCOPE field:
TYPE field:
VALUE field:
For labels, the offset from the start of the labels code block
is shown.
Contains each source program file text line number where each
symbol is referenced or defined, in numerical order. The line
number where the symbol is defined is postfixed with a "#".
Note that more than one "#" may appear if "DEF" is used.
9. ERROR HANDLING
==================
A fatal error causes the assembly to be aborted, any open files are
closed. If the error is not a command line error (if it occurs after
assembly has started), the object file is deleted. This prevents the
linker from being able to create a .PCD file if the object file was
not properly created.
Fatal Error 11: Invalid include file name: <include file name>
Fatal Error 12: Can't open include file: <include file name>
Fatal Error 13: Include file nesting too deep: <include file name>
Fatal Error 19: Program too big for n/n Starter Package
Where:
For simplicity only the error numbers and texts are shown in the
following list of errors, and errors with self explanatory messages
are not accompanied by a detailed description.
The same formal macro parameter name has been used more
than once in a macro definition.
The same jump label has been defined more than once in the
same block. Labels cannot have the same name as a symbol.
Since jump labels are local to the block in which they are
defined, a label cannot be defined outside a block. Labels
can address the first line of a block, providing they are
on the same line as the first mnemonic, e.g. "LABEL: PB 0".
SASM - Page 54
The symbol has been defined more than once. Labels cannot
have the same name as a symbol.
The COB, XOB, PB, FB, SB, IST, ST or TR has already been
defined in this source module.
The end of block statement does not match the start of block
statement, e.g. COB..EXOB.
Each opening '<' must have a closing '>' in the text. '<'
and '>' characters must themselves be enclosed in angle
brackets to enter these into a text: <<> <>>.
For the STXM and SRXM instructions, the source and dest-
ination medium types must be compatible. For example, a
Register source cannot have a Flag destination.
In a MOV instruction, the data sizes of the 2nd and 4th
operands must be the same.
STXMI 0
R 10
I SourceReg ─┬─ These are Registers
F DestReg ─┘ e.g. SourceReg EQU R 10
└────────────── Data type *must* be present
9.3 Warnings
-------------
Warnings do not stop assembly and so do not affect the object file.
* Complete range checks are done on all operand values, all illegal
operands are detected.
* Checks are made for valid medium control codes, special codes
(MOV), condition codes, Graftec mc's, priority and channel
numbers. This includes typed symbols.
* Code blocks within code blocks. COB, XOB, PB, FB and SB definitions
cannot occur within another code block.
* Typed symbols occuring in an expression must all have the same type
(untyped symbols can be used anywhere).
* Multiple definitions of the same code block (COB, XOB, PB, FB, SB,
IST, ST) or TEXT within the same source module are not allowed.
SASM - Page 66
All other checks (FB parameter lists, multiple use of the DEFTC
instruction, existence of at least one COB etc.) are all done by the
linker.
SASM - Page 67
10.2 Performance
-----------------
A "hash table" method is used for symbol table management, this is one
of the fastest methods. With 2000 symbols in the table an average of
5 looks (usually at the first character only) is needed to find any
particular symbol. All reserved words (instruction mnemonics etc) are
also stored in this table.
No intermediate work files are used unless SASM is invoked with the
/TEMP switch, then temporary file SASMACRO.$$$ is created to hold
macro definitions.
For an 8MHz IBM AT with a hard disk, the assembly time is about 2000
lines a minute if a listing is generated, and about 5000 lines a
minute without the listing (a 20MHz 80386 machine is over 4 times
faster). The assembly times are also dependent on the source file's
content, the number of macro calls and different symbols used etc.
SASM - Page 68
10.3 Limitations
-----------------
* The maximum size of source file, include files and the number of
symbols is limited by the size of memory in the IBM PC. 512K is
enough to assemble a file of up to about 8000 lines. It is rare
(and not recommended) for a single source module to contain more
than about 2000 lines in total.
General
-------
+----------------------------------+
A | FILE NAME, DATE & TIME, REV CODE |
+----------------------------------+
B | HEADER |
+----------------------------------+
C | FLAGS BYTE |
+----------------------------------+
D | AUTO RECORDS | (optional, if $AUTO used)
+----------------------------------+
E | PCD TYPE SEGMENT | (optional, from $CPU,
+----------------------------------+ $STATION and $PCDVER)
F | PUBLIC SYMBOL SEGMENT |
+----------------------------------+
G | EXTERNAL SYMBOL SEGMENT |
+----------------------------------+
H | GLOBAL ELEMENT SEGMENT |
+----------------------------------+
I | LOCAL SYMBOL SEGMENT | (optional, see /SYM switch)
+----------------------------------+
J | CODE SEGMENT |
+----------------------------------+
K | TEXT SEGMENT |
+----------------------------------+
All 2-byte (word) and 4-byte (long) integers are stored in Intel
format, the least significant byte first. All values are unsigned
unless indicated as signed.
File Name
---------
"SOURCE.SRC"
One byte which can be used to indicate the version of the assembler
which created the file. The linker can use this for assembler/linker
compatibility checks.
SASM - Page 71
Header
------
Contains offsets to, and the lengths of each segment in the file.
Each is stored as a 4-byte integer. The offset is the byte offset
into the file (can be used by function "fseek()"), the length is
the total length in bytes of the segment, including the 2-byte
checksum.
LSB MSB
+--------+--------+---------+--------+
Byte: 0 | OFFSET TO PUBLIC SYMBOL SEGMENT |
+--------+--------+---------+--------+
4 | LENGTH OF PUBLIC SYMBOL SEGMENT |
+--------+--------+---------+--------+
8 | OFFSET TO EXTERNAL SYMBOL SEGMENT |
+--------+--------+---------+--------+
12 | LENGTH OF EXTERNAL SYMBOL SEGMENT |
+--------+--------+---------+--------+
16 | OFFSET TO GLOBAL ELEMENT SEGMENT |
+--------+--------+---------+--------+
20 | LENGTH OF GLOBAL ELEMENT SEGMENT |
+--------+--------+---------+--------+
24 | OFFSET TO CODE SEGMENT |
+--------+--------+---------+--------+
28 | LENGTH OF CODE SEGMENT |
+--------+--------+---------+--------+
32 | OFFSET TO TEXT SEGMENT |
+--------+--------+---------+--------+
36 | LENGTH OF TEXT SEGMENT |
+--------+--------+---------+--------+
40 | CHECKSUM |
+--------+--------+
The AUTO RECORDS segment and LOCAL SYMBOL SEGMENT do not have entries
in the header. This is so that files containing these records can
still be linked with the old version of the linker, but the features
provided by the new segments will not be available.
The start of the AUTO RECORDS segment is immediately after the FLAGS
byte, and it is fixed length.
The start of the LOCAL SYMBOL SEGMENT is determined from the GLOBAL
ELEMENT SEGMENT entry (start+length), and the size in bytes is
found by subtracting the OFFSET TO CODE SEGMENT from this value.
SASM - Page 72
Flags byte
----------
The "Start" value is from the type's $AUTO directive. The "Count"
value is the number of elements that were auto-allocated by the
program. If there was no $AUTO directive for the media type then the
"Start" address is 0xFFFF and "Count" is 0. If there was an auto
directive but no addresses were auto-allocated, the "Start" value
will be filled in, but the "Count" value will be 0.
SASM - Page 73
This contains the destination CPU and S-BUS station number defined
by the $CPU and $STATION directives, and a list of PCD types and
firmware versions from the $PCDVER directives.
+----------------+
00 | CPU NUMBER |
+----------------+
01 | STATION NUMBER |
+----------------+
02 | NO OF RECORDS |
+----------------+------------------+------------------+
03 | PCD TYPE | OFFICIAL VERSION | INTERNAL VERSION |
+----------------+------------------+------------------+
= =
+----------------+------------------+------------------+
| PCD TYPE | OFFICIAL VERSION | INTERNAL VERSION |
+----------------+------------------+------------------+
| CHECKSUM |
+----------------+
Contains an entry for each symbol declared PUBLic in the source module,
the last two bytes of the segment are the checksum. Each entry has the
the form:
+-----//------+----+------+-------+---+---+---+---+
| SYMBOL NAME | 00 | TYPE | FLAGS | VALUE |
+-----//------+----+------+-------+---+---+---+---+
Where:
+-----//------+----+
| SYMBOL NAME | 00 |
+-----//------+----+
Each COB, XOB, PB, FB, SB, IST, ST, TR, TEXT and DB definition and
reference has an entry in this segment. These elements are all
implicitly global, only one definition is allowed, and when linked
each reference must match a definition. The last two bytes of the
segment are the checksum.
Where:
Where:
Code segment
------------
Contains a variable length entry for each code line, the last 2 bytes
of the segment are the checksum.
Where:
OPTIONAL
|<------->|
+------+------+---+---+---+---+---+---+----+----+---+---+-//-+
| TYPE |FLAGS | NUMBER |LENGTH |EXTERNAL | DATA... |
| | | | |REFERENCE| |
+------+------+---+---+---+---+---+---+----+----+---+---+-//-+
Where:
00 00 end of text
00 01 insert a 00, e.g. 00 00 is stored as 00 01 00 01
00 02 introduces formatted external
Formatted external:
00 02 2-byte intro
dword value partial value (never floating point)
word extref external reference
string format "C" format string:
"%c" Single character: 0..255 or
1..255 for texts 0..3999
"t%[-0n.n]lu" Needs prefix from external
(t=lower case, T=upper)
"%[-0n.n]lu" No prefix
"R%[-0n.n]lu" External had a type (e.g. R or
r) which is already resolved,
SLINK checks that the external
has a compatible type
These special character pairs are in the OBJ file only, not in
the PCD's memory.
REVISION HISTORY
06-Jan-98 V2.1
21-Jun-96 V2.0
20-Jun-96 B2.0e
- $INIT LENGTH now in .MAP file.
15-Mar-96 $19G
- SWMR 817: MAP file now has $INIT segment start line for each
module.
- SWMR 591: I and O can now be separate types (was just single
I|O type). New symbol types in .OBJ file 14h and 15h, see
section 7.5 Public symbol segment.
- SWMR 680 and 815: New "PCD TYPE SEGMENT" in .PCD file, see
section 7.6.
30-Oct-95 $199
- AUTO statement for code blocks is now optional. If there's
no AUTO block for the statement, a default one covering the
entire range is used. If any blocks are defined with direct
addressing, these addresses are reserved and are not used
for auto-allocation.
30-Aug-95 $197
- Added collision detection for auto-allocation. Data defined
with an absolute value which falls within an AUTO segment
generates this error:
Error 69: Auto-allocation collision: <type> <adds>
- Auto-allocation now works for STs and TRs.
04-Aug-95 $194
- Added /SYM switch to append the symbol table to the end of
the .PCD file, see sections 2 and 7.5
- Added "Warning 4: Module <filename> has no local symbol table".
28-Jul-95 $193
- Added automatic resource allocation, via SASM's new AUTO
statement.
- Added error messages:
Error 67: Different AUTO declarations in file: <filename>
Error 68: Auto allocation overflow for type: <type>
04-Jul-95 $192
- Added DEFTR and SYSCMP instructions.
- Added "Error 66: DEFTR and DEFTB in same program".
24-Apr-95 V1.9
08-Jun-94 $185d
1) Handles new TFRI/STXMI/SRXMI instructions.
2) Add "Error 65: Register indirect, not a register".
3) STXM/SRXM now transfer the DB data (accept DB type).
4) STXM supports XOB execution format.
29-Apr-94 $184
1) Add "Fatal Error 10: Program too big for n/n Starter Package.
(old Error 10: Out of symbol space is now Error 0: Out of
memory).
2) Increased the max. number of object files which can be linked
to 75 (was 50).
$174
1) Add "Error 64: Operand must be zero".
28-Jul-93 $173
1) Add CASI, CRD and CWR instructions. Add "Error 63: Invalid
counter channel".
2) Handles new $NOXINIT and $ENDNOXINIT directives, setting
$NOXINIT flag (bit 5) in extension memory FLAGS byte.
09-Jun-93 V1.7
1) Handles code inside the $INIT..$ENDINIT directives and
places it in XOB 16 (4.1). $INIT segments are delimited in
the OBJect files by dummy instructions with an opcode of 0.
2) Supports "extension memory" (was called data memory), and
the new TFR instruction.
3) Supports new CPBI instruction.
4) $SASI text processing updated for new S-BUS definitions.
5) Evaluates symbol values containing the "$$" constant (offset
from start of code) (4.2).
6) On completion, SLINK now outputs the number of warnings as
well as the number of errors.
20-May-92
1) Add new indirect LAN text format.
2) Small change to format of data segment record.
06-Dec-91 $154
1) Handles new object file text/data segment format, and
resolves externals in texts and data blocks (SWMR 117).
(Still reads old OBJ file text segment).
2) Creates PCD file with new "data segment", for new
extension data memory. Data size now shown in MAP file.
3) Spare byte in PCD file header now used as "feature indicator
byte".
4) Better checks for SRXM and STXM instructions (SWMR 226).
5) Added errors 23 to 26.
22-Aug-91 $152
1) New /F /NF switches: Now invokes SFBREF.EXE to check FB
parameter references.
2) Added "Fatal Error 19: Can't execute SFBREF.EXE".
3) Add section 8 on SFBREF.EXE.
04-Oct-90 $139
1) Now handles TEXT, X and DB types.
2) Added "Error 62: Invalid data block number".
09-May-90 $133
1) If wildcard characters are used to describe object files to be
linked, the matching object file names are sorted. This ensures
that the files are always linked in the same order, regardless
of their position in the disk directory.
02-Mar-90 $131/$132
1) Now supports new data types COB, XOB, TEXT etc. Changed
Error messages 37 and 38 to read "data type" instead of
"medium type".
2) Add fatal error 18. Change fatal error message 1.
22-Nov-89 V1.3
1) Allow K constants as externals for LD, LDH, LDL (SWMR 17).
2) Give warning instead of error if FB parameters are not used
(SWMR 19).
3) Allows international character set in labels and symbols
(SWMR 32).
4) Now allows 10 character symbol names (SWMR 71).
5) Gives help if invoked with an incorrect command line from DOS.
6) Displays code and text sizes, and number of global symbols
after the link.
7) New switches /SV and /SN, global symbols in the MAP file can
now be sorted by value and type (/SV) or by name (/SN).
8) Now displays symbol values in the correct units (was always
decimal even for floating point values).
9) Allows "wildcard" filenames in object file list
eg. SLINK PCDFILE = *.OBJ (space after = needed)
SLINK PCDFILE = FRED.OBJ TOT?.OBJ
30-May-88 V1.0
19-mar-87 Preliminary.
SLINK - Page 1
CONTENTS
========
PAGE
1. OVERVIEW . . . . . . . . . . . . . . 2
3. ERROR HANDLING . . . . . . . . . . . . 6
3.1 Fatal Errors . . . . . . . . . . . 6
3.2 Warnings . . . . . . . . . . . . 10
3.3 Operand Errors . . . . . . . . . . 10
3.4 Multi-defined Publics . . . . . . . . 14
3.5 Unresolved Externals . . . . . . . . 14
3.6 Multi-defined Instructions . . . . . . 14
3.7 Multi-defined Elements . . . . . . . . 15
3.8 Undefined Elements . . . . . . . . . 15
3.9 Error Examples . . . . . . . . . . 16
4. PERFORMANCE . . . . . . . . . . . . . 17
4.1 $INIT segment and XOB 16 . . . . . . . 18
4.2 Processing $$ constants . . . . . . . 18
5. LIMITATIONS . . . . . . . . . . . . . 19
6. MAP FILE . . . . . . . . . . . . . . 20
1. OVERVIEW
============
The linker has two methods of invocation directly from DOS. The
linker can also be invoked from the PCD menus.
Where:
pcd_file = Is the optional absolute object file name for the
linked modules. The default is the name of the
first object file, the default file type is ".PCD".
If a pcd_file name is specified, the "=" symbol
MUST be present as a delimiter between the pcd_file
and the obj_file(s), otherwise this file name is
assumed to be an object file. One or more spaces
on one or either side of the "=" are allowed but
not necessary.
obj_file [ + obj_file...]
Is a list of one or more object files to be linked,
separated by "+", spaces, tabs or commas ",". The
default file type of these files is ".OBJ". All
file names can pe preceded by an optional drive
letter or path name, eg. A:\FRED\SOURCE. The DOS
wildcard characters "*" and "?" can be used to
specify a set of modules to be linked, eg. M1*,
MODULE? (these are linked in alphabetical order).
The maximum length of the first command line is 128 characters. The
command line can be extended onto another line by the use of a "+"
sign at the end of the line. In this case, a double prompt ">>" is
displayed on the next line, and further command lines can be entered.
While entering further command lines, the "Del" and "<-" (backspace)
keys can be used to edit the current line.
SLINK - Page 4
The following examples show the command lines, and the texts displayed
by the linker. The linker displays a list of the files being linked
"Linking: ....", and the files being created "To: ....".
C:\>SLINK MOTOR=MODULE1+MODULE2+MODULE3+MODULE4+MODULE5+MODULE6 +
>>MODULE7+MODULE8,MODULE9,MODULE10,MODULE11,MODULE12 +
>>/nf
C:\>_
C:\>SLINK MOTOR=+
>>MODULE1 MODULE2 MODULE3 MODULE4 MODULE5 MODULE6 MODULE7 +
>>MODULE8 MODULE9 MODULE10 MODULE11/NF
C:\>_
C:\>_
3. ERROR HANDLING
==================
Errors are separated into the categories below, and, except for fatal
errors and warnings, are displayed in groups under the separate titles,
see sections 3.3 to 3.8.
Fatal errors, warnings and operand errors are each displayed when they
are discovered. Undefined, unresolved and multi-defined errors are
stored until all the object and library files have been processed, and
are displayed before the "Linkage complete" sign-off message.
If SLINK is invoked from DOS, disk read and write errors will be
preceded by the standard DOS disk error prompt, for example:
If a fatal error occurs during the link (after the command line has
been processed), the absolute object file is deleted from the disk.
If the fatal error is due to an invalid command line or command file,
the absolute object file is not deleted. The map file is unaffected.
SLINK - Page 7
There are three types of fatal error. Type (1) is the usual fatal
error, type (2) indicates a software malfunction, type (3) indicates
an invalid object file (which may be caused by an internal assembler
problem).
(2) Fatal Internal Error: <file> Psn: <offset> (<rel>) Ref: <reference>
Where:
If ANY type (2) or (3) fatal error occurs, notify Matt Harvey, SAIA,
MURTEN immediately, supplying the source and object files and the
revision numbers of the assembler and linker.
Fatal Error 10: Program too big for n/n Starter Package
3.2 Warnings
-------------
Where:
The following operand errors can occur, for simplicity the file,
address offset and external symbol name are not shown:
The Function Block parameter number <n> does not match the
parameter expected by the Function Block definition.
The external has been given a type (I, O, F etc) and can't
be used in this context.
These errors occur if the same public symbol (declared PUBL) occurs in
more than one object file.
Where:
Where:
Where:
Each COB, XOB, PB, FB, SB, IST, ST, TR, TEXT or DB (Data Block) is
a "global element" and can be defined only once in a program. For
example, there can be only one COB 0 in a program. Multi-defined
element errors occur if there is more than one definition of the
same global element.
Where:
At present, Data Blocks and Texts share the same numbering. For
example, if Data Block 10 exists, then Text 10 cannot be defined,
and vice versa. This will cause a Multi-defined Text or a multi-
defined Data Block error according to which type was processed first.
No COB present
Each COB, XOB, PB, FB, SB, IST, ST, TR, TEXT or DB reference must have
an associated definition, undefined element errors occur if it doesn't.
For example, if "CFB 1" (call Function Block 1) appears in the program,
then "FB 1 ... EFB" (Function Block 1 definition) must also be
present.
Where:
Operand Errors:
Error 35: OPA2.OBJ (749): External R4094: Invalid register number
Error 20: OPA2.OBJ (800): Invalid FB parameter: CFB 2: Parameter 4
Warning 2: OPA2.OBJ (811): Parameter not referenced: CFB 3: Parameter 5
Error 57: OPA3.OBJ (45): External TEXT1000: Invalid text number
Multi-defined Publics:
Q45 in modules OPA1.OBJ
Q46 in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
Unresolved Externals:
X99 in modules OPA1.OBJ OPA2.OBJ
X8160 in modules OPA2.OBJ
U8191 in modules OPA2.OBJ
FIVE in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
Multi-defined Instructions:
DEFVM in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
DEFTC in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
DEFTB in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
Multi-defined Elements:
COB 0 in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
COB 1 in modules OPA1.OBJ OPA2.OBJ OPA3.OBJ
TEXT 0 in modules OPA1.OBJ OPA3.OBJ
TEXT 999 in modules OPA1.OBJ OPA3.OBJ
PB 0 in modules OPA1.OBJ OPA3.OBJ
PB 299 in modules OPA1.OBJ OPA3.OBJ
COB 5 in modules OPA1.OBJ OPA3.OBJ
SB 0 in modules OPA1.OBJ OPA3.OBJ
FB 0 in modules OPA1.OBJ OPA3.OBJ
Undefined Elements:
FB 4 in modules OPA2.OBJ
PB 3 in modules OPA1.OBJ OPA2.OBJ
4. PERFORMANCE
===============
1) Sign on.
2) Process command line or command file, display which files are
being linked and which are being created.
3) For each object file:
Read object file header and store it.
Read public symbols and add them to master public symbol
table in memory. Detect multi-defined publics.
4) For each object file:
Read external segment and find associated public symbol
in master public symbol table, detect undefined externals.
Read global element segment and create master global
element table, resolving external references. Detect
multi-defined global elements.
5) For each object file:
Read the code segment and serach for $INIT segments.
If found, process the code and resolve any external
references and write the output to file $INIT.$$$.
6) Open absolute object file, write blank header to it.
7) For each object file:
Read external segment and find associated public symbol
in master public symbol table.
Read code segment and write it to output file, resolving
external references. Detect operand errors.
If the end of XOB 16 is found (EXOB), append the init
segment file $INIT.$$$ to XOB 16 before wrting EXOB, and
delete $INIT.$$$.
8) For each object file:
Read external segment and find associated public symbol
in master public symbol table.
Read text segment and write it to output file, resolving
external references. Detect text number operand errors.
9) If an extension memory segment was present, append the
extension memory segment file to the end of the .PCD file
and delete the temporary file.
SLINK - Page 18
The start of each module's $INIT segment is listed in the .MAP file.
$$ is the offset from the start of the code segment (always 0), and
can only be resolved at link time, when the start address of each
module is known.
5. LIMITATIONS
===============
- The maximum number of object and library files which can be linked
is 75.
6. MAP FILE
============
The map file is produced if switch "/M" is specified. The map file
name is always the name of the absolute object file with type ".MAP".
*** SAIA PCD LINKER V1.9 *** FILE: INIT.PCD LINKED: 23.11.89 13.23 PAGE
1
WIZZKIDS INTERNATIONAL CORPORATION INCORPORATED (UK) PLC
GLOBAL SYMBOLS: 0
*** SAIA PCD LINKER V1.9 *** FILE: INIT.PCD LINKED: 23.11.89 13.23 PAGE 2
WIZZKIDS INTERNATIONAL CORPORATION INCORPORATED (UK) PLC
This describes the format of the PCD file created by the linker, and
the .UPL file created by the loader when existing code and text is
uploaded. The file is a byte-by-byte image of the header, code and
text of one CPU within the PCD, in the same order as it is uploaded
or downloaded across the serial interface to the PCD.
The same file format is used by all PCD types, since it will be
possible to download a PCD6 program to a PCD4 etc. There is a similar
header in all PCD types.
+----------------------------------+
| HEADER (40 bytes) |
+----------------------------------+
| CODE SEGMENT |
+----------------------------------+
| TEXT SEGMENT |
+----------------------------------+
| EXTENSION MEMORY SEGMENT |
+----------------------------------+
| SYMBOL TABLE |
+----------------------------------+
| PCD TYPE SEGMENT |
+----------------------------------+
The .UPL file, uploaded by the Loader, contains *all* the information
read from the CPU's header.
UPL files never contain a Symbol Table, because this data is not
stored in the PCD.
SLINK - Page 23
7.1 CPU Header
---------------
0 1 2 3 4 5 6 7
+-----+-----+-----+-----+-----+-----+-----+-----+
Program Name | |
8 characters, padded +-----+-----+-----+-----+-----+-----+-----+-----+
with NULs or spaces
8 9 10 11
+-----+-----+-----+-----+
Code Start (line) | MSB LSB | 0 = created by linker
+-----+-----+-----+-----+ >0 = CPU's code start
if uploaded
12 13 14 15
+-----+-----+-----+-----+
Code Length (lines) | MSB LSB | Size of file's code
+-----+-----+-----+-----+ in 32-bit lines
16 17 18 19
+-----+-----+-----+-----+
Code Freespace (lines) | MSB LSB | 0 = created by linker
+-----+-----+-----+-----+ >0 = CPU's code segment
size if uploaded
20 21 22 23
+-----+-----+-----+-----+
Text Start (line) | MSB LSB | 0 = created by linker
+-----+-----+-----+-----+ >0 = CPU's text start
if uploaded
24 25 26 27
+-----+-----+-----+-----+
Text Length (bytes) | MSB LSB | Size of file's text
+-----+-----+-----+-----+ in bytes
28 29 30 31
+-----+-----+-----+-----+
Text Freespace (bytes) | MSB LSB | 0 = created by linker
+-----+-----+-----+-----+ >0 = CPU's text segment
size if uploaded
32 33
+-----+-----+ 0000 = created by linker
Header Initialised * | | 5AA5H = uploaded from RAM
Word +-----+-----+ A55AH = uploaded from EPROM
34
Modification +-----+ 0 = created by linker
Indicator Byte * | | >0 = modified then uploaded,
+-----+ number of times modified
FFH = unprogrammed EPROM
35 00H = no features
+-----+ FFH = no features (from EPROM)
Feature Indicator * | | Bit 7=0: Bits 6..0=feature
Byte +-----+ indicator flags
36 37 38 39
* +-----+-----+-----+-----+
Code, text and header | MSB LSB |
checksum +-----+-----+-----+-----+
Program Name
------------
8-character ASCII filename, left justified. Eg. If the filename is not
8 characters long, the remaining characters are always spaces (20H).
This name is filled in by the linker, or by the uploader in a .UPL
file if an un-named program is uploaded.
Code Start
----------
The user program line number for the start of the code. Set to 000
by the linker, so is always 0 in a .PCD file. In a .UPL file it
contains the uploaded header value.
Code Length
-----------
The length of the code in user program lines, filled in by the linker.
Code Freespace
--------------
The code memory space remaining for use by this CPU, in user program
lines. Set to 00000000 by the linker, so is always 0 in a .PCD file.
In a UPL file it contains the uploaded header value.
NOTE:
Code space in K lines available for CPUs 1-6 (Memory Map entry) is:
The actual code space available for CPU 0 is 100 lines less than that
indicated, since the first line available for code is 100. Therefore,
for CPU 0 the code space in K lines is as follows, and code_length +
code freespace will not be an exact multiple of 1024.
Text Start
----------
The start user program line number for the Texts. Set to 00000000 by
the linker, so is always 0 in a .PCD file. In a .UPL file it contains
the uploaded header value.
Text Length
-----------
The total length of the text numbers, text characters and text NUL
terminators, in bytes, EXCLUDING the text padding characters. Filled
in by the linker.
SLINK - Page 25
Text Freespace
--------------
The memory space remaining for texts for this CPU, in BYTES. Set to
00000000 by the linker, so is always 0 in a .PCD file. In a .UPL file
it contains the uploaded header value.
NOTE:
Checksum
--------
Calculated in the same way as it is done in the PCD, it's used in
the PCD during power up tests or by the TEST instruction. It is
created by the linker in a .PCD file, and by the loader in the
header in the PCD. The checksum is generated as follows:
This means that given the file checksum, the code/text checksum can
be determined if the header checksum is calculated, without having
to read the code/text segment. The header can be updated, the new
header checksum calculated, and the new file checksum can be calc-
ulated from these values BEFORE the code/text segment is read.
40 41 42 43
+-----+-----+-----+-----+
Code Line 0 | MSB LSB | MSB LSB |
+-----+-----+-----+-----+
. OPCODE OPERAND .
. .
. .
. .
+-----+-----+-----+-----+
Line n | MSB LSB | MSB LSB |
+-----+-----+-----+-----+
OPCODE OPERAND
Padding characters:
Extra NUL bytes are added to the end of the last text (if text is
present) to pad the text length to a modulo 4 number. These padding
bytes are also stored in the PCD memory, and are present to allow the
correct generation of the double word checksum.
Format:
+----+---//----+----+
| Fx | Message | 00 |
+----+---//----+----+
| | |
| | +------- NUL terminator
| +--------------- Encoded message and checksum
+---------------------- FDH = Encoded indirect LAN text
FEH = Encoded absolute LAN text
(FFH = Data block, see 7.3.2)
Since the binary text can contain 00 bytes (NUL, assumed end of text
by CPU), each byte is encoded from one into two bytes which can be
ANDed together to produce the original byte:
+---+
| 0 | Partner number 00..FFh
+---+
| 1 | 80h = Range (eg. F32-63), 00h = single or list (eg. F0,1)
+---+
| 2 | Number of addresses - 1 (0 = one address)
+---+
| 3 | Source data type I O F T C R P X
+---+ 0 1 2 3 4 5 6 7
| 4 | -+
+ + |
| 5 | +- First physical source address, MS byte first
+ + | (68000 memory address)
| 6 | -+
+---+
= =
+---+
| | -+
+ + |
| | +- Last physical source address, MS byte first
+ + | (68000 memory address)
| | -+
+---+
| | Destination data type O F T C R P X
+---+ 1 2 3 4 5 6 7
| | -+
+ + |
| | +- First physical destination address, MS byte first
+ + | (68000 memory address)
| | -+
+---+
= =
+---+
| | -+
+ + |
| | +- Last physical destination address, MS byte first
+ + | (68000 memory address)
| | -+
+---+
| | Checksum 0..255 (sum of all bytes before encoding,
+---+ mod. 256)
SLINK - Page 30
+---+
| 0 | Partner number: 0..255 = absolute station number
+ + 8000H-BFFCH = indirect register address
| 1 |
+---+
| 2 | Number of addresses - 1 (0 = one address)
+---+
| 3 | Source data type: I O F T C R + 80H if 1st adds indirect
+---+ 0 1 2 3 4 5 + 40H if 2nd adds indirect
| 4 | 1st source address + C0H if both indirect
+ + MS byte first (68000 memory address)
| 5 |
+---+
| 6 | 2nd source address
+ + MS byte first (68000 memory address)
| 7 |
+---+
| 8 | Destination data type: O F T C R + 80H if address indirect
+---+ 0 1 2 3 4
| 9 | Destination address
+ + MS byte first (68000 address)
| 10|
+---+
SLINK - Page 31
Format:
+----+-----//-----+----+
| FF | Data items | 00 |
+----+-----//-----+----+
| | |
| | +---- NUL terminator
| +------------- Encoded Register values
+---------------------- FF = Data Block
Values are stored MS byte first. The 4-byte Register value 00000000
Hex is stored as an 8-byte value:
0F F0 0F F0 0F F0 0F F0
1F F2 3F F4 AF FB CF FD
SLINK - Page 32
NOTE: All values in this segment of the file are in INTEL format
(LS byte first). They are converted to MOTOROLA format (MS
byte first) before loading into the PCD.
+---+---+---+---+---+---+---+---+-----//------+---+---+---+---+
| LENGTH | EXTN SIZE | DATA... | CHECKSUM |
+---+---+---+---+---+---+---+---+-----//------+---+---+---+---+
| | | |
| | | 32-bit checksum on
| | | DATA section only.
| | |
| | +----- Data records, see
| | below.
| +------------------- No. of bytes of
| extension memory used.
+----------------------------------- Length of file's EXTN
segment in BYTES
(should be mod. 4),
excludes "EXTN SIZE"
and "CHECKSUM".
Extension memory segment record
-------------------------------
0 1 2 3 4 5 6 7 8 ...
+----+----+----+----+----+----+----+----+----+-//-+----+
| NUMBER |TYPE|FLGS| LENGTH | INITLEN | DATA ... |
+----+----+----+----+----+----+----+----+----+-//-+----+
| | | | | |
| | | | | Initialization data,
| | | | | Always mod. 4 bytes long,
| | | | | texts may be padded with
| | | | | NULs. Init data may not
| | | | | be present, in which case
| | | | | the TEXT is all spaces,
| | | | | or a DB is all 0's.
| | | | +---- Length of initialization
| | | | data in long words for
| | | | DB, or bytes for text
| | | +-------------- LENGTH in long words for
| | | DB, or bytes for TEXT.
| | +---------------------- SASM flags:
| | 1xxxxxxxx = $SASI text
| | x1xxxxxxx = $LAN text
| | xx1xxxxxx = $NOXINIT
| +--------------------------- TYPE: 08 = text (8-bit)
| 32 = DB (32-bit).
+---------------------------------- TEXT/DB NUMBER: 4000..7999
SLINK - Page 33
Each record starts on a long word boundary (mod. 4). Texts are
padded with NULs if necessary. This makes access by the 68000
faster, and allows the "read/write user memory" telegrams to
be used, which read/write 4-byte values on modulo 4 addresses.
Handling for texts and DBs 0..3999 is unchanged, these are still
stored in the existing text segment. At present, the new format
affects only texts and DBs 4000..7999.
ExtnLength + 12
+--------------------------------+
| SYMBOL TABLE HEADER |
+--------------------------------+
| MODULE LIST |
+--------------------------------+
| AUTO ALLOCATION SEGMENT |
+--------------------------------+
| PUBLIC SYMBOL SEGMENT |
+--------------------------------+
| LOCAL SYMBOL SEGMENT, MODULE 1 |
+--------------------------------+
= =
+--------------------------------+
| LOCAL SYMBOL SEGMENT, MODULE n |
+--------------------------------+
The SYMBOL TABLE HEADER defines the sizes and offsets to each
segment.
The MODULE LIST contains data about each module that was linked
to create the .PCD file, its filename, assembly date/time etc.
The PUBLIC SYMBOL TABLE lists all the global symbols, and their
types and values. This may not be present if globals have not
been used.
The LOCAL SYMBOL SEGMENTs contain the local symbols which were
EQUuated in the source modules. The number of segments depends
upon the number of modules linked, and whether they had any
local symbols defined.
+--------------------------------------------------------+
0 | Offset to Module List 4 bytes |
+--------------------------------------------------------+
4 | No. of modules linked (records in Module List) '' |
+--------------------------------------------------------+
8 | Offset to Auto Allocation Segment (0 if none) '' |
+--------------------------------------------------------+
12 | Offset to Public Symbol Segment (0 if none) '' |
+--------------------------------------------------------+
16 | No. of Public Symbols (recs in Public Symbol Seg.) '' |
+---------------------------+----------------------------+
18 | FLAGS, see below 2 bytes |
+---------------------------+
20 | Checksum 2 bytes |
+---------------------------+
FLAGS byte:
Module List
-----------
Each module linked contains a fixed length record of 64 bytes. The
number of module list records depends upon the number of modules
linked.
+--------------------------------------------------------+
0 | Module name 14 bytes, NUL terminated string |
+--------------------------------------------------------+
14 | Assembly date/time 18 bytes, NUL terminated string |
+--------------------------------------------------------+
32 | Code start line 4 bytes |
+--------------------------------------------------------+
36 | Code size in lines '' |
+--------------------------------------------------------+
40 | Text size in bytes '' |
+--------------------------------------------------------+
44 | Extension memory segment size in bytes '' |
+--------------------------------------------------------+
48 | Extension memory init segment size in bytes '' |
+--------------------------------------------------------+
52 | Offset to Local Symbol Segment (0 if none) '' |
+--------------------------------------------------------+
56 | No. of local symbols (recs in Local Symbol Seg.) '' |
+---------------------------+----------------------------+
60 | FLAGS, see below 2 bytes |
+---------------------------+
62 | Checksum 2 bytes |
+---------------------------+
FLAGS byte:
The "Type" byte holds the data type value, which is also the record
number (record offset). The type number can be used a direct offset
into the segment for speed of access, hence the unused records in
the segment (these are for types which cannot be auto-allocated).
The "Start" value is from the type's AUTO declaration. The "End"
value is the last element in the AUTO declaration. "Used" is the
number of elements that were actually auto-allocated by the program.
If there was no AUTO statement for the media type then the "Start"
and "End" addresses are 0xFFFF and "Used" is 0. If there was an
auto statement but no addresses were auto-allocated, the "Start"
and "End" values will be filled in, but "Used" will be 0.
Format:
+------//-----+----+--------+------+-------+---+---+---+---+
| SYMBOL NAME | 00 | MODULE | TYPE | FLAGS | VALUE |
+------//-----+----+--------+------+-------+---+---+---+---+
Where:
+------//-----+----+------+-------+---+---+---+---+
| SYMBOL NAME | 00 | TYPE | FLAGS | VALUE |
+------//-----+----+------+-------+---+---+---+---+
+----------------+
00 | CPU NUMBER | 0..6
+----------------+
01 | STATION NUMBER | 0..254
+----------------+
02 | NO OF RECORDS |
+----------------+------------------+------------------+
03 | PCD TYPE | OFFICIAL VERSION | INTERNAL VERSION |
+----------------+------------------+------------------+
= =
+----------------+------------------+------------------+
| PCD TYPE | OFFICIAL VERSION | INTERNAL VERSION |
+----------------+------------------+------------------+
| CHECKSUM |
+----------------+
Warning 1: Adds <n>: Parameter not referenced: CFB <n> Param <n>
These are listed to the display and also at the start of the FB
Parameter Reference List. They do not cause SFBREF to abort, but
are all fatal programming errors. Executing a program containing
errors in the PCD will produce unexpected results.
All these errors, except Error 30, are also detected by the Assembler
(SASM) and the Linker (SLINK). They can, however, be introduced by
editing the program in PCD memory, then uploading it.
"Adds <n>" is the absolute address (program line number) where the
error occurred.
Error 28: Adds <n>: Missing parameters: CFB <n> from Param <n>
Error 30: Adds <n>: Bad parameter: CFB <n> Param <p> (val): <adr>
<mnemo>
Due to the nature of certain PCD instructions there are some rare
programming errors which cannot be detected. These occur only with
instructions where the maximum value (or type) of the third or fourth
operand is dependent on the value (or type) of the first or second
operands. SFBREF doesn't check these dependency errors.
NOTE: SFBREF does not know what value will be in the Index Register
at run time, and so CANNOT detect indexing errors on FB parameters.
REVISION HISTORY
5-Jan-98 Rev.28, V2.1
1) "Display cpu-Status" now shows production information, if
present in the PCD.
18-Nov-96 $202
1) Correct modem name (Display s-bUs) if it contains foreign chars.
2) Add ERROR 93: GREATER THAN/LESS THAN, NOT ALLOWED FOR FLOATING
POINT
VALUE (SWER 867).
3) "File Compare" now works correctly if PCD is password protected.
It always failed the compare test when password protection, even if
the password had been entered and the programs were the same.
21-Jun-96 V2.0
18-Mar-96 $19G
1) SWMR 680 and 815: Added $CPU, $STATION, $PCDVER assembler
directive handling. The CPU number, S-BUS station number and PCD
firmware versions are now checked by the "File Load" command.
Added section 4.3 Warnings.
07-Mar-96 $19F
1) SWMR 818: Added "Write nonVolatile-register" and "Display
nonVolatile-register" commands. These only work on the PCD1.
See section ?. Also added errors 90 and 91.
2) SWMR 809: The DEFTR is not allowed in the "Instruction" command.
05-Mar-96 $19E
1) Add ERROR 89: FAILED TO CONNECT TO CPU n.
20-Feb-96 $19D
1) SWMR 803: Added "File set-load-Options" command, for setting the
"Clear all outputs" and "Run all CPUs on completion" options for
the "File Load" command. See section 3.8.
2) Added ERROR 87 and 88.
3) New prompt at start of "File Load" operation:
WARNING: This will reset all cpus!! Continue (Y or N) ?
16-Oct-95 $198
1) Automatic connection to PGU port using "PGU MODE".
2) Modifications for PCD1.
24-Apr-95 V1.9
----------------
1) For "Write passWord" there is no way to disable the inactivity
timeout, a timeout of 0 is invalid.
2) Updated the "Halt and history messages" decsription, section 4.3.
17-Mar-95 $18B
----------------
1) SWMR 596: When downloading a single block, and a "block not
defined" error occurs:
If in run, it's a fatal error, else prompt "ABORT, CONTINUE,
IGNORE (A, C or I) ?". Ignore (I) disables all further warnings.
2) SWMR ?: A "Restart warm" instead of a "Restart cold" is now done
when downloading a new program with the "File Load" command, if
the latest firmware is used, see 3.8. This prevents the outputs
being cleared at the start of a download.
3) SWMR 611B: "Display cpu-Status" now shows CPU, LAN and P800
firmware versions.
4) SWMR 658: Added "File Get-pcdsetup" command, see 3.8.
REVISION HISTORY Continued
06-Feb-95 $18A
----------------
1) Added password mechanism and "Write passWord" command, 3.6.11.
2) Added error messages 84, 85, 86.
3) SWER 709: STs and TRs cannot be downloaded while the CPU is
running, and a restart cold must now be done after downloading
an ST or TR. This is because the PCD's internal tables cannot be
updated for the new ST or TR address if the ST or TR is active.
Changed error 72 text.
4) "Write s-bUs station" command now documented, 3.6.10.
5) "Display s-bUs" also shows the gateway configuration.
18-Aug-94 $188
----------------
1) "Display s-Bus" now displays PCD modem control strings (3.5.14).
05-Jul-94 $186
----------------
1) Add S-BUS "broAdcast" command, section 3.16.
2) Add S-BUS "Run Xob" command, section 3.2.
3) Add ERROR 83: CPU NOT IN RUN.
4) "Refresh" option added to "Display data-Block".
5) Arithemtic flags, index register and block number now shown
beside the instruction when in stop or conditional stop.
NOTE: These are the values BEFORE the instruction is executed.
The instruction is marked with a "*" to indicate that is has
not been executed yet. In "Trace", these are the values AFTER
the instruction has been executed.
09-Jun-93 V1.7
----------------
1) Command stack increased to 20 (was 10).
2) Extension memory support:
- "File Load <filename> Extension-memory" command (3.8).
- "Display Memory-map" now shows extension memory segment
(3.5.9).
- Texts and Data Blocks 4000..7999 are now supported if
extension memory is present (4000..5999 in the PCD2).
3) "Trace" now shows which block is executing (3.3), so does
"Display Accu" (3.5.1).
4) New "Display Exec-path" command, which shows the block call
nesting (3.5.13).
REVISION HISTORY Continued
5) S-BUS support:
- Built-in S-BUS and modem communications.
- New "Display s-bUs" command displays the current S-BUS
PGU port configuration (3.5.14).
- New "cOnnect" command (replaces the "cpU" command).
"cOnnect Cpu", "cOnnect Station" and "cOnnect Analyse-
sbus-network" commands (3.15).
- The connected S-BUS station is shown on the title line
(2.1).
6) New "Clear Memory" (clears all user memory), "Clear Extension-
memory", "Clear Data-block" (sets all values in a DB to 0),
and "Clear Program-memory" commands (3.12).
7) "Write clocK" now accepts the week-of-year and day-of-week,
if required (3.6.6). SBUG calculates these as before if not
supplied.
8) "File Load <filename> Cob/Xob/Pb/Fb/sB/St/Tr <number>" now
examines the block before loading it, and issues an error
message if the block contains references to undefined blocks,
and the block load can be aborted (3.8).
9) New error messages 66 to 82 (4.1).
10) New "Run To" destinations: Cob/Xob/Pb/Fb/St/Tr/End-of-block
(3.2).
11) "Display Program" now accepts block numbers, e.g. "Display
Pb 32" (3.5.4).
12) "Display clocK" format improved (3.5.6).
13) Support for the new PCD2 and PCD6.M5 systems.
14) Refresh window "deLete" command (Ctrl+L) deletes the last line
in the refresh window.
Comments can now be entered in the refresh window by preceding
them with two semi-colons on the command line, e.g. "; ;comment".
15) The "File View" command can now display any sized file, and
allows scrolling left and right.
16) Command syntax diagrams updated (5.).
06-Dec-91 $154
----------------
1) "Display bYte" and "Write bYte" removed from command menu, but
still function (SWMR 230).
2) Added "File Load <filename> sB <number>", individual SBs can now
be downloaded.
3) New "ERROR 72: CPU MUST BE IN STOP OR HALT TO DOWNLOAD NEW SB".
4) "Display Memory-map" now shows the S-BUS station number, if
configured.
09-Oct-91 $153
----------------
1) Last program line number now 262143 (was 65535).
2) "Display Memory-map" now accepts code and text segments up to
999K lines or characters.
3) New "Trace forEver" command.
4) Changed "Status" to "Status-flag" for clarity,
e.g. "Write Status-flag ...", "Run Until Status-flag ...".
REVISION HISTORY Continued
07-Sep-91 $152
----------------
1) New "Write data-Block" command section 3.6.8 (SWMR 197).
2) Values displayed in hex now have "H" postfix.
3) New errors 69, 10 and 71.
4) Add "Batch Run ... forEver" command.
03-Dec-90 V1.4
----------------
1) Now uses the pop-up directory window for the "File Directory"
command, and for "File View" and "File Load" commands with no
filename or a filename with wildcard characters (SWMR 132).
27-Oct-90 $139
----------------
1) Added "Display data-Block" command, section 3.5.11.
2) The "Locate" command can now find Data Block references.
3) Data Blocks can be loaded from a PCD/UPL file. Added "File Load
<filename> data-Block <number>" command.
4) Changed "Accumulator" to "Accu", more space on the prompt line.
5) Changed "Byte" to "bYte", now uses 'Y' key. 'B' key is used
by "data-Block".
6) "Write bYte" command described and improved, section 3.6.8.
Now accepts data on the command line, and can be run from a
batch. "Display bYte" now allows "Refresh" option.
7) "Display History" format changed, now shows user addresses if
possible, and locations 12..15 count the occurrences of certain
errors, see section 3.5.10.
8) Now displays binary LAN texts (from assembler's $LAN..$ENDLAN)
in Ascii. Binary LAN texts cannot be edited.
9) "Display Register ... Ascii" now displays control codes and
non-ASCII characters with codes greater than 127 as IBM graphics
characters (e.g. │ ┐ ░ ä).
10) Added error messages 62, 63, 64, 65 and 149.
11) The DIGI and DIGO instructions now support Bcd values up to
2147483647 (was max. 1999999999).
12) Some Halt & History messages changed, see section 4.3.
13) For "Write O|F ... Manual", the display is not scrolled when
the next/previous address is selected, see 3.6.2.
14) Added description of "Display bYte" command, section 3.5.12.
15) For "File View <filename>", default extension is now ".SRC".
21-Jun-90 $134
----------------
1) "cpU" command added (see 3.15).
2) Added error messages 60 and 61.
3) "Display Program ... Refresh" now works when CPU is in Run.
CONTENTS
========
Page
1. OVERVIEW . . . . . . . . . . . . . . . . . 3
1.1 Connection to CPU . . . . . . . . . . . . 3
1.2 Invocation from DOS . . . . . . . . . . . 4
1.3 Data Types, Ranges and Scope . . . . . . 5
2. THE SCREEN . . . . . . . . . . . . . . . . 7
2.1 Title/Status Line . . . . . . . . . . . . 7
2.2 Main Display Window . . . . . . . . . . . 8
2.3 Refresh Window . . . . . . . . . . . . . 9
2.4 Prompt Line . . . . . . . . . . . . . . . 10
2.5 Command Line . . . . . . . . . . . . . . 10
2.6 Keyboard and Function Keys . . . . . . . 11
3. COMMANDS . . . . . . . . . . . . . . . . . 12
3.1 Entering Commands . . . . . . . . . . . . 12
3.1.1 Command Summary . . . . . . . . . . . . 14
3.2 Run . . . . . . . . . . . . . . . . . . . 15
3.3 Trace . . . . . . . . . . . . . . . . . . 17
3.3.1 Accumulator and Arithmetic Status . . . 19
3.4 Stop . . . . . . . . . . . . . . . . . . 19
3.5 Display Commands . . . . . . . . . . . . 20
3.5.1 Display Accu . . . . . . . . . . . . . . 21
3.5.2 Display Inputs, Outputs and Flags . . . 21
3.5.3 Display Registers, Timers and Counters . 23
3.5.4 Display Program . . . . . . . . . . . . 24
3.5.5 Display Text . . . . . . . . . . . . . . 26
3.5.6 Display Clock . . . . . . . . . . . . . 26
3.5.7 Display Index and Display-register . . . 27
3.5.8 Display CPU Status . . . . . . . . . . . 27
3.5.9 Display Memory-map . . . . . . . . . . . 28
3.5.10 Display History . . . . . . . . . . . . 29
3.5.11 Display Data-block . . . . . . . . . . . 30
3.5.12 Display Byte . . . . . . . . . . . . . . 31
3.5.13 Display Exec-path . . . . . . . . . . . 31
3.5.14 Display s-bUs . . . . . . . . . . . . . 32
3.6 Write Commands . . . . . . . . . . . . . 33
3.6.1 Write Accu and Write Status . . . . . . 33
3.6.2 Write Output and Write Flag . . . . . . 33
3.6.3 Write Register, Timer and Counter . . . 36
3.6.4 Write Program . . . . . . . . . . . . . 37
3.6.5 Write Text . . . . . . . . . . . . . . . 39
3.6.6 Write Clock . . . . . . . . . . . . . . 41
3.6.7 Write Index-register . . . . . . . . . . 41
3.6.8 Write Data-block . . . . . . . . . . . . 42
3.6.9 Write Byte . . . . . . . . . . . . . . . 44
3.6.10 Write s-bUs station . . . . . . . . . . 45
3.6.11 Write passWord . . . . . . . . . . . . . 46
SBUG - Page 2
3.7 Batch . . . . . . . . . . . . . . . . . . 47
3.8 File . . . . . . . . . . . . . . . . . . 50
3.9 Instruction . . . . . . . . . . . . . . . 55
3.10 Locate . . . . . . . . . . . . . . . . . 56
3.11 Restart . . . . . . . . . . . . . . . . . 57
3.12 Clear . . . . . . . . . . . . . . . . . . 58
3.13 Print . . . . . . . . . . . . . . . . . . 59
3.14 Help . . . . . . . . . . . . . . . . . . 60
3.15 Connect . . . . . . . . . . . . . . . . . 61
3.16 Broadcast . . . . . . . . . . . . . . . . 61
3.17 Quit . . . . . . . . . . . . . . . . . . 62
4. ERROR REPORTING . . . . . . . . . . . . . 63
4.1 Miscellaneous Errors . . . . . . . . . . 63
4.2 Assembler and Disassembler Errors . . . . 73
4.3 Warnings . . . . . . . . . . . . . . . . 77
4.4 Halt and History Messages . . . . . . . . 79
1. OVERVIEW
============
There are two communications modes which can be used for connecting
the Personal Computer to the PCD. PGU mode is for direct RS-232
connection to the PCD's PGU port, or via a PCD8.P800 on a PCD6.
S-BUS mode is for connection to an S-BUS network using RS-485 or
via a modem using RS-232. The mode is selected from the main menu's
"coNnect" screen, or by the "SCONNECT" program run from the DOS
prompt.
To use S-BUS mode, configure the PCD's S-BUS PGU port from the
"Configure/s-Bus communications" menu, and download this configur-
ation into the PCD via a PGU link by using the "Up/download" menu's
"CONFIGURE S-BUS" command. To use an RS-485 multi-station connection
for S-BUS, a "SAIA RS-485 to RS-232 convertor" or an opto-isolated
RS-232 card is required.
The new PCD8.K111 cable should be used for PGU and S-BUS modes.
For these PCD's, the PGU port CANNOT be used with public line modems
(it lacks control lines). The PCD1 can use port 1. The PCD2 and PCD4
can use any add-on RS-232 port, the PCD6.M5 can use only port 2.
SBUG can be invoked directly from DOS with the following command line:
Where:
The PCD contains the following elements. The addressing range (the
number of elements) is given. The "SCOPE" of an element indicates if
it is LOCAL to one CPU or GLOBAL (common) to all CPUs.
REAL-TIME - - - GLOBAL
CLOCK
NOTES:
(1) Inputs and Outputs share the same address space, whether an
address accesses and Input or an Output depends upon which
card occupies the space. On the PCD4.B900 I/O card, Inputs
and Outputs share the same address - reading from an address
returns the Input state, writing to the same address sets
the Output state.
(2) The division between which are Timers and which are Counters
is set by the "DEFTC" instruction, executed by CPU 0. Timers
may be addressed from 0 to this division, all others are
Counters. Timers are constantly decremented at a rate set by
the "DEFTB" instruction.
(4) Program lines contain user instructions. Each CPU has its
own local code segment, the size of which is programmable in
1K blocks from the "Configure/hardware and memory" menu.
Each CPU addresses its program lines from 0 up to ((code size
in K * 1024) - 1).
(5) The amount of memory space available for texts for each CPU
is programmable in 1K character blocks from the "Configure/
Hardware and memory" menu.
(6) Data Blocks (DBs) and Texts share the same addressing. For
example if Data Block 10 defined, the Text 10 is unavailable,
and vice-versa. Texts and DBs 0..3999 are stored in the "Text
Memory" segment, and Texts and DBs 4000..7999 are stored in
the "Extension Memory" segment.
NOTE: The PCD1 has Texts/DBs 0..4999, the PCD2 has Texts/DBs 0..5999.
SBUG - Page 7
2. THE SCREEN
==============
The screen is divided into 4 sections. The top line is a title and
CPU status line, the bottom 2 lines are prompt lines, the line above
these is the command line, and the remainder of the screen is the
data display window.
If no CPU is on line, the status will be "OFF LINE" and the CPU number
and type fields will contain "#" characters, since nothing can be read
from the CPU to fill these fields.
Where:
V2.0 SBUG's version number ($xxx=internal release)
Stn: 10 The connected S-BUS station number, if S-BUS is
being used.
CPU: 0 The connected CPU number 0..6.
Type: The connected CPU type and firmware version.
Status: The connected CPU's operational status, see below.
When the main display window is scrolling up, while data is being
displayed, the scrolling (and the command execution) can be paused
and restarted using the <SPACE> bar, so that the display can be
examined before it scrolls off the screen.
This window grows down from the second line of the screen, hiding
part of the main display window. It grows until half of the main
window is covered, then begins to scroll up.
Command words contain one upper case command character. To enter the
command word, only this single command character needs to be typed,
see section 3.1.
Examples:
When the cursor is on the command line, these keys can be used:
The function keys F2..F8 and F11..F40 execute the batch files named
"F2", "F3", "F11" etc. if they exist. This provides an easy way to
assign common commands to function keys, see section 3.7 for details.
SBUG is supplied with a default batch file (named SBUG.DBA) which
defines the keys F2..F8. This batch file is automatically loaded when
SBUG is started and defines the keys as follows. (The definitions for
keys F1, F9, F10 are fixed, batches cannot be assigned to them).
╔═════╤═════╗
HELP ║ F1 │ F2 ║ QUIT
╟─────┼─────╢
PRINT ENABLE ║ F3 │ F4 ║ PRINT DISABLE
╟─────┼─────╢
RUN ║ F5 │ F6 ║ STOP
╟─────┼─────╢
FILE DIRECTORY ║ F7 │ F8 ║ RESTART COLD ALL-CPUS
╟─────┼─────╢
RECALL PREVIOUS COMMAND ║ F9 │ F10 ║ RECALL NEXT COMMAND
╚═════╧═════╝
SBUG - Page 12
3. COMMANDS
============
The first (top level) prompt line displayed depends upon the CPU
state, since certain commands may not be permitted (e.g. Trace when
the CPU is in Run).
The top level prompts show all the valid commands. There are six
possible top level prompt lines.
The third prompt is used when creating a command batch with the "Batch
Write" command (see section 3.7). It contains only those commands that
are valid within a command batch, and an additional command to end the
batch write:
┌────────────────────────────────────────────────────────────────────────────────┐
│ eNdbatch Run Stop Trace Display Write Instruction Clear rEstart │
│ Locate Print File Help cOnnect broAdcast Quit │
└────────────────────────────────────────────────────────────────────────────────┘
The fourth prompt is also used when writing a command batch, when 99
lines have already been entered, the last one must be an "eNdbatch"
command (command batches can contain a maximum of 100 lines):
┌────────────────────────────────────────────────────────────────────────────────┐
│ eNdbatch │
└────────────────────────────────────────────────────────────────────────────────┘
The fifth prompt is used when editing a command batch, <ESC> ends the
edit without storing an "eNdbatch" command, see section 3.7.
┌────────────────────────────────────────────────────────────────────────────────┐
│ <ESC> eNdbatch Run Stop Trace Display Write Instruction Clear rEstart │
│ Locate Print File Help cOnnect broAdcast Quit │
└────────────────────────────────────────────────────────────────────────────────┘
SBUG - Page 13
Finally, the sixth prompt is used when the connected CPU is halted, or
after a program line has been inserted or deleted. The "Run", "Stop",
"Trace" and "Instruction" commands are not permitted. To allow these
commands, a "rEstart" must first be done.
┌────────────────────────────────────────────────────────────────────────────────┐
│ Display Write Batch Clear rEstart Locate Print File Help cOnnect │
│ broAdcast Quit │
└────────────────────────────────────────────────────────────────────────────────┘
These are the options for the "Run" command. If one of the upper case
"F", "T", "U", "C" or "A" keys is pressed, the word is displayed on
the command line, and the next prompt is displayed. If a CPU number
key 0-6 is pressed, the number is displayed on the command line and
the next prompt appears.
RF0<SP>UR1<SP>E7<CR>
The path of this command may be seen from the "Run: command diagram
in section 5. The final prompt is:
┌────────────────────────────────────────────────────────────────────────────────┐
│ <value CR> │
└────────────────────────────────────────────────────────────────────────────────┘
This prompts the user for the value for which Register 1 is to be
checked, followed by a carriage return <CR> to enter the command.
During the typing of a command the user can go back a step by pressing
either the backspace <- or the <DEL> key. This deletes the last word
displayed, and restores the previous prompt. If entering a number,
the last digit typed is deleted.
SBUG - Page 14
When the command line is empty, pressing <CR> repeats the previous
command, or pressing <+> recalls the previous command to allow editing.
To delete the entire command line press <ESC>.
Values entered on the command line are checked when <CR> is pressed.
If a value is incorrect, an error message is displayed. See section 4.
Function keys F2..F40 execute the batches named "F2" to "F40", see
section 3.7.
*** NOTE ***
If no PCD is on line, the response to key depressions may be slow
because SBUS spends time waiting for responses to communications
messages.
3.2 Run
--------
The "Run" command can set any CPU into Run mode, so that it begins
executing instructions. The "Run" command is not available if a
"rEstart" command is needed.
When the CPU is running with a breakpoint set, the CPU is said to be
in "Conditional Run" mode and the RUN lamp blinks. When a breakpoint
condition is satisfied, the CPU goes into "Conditional Stop", and the
next instruction (NOT executed yet) is displayed, marked with a "*".
The breakpoint will not occur again unless the run command is re-
entered. Breakpoints are removed if the connected CPU status changes,
if it stops or halts etc.
Run Continued
-------------
Run From 1024 To 1037 (Connected CPU runs from address 1024 )
(up to but not including address 1037.)
(It stops with its Instruction Pointer)
(equal to 1037, address 1037 has not )
(yet been executed. )
3.3 Trace
----------
The connected CPU can be single stepped one or more times with this
command. An optional start address "From", end address "To" or a
number of steps "Count" can be supplied. "Trace forEver" traces
until aborted by pressing ESCape. This command is available only if
the CPU is in Stop or Conditional Stop.
The speed of the CPU is governed by the speed that the data can be
read and displayed, it will be running thousands of times slower
than normal. Thus "Trace" should be used carefully for time-sensitive
applications (communications etc.)
The "Trace Mode" option controls the context switching between COBs
and XOBs. When the mode is ONE BLOCK, the "Trace" command single-
steps through the current COB or XOB only. When the end of the block
is reached, the trace continues from the beginning of the same block.
Other COBs will not be executed, even if NCOB instructions are found.
When the trace mode is ALL BLOCKS, when the end of an XOB or COB is
reached, or an NCOB instruction is executed, the trace continues from
the start of the next block.
"Trace To" stops at the given address or start of the given block
WITHOUT executing it.
Trace Continued
---------------
A Accumulator.
Each COB has its own independent Zero, Negative, Positive and Error
flags. Each code block, COB, PB, FB, SB, ST and TR has its own Accu-
mulator. Whenever a code block is called, the existing Accumulator
is saved, and the new Accumulator is set to 1. On return from the
block, the original Accumulator is restored.
The values of these flags can be seen using the "Display Accu"
command, and during "Trace" command execution.
3.4 Stop
---------
This command stops the CPU at the start of the NEXT instruction,
jut as if a breakpoint had been reached.
When the connected CPU goes into Stop mode, the next (unexecuted)
program line is displayed. A "*" indicates that this instruction has
not been executed yet. The arithmetic status flags, index register
and block number shown are the values BEFORE the instruction is
executed.
>Stop
STOPPED
*001029 STL I|O 40 A0 Z1 N0 P1 E0 IX2 PB0
>_
SBUG - Page 20
The "Display Program ... Refresh" is a special case, the data is not
displayed in the refresh window, but on the main display, see section
3.5.4.
While data is being read and displayed, the prompt "<SPACE> pauses,
<ESC> aborts" is displayed. If a long display command is in progress,
this can be paused or aborted.
Display Input 0 To 99
Display Input 0 Count 100
Both these commands have the same effect, and display Inputs 0..99.
SBUG - Page 21
>Display Accu
A0 Z0 N1 P0 E1 INDEX 12 COB 2
>_
Inputs, Outputs and Flags are all binary elements and are displayed
in the same way. Inputs and Outputs share the same addressing space,
0..8191 (PCD6) or 0..511 (PCD4), therefore the "Display Input" and
the "Display Output" commands display the same elements.
For Hex, Bcd and Decimal displays, the order in which elements are
displayed defines the most significant and least significant bits or
digits.
For example, to display 4 Bcd digits (16 bits), with the most signifi-
cant digit on Inputs 47..44 and the least significant digit on Inputs
35..32:
The decimal display is useful for A/D and D/A convertors which might
reside in the I/O area. The address range is the convertor's data
width (8-bit, 12-bit etc). Up to 32 bits can be displayed in decimal.
The binary value of the bits is converted to an unsigned decimal
value. The first address given in the command is always the least
significant bit.
If "To" is used, the lowest addressed bit is the most significant bit
only if the highest address is given first:
Registers, Timers and Counters are all 32-bits in length and are
displayed in the same way. Timers and Counters share the same
addressing space (see DEFTC instruction), the "Display Timer" and
the "Display Counter" commands display the same elements.
Bcd values show both the binary and the Bcd representation of the
value, with the most significant bit/digit first.
Binary values are displayed most significant bit first (bit 31..0).
Examples:
The binary value shown in the "Bcd" display and the binary of the
"binarY" display are not the same. This is because the binary
display shows the actual binary contents of the Register, Counter
or Timer. The Bcd value is the binary value after conversion to a
positive 10-digit decimal number, each digit is then converted to
4-bit binary to provide the Bcd data.
SBUG - Page 24
This command can also be given with the "Refresh" option, for
example:
>Display teXt 0
0: "Text Zero. <10><13>"
>Display teXt 0 Decimal
0: T e x t Z e r o . . .
084 101 120 116 032 090 101 114 111 046 032 010 013
>Display teXt 0 Hex
0: T e x t Z e r o . . .
54 65 78 74 20 5A 65 72 6F 2E 20 0A 0D
>Display teXt 1 Count 3
1: TEXT NOT DEFINED
2: TEXT IN USE AS DATA BLOCK
3: "Hello world!"
>_
>Display clocK
11/04/93 11:31:59 WEEK 23 DAY 5
dd/mm/yy hh/mm/ss
>Display iNdex-register
12
>_
>Display Display-register
10
>Display Display-register Hex
0000000A
>Display Display-register Bcd
0000 0000 0000 0000 0000 0000 0000 0000 0001 0000
0 0 0 0 0 0 0 0 1 0
>_
SBUG - Page 27a
>Display cpu-Status
CPU 0 RUN PCD6.M1 006
CPU 1 STOP PCD6.M2 006
CPU 2 HALT PCD6.M2 006
CPU 3 NOT CONNECTED
CPU 4 NOT CONNECTED
CPU 5 NOT CONNECTED
CPU 6 NOT CONNECTED
LAN2 RUNNING V001, STATION 12
P800 V002
PRODUCTION INFORMATION FOR CPU 0
System ID: M220 (02h)
Hardware version: H (48h)
Modifications: 1,2,3 (07h)
Fab. date (year/week): 1998/01
>_
NOTE: For the PCD1, PCD2 and PCD6.M5, only one CPU is shown. For the
PCD4, two CPUs are shown.
SBUG - Page 28
Shows the memory allocation and the amount of used and available
memory for all possible CPUs in the system, including the LAN2.
The PCD6 shows 6 CPUs, the PCD4 shows 2, and the PCD1, PCD2 and
PCD6.M5 show one.
PROGRAM NAME The name of the loaded program, from the .PCD file name.
Displays the "Halt Reason" and the "History Table". The Halt Reason
is written when the CPU halts, it is also written on power-up,
indicating the date and time of the power-up. Whenever the CPU
detects an error, an entry is written into the circular History
Table, which holds the last 12 errors in locations 0..11. Locations
12..15 count the number of battery fails, Index Register overflows,
I/O quit failures and the number of times the Error flag has been
set.
The History Table can be cleared using the "Clear History" command.
A list of messages and their meanings can be found in section 4.3.
Example:
Halt Reason.
>Display History |
000123 HALT INSTRUCTION 19/03/89 16:45:02 <---+
00 000022 BUS QUIT FAILURE 22/01/88 09:14:32
01 100D4500 BUS QUIT FAILURE 23/02/88 16:43:19
02 97520018 PARITY ERROR 23/02/88 16:44:02
03 00010000 HEADER FAIL 23/02/88 16:45:00
04 00000000 NO PROGRAM 26/03/88 12:35:08
05 008123 IR OVERFLOW 01/04/88 02:48:57
06 009044 INVALID OPCODE 02/05/88 19:32:42
07 FFFFFFFF 68k INVALID OPC 19/06/88 14:13:12
08 00002BED CHECKSUM FAIL 20/07/88 01:16:17
>>09 0002A00F BATT FAIL 12/09/88 16:35:47
| 10 EMPTY
| 11 EMPTY
| 12 0002A00F BATT FAIL 002 19/06/90 14:32:57
| 13 008123 IR OVERFLOW 378 25/05/90 10:16:32
| 14 00F43765 IO QUIT FAIL 001 14/03/89 00:01:19
| 15 000201 ERROR FLAG 129 19/07/90 12:33:49
| | | | | |
| | | | | |
| | | | | |
| | | | | +---- Date and time of error
| | | | +--------- Number of occurrences
| | | +---------------------- Error description
| | |
| | +-- Address where the error occurred. If this is 6 digits,
| | then it's a user program line number in decimal,
| | usually number of the line AFTER the instruction which
| | caused the error. If this is 8 digits, then it's a
| | hexadecimal internal processor address. If the location
| | has never been written to, it contains the text "EMPTY".
| |
| +------ History Table position, 00..15. Entries 00..11 are
| a circular buffer holding the last 12 errors. Entries
| 12..15 count the specific errors shown above.
|
+-------- The ">>" pointer indicates the latest entry in the
table.
SBUG - Page 30
Data is copied from Registers into the DB using the PUT instruction,
and is copied from the DB back into the Registers using the GET
instruction. PUT and GET copy the entire DB, so the number of
Registers transferred by PUT and GET depends on the DB size.
>Display data-Block 2
2 (0): 2147483647 2147483647 2147483647 2147483647
2147483647
2 (5): 2147483647 2147483647 2147483647 2147483647
2147483647
>Display data-Block 3 Bcd
3 (0): 0010 0001 0100 0111 0100 1000 0011 0110 0100 0111
2 1 4 7 4 8 3 6 4 7
3 (1): 0010 0001 0100 0111 0100 1000 0011 0110 0100 0111
2 1 4 7 4 8 3 6 4 7
3 (2): 0010 0001 0100 0111 0100 1000 0011 0110 0100 0111
2 1 4 7 4 8 3 6 4 7
3 (3): 0010 0001 0100 0111 0100 1000 0011 0110 0100 0111
| | 2 1 4 7 4 8 3 6 4 7
| |
| |
| +------- Data item number 0..382
+---------- Data Block number 0..3999
Data Blocks share the same numbering as Texts. For example, if Data
Block 10 is defined, then Text 10 is unavailable, and vice-versa.
DBs 0..3999 are stored in text memory, in a special encoded format.
DBs 4000..7999 (or 4000..4999 in PCD1, 4000..5999 in PCD2) are
stored in extension memory, directly in binary, and so are faster
to access than DBs in text memory. If the code and text segments
are in EPROM, which is read-only, then DBs 4000..7999 in extension
memory will be in RAM and can be written to.
SBUG - Page 31
The display shows the hex address, hex data and ASCII values.
Sixteen values values are shown on each line.
>Display Exec-path
1 COB 0 0
2 FB 6 245
3 FB 7 344
4 PB 93 1034
| | |
| | +------- Return address
| +----------------- Called block
+-------------------- Nesting level
SBUG - Page 32
Displays the PCD's S-BUS PGU port and gateway configuration, which
is stored in user memory. The S-BUS PGU port is configured from the
"Configure/s-Bus communications" and "Configure/Modem for SAIA PCD"
screens. The gateway is configured from the "Configure/Gateway master
port" sceen. The S-BUS and gateway configuration is ritten into user
memory with the "Up/download" program's "CONFIGURE S-BUS" command,
or with "SDNLD /S" from the DOS prompt.
>Display s-bUs
S-BUS PGU PORT
Station: 0 TS delay: 0 mS (default)
Baud rate: 9600 Timeout: 250 mS (default)
Mode: Break TN delay: 1 mS (default)
PGU port: CPU0=0
PUBLIC LINE MODEM
Modem name: Miracom WS3000
Reset modem: "ATZ\r"
Init modem: "ATM0E0S0=2\r"
GATEWAY PORT
Port number: 1 TS delay: 0 mS (default)
Baud rate: 9600 Timeout: 250 mS (default)
Mode: Parity TN delay: 1 mS (default)
Port on CPU: 0
SBUG - Page 33
Excluding the Inputs and the Display Register (which are both read
only), all elements can be written to. The "Write" command allows
elements to be written in binarY, Decimal, Hex, Bcd or Floating-point
units as appropriate. It is also possible to write to more than one
element at the same time with a single command.
Examples:
>Write Accu 0
>Write Status-flag Zero 1
>Write Status-flag Negative 1
>Write Status-flag Positive 0
>Write Status-flag Error 1
>_
Binary Units
------------
Binary is the default base for writing Outputs and Flags. A single
bit can be set or cleared with the following command:
Since both Bcd and Hex digits use 4 bits, both these commands are
the same, except Bcd digits can be 0..9, Hex digits can be 0..F.
Since one Bcd or Hex digit consists of 4 binary bits, when the
address range of bits to be written is specified it must also be a
multiple of 4 value, followed by the correct number of Bcd or Hex
digits. For Bcd or Hex values the order (ascending or descending)
of the address range affects which is the most significant bit and
digit. The rules are the same as for the "Display Output/Flag"
commands, see section 3.5.2.
>Write Output 0 Count 12 123 Hex (bits 11..0 are written with )
(3 hex digits as follows: )
( 1098 7654 3210 )
( 0011: 0001 0010 0011 )
>Write Output 0 To 11 123 Hex (same as above)
>Write Output 11 To 0 123 Hex (bits 0..11 are written with )
(3 hex digits as follows: )
( 0123 4567 8901 )
( 0000: 1000 0100 1100 )
SBUG - Page 35
Decimal Units
-------------
Manual
------
The Output or Flag value can be toggled using the <1> and <0> keys.
The next or previous output or flag is displayed by pressing the
<DOWN ARROW>, <CR> or <UP ARROW> keys. <ESC> exits manual write mode.
Example:
The Write Timer, Counter and Register commands are all the same,
except that only Registers can be written in Floating-point or Ascii
units, and Timers and Counters cannot contain negative values.
Examples:
When this command is entered, the existing program line at the given
address is read, disassembled and displayed (as for the "Display
Program" command) and a cursor is placed after it on the line. A new
instruction line can now be entered. Opcodes and medium control codes
(mc) are entered in mnemonic form, the operand defaults to decimal
units. Either the <SPACE> or the <TAB> key can be used to separate the
mnemonic, mc and operand. <DEL> and backspace can be used to edit the
line.
Instruction lines are checked and stored in the PCD when <CR> is
pressed. If <CR> is pressed without entering an instruction, program
memory is NOT changed and the next instruction line is displayed.
This feature can be used to step to the desired line. The <ESC> key
is used to end the programming session.
Lines can be inserted and deleted only when the CPU is in Stop,
Conditional Stop or Halt. When <ALT+I> is pressed, a NOP instruction
line is inserted AFTER the current line number. Pressing <ALT+D>
deletes the current line.
When <ALT+D> is pressed, line 1026 is removed from the screen, and
line 1027 is displayed in its place, now it's line 1026. All lines
above it will have been shifted down 1, and all jumps are adjusted.
The display now looks like this:
Existing texts can be edited or deleted, and new texts can be added
with this command. A simple text editor is provided. Texts can be
typed directly from the keyboard, or the decimal codes for individual
ASCII characters can be entered.
The "Write Text" command prompts for a text number, this can be the
number of a new text, or the number of an existing text which is to
be edited.
The text is displayed in the same ASCII format as for the "Display
Text" command. The cursor is placed over the first character of the
text, and editing can commence. The prompt line changes to indicate
text entry, and which keys are valid:
┌────────────────────────────────────────────────────────────────────────────────┐
│ WRITE TEXT: Edit text on screen. <ARROW> moves cursor, <ALT+S> stores, │
│ <INS> insert/overtype mode, <DEL> or <BS> deletes, <ESC> aborts. │
└────────────────────────────────────────────────────────────────────────────────┘
The text can now be entered or edited. The <ARROW> keys can be used
to move around the text, the <HOME> and <END> keys move to start or
end of the current line.
The <DEL> key deletes the character under the cursor, backspace <-
deletes the character before the cursor, <INS> toggles between insert
and overtype mode. Insert mode is indicated by a block cursor, overtype
mode by the standard underline cursor.
SBUG - Page 40
The maximum size of text that can be edited is 3072 characters (3K),
including the terminating NUL.
The first character of Text 0..3999 must NOT be 0FDH, 0FEH or 0FFH
(253..255 decimal) because these indicate that the Text has a
special format or is in use as a Data Block.
SBUG - Page 41
Either one or two digits may be typed for each field, separated by
any non-numeric delimiter, such as "/", ":" or a space. A minimum
of six numeric values must always be entered, for example:
The Index Register of the current COB or XOB (each has its own Index
Register) can be written in decimal only, no units can be selected.
The Index Register cannot be written while the CPU is in Run or
Conditional Run. Maximum values are 0..8191.
>Write iNdex-register 0
>_
SBUG - Page 42
The "Write data-Block" command has three forms: a new Data Block of
a given size can be created or the Data Block deleted; element values
can be edited interactively; or one or more elements can be loaded
with a given value. Element values can be changed while the CPU is
in Run mode.
Examples:
One or more elements of the Data Block can be written with a single
value using the familiar "To" and "Count" ranges.
Examples:
Changed values are only written into the CPU's memory when <ALT+S>
is pressed. Editing can be aborted by pressing <ESC>, and all the
changes are discarded without writing to the PCD's memory.
SBUG - Page 44
This command is not shown on the prompt line because it should not
normally be used by customers.
The command has two forms. The first form accepts one or more hex
values on the command line, which are checked and then written to the
given hex address and consecutive bytes. Each data value must be a
2-digit hex value.
Do NOT use this command unless you are certain about the contents
of the memory locations. Changing the wrong memory locations will
cause incorrect operation and may crash the CPU.
SBUG - Page 45
The S-BUS station number of the connected PCD can be changed with
this command. The station number is the only S-BUS parameter that
can be changed from S-BUG, other parameters can only be changed from
the "Configure/s-bUs communications" menu, and must be downloaded
from the "Up/download" menu, or with "SDNLD /S".
SBUG first checks the network to see if another station with the
new number exists. If not, the connected station's number is changed,
and SBUG switches to the new station number. The PCD's operating mode
(Run/Stop) is not affected, and no "restart" is done.
PCDs with the latest firmware (PCD2 V003, PCD4 V005, PCD4.M4 V001,
PCD6.M5 V004, PCD6 V007) now have a password protection mechanism.
When protected by the password only reduced protocol communications
can be used. This allows access only to Registers, Timers, Counters,
Inputs and Outputs and the clock. The user program and all other
data cannot be accessed unless a valid password is entered.
╔══════════════════════════════════════════════════╗
║ ONLINE PASSWORD PROTECTION IS ACTIVE ║
║ ║
║ Enter password: _________________________ ║
║ ║
║ Press ENTER to continue, ESC for reduced access. ║
╚══════════════════════════════════════════════════╝
Use the "Write passWord New" to define a password for the first time:
3.7 Batch
----------
When a batch is executed, commands are read and executed from the
batch instead of from the keyboard. While executing, all commands and
data are displayed as usual, unless the "Nodisplay" option has been
specified.
Element numbers, addresses and other data values are NOT checked as
they are entered, these are checked only when the batch is executed.
If an invalid command is found when the batch is executed, an error
message is displayed and the batch is aborted. Some commands can be
executed only if the CPU is in Stop, Conditional Stop or Halt, these
can also be invalid when the batch is executed.
1) When in Conditional Run, the batch pauses until the CPU reaches
the breakpoint (goes into Conditional Stop) before the next batch
line is executed. If not executing a batch, further commands can
be executed from the keyboard when in Conditional Run.
2) The "ARE YOU SURE (Y or N)?" prompts are NOT displayed if the
"File" and "Clear" commands are executed from a batch, so ensure
that dangerous batches are not executed by mistake.
SBUG - Page 48
During the writing or editing of a batch, the top level prompt shows
only the valid batch commands , including the extra "eNdbatch" command
needed to terminate the batch write or edit. When on line 99 of a
batch, the prompt line will change to force the user to terminate, it
allows only the "eNdbatch" command. See section 3.1.
3.8 File
---------
These are the "File" commands, which are described in more detail
below:
The default file type for "File Load" is .PCD. Tor "File Save" it
is .UPL (UPLoaded file), which prevents overwriting of the original
.PCD file.
For the "File Save" and "File Load" (without a specified block), the
file name is optional, if not specified then the name of the program
already present in the connected CPU is used. If no drive or path
name is given, the current drive and directory are used by default.
If no file extension is given, the defaults .PCD (File Load) and
.UPL (File Save) are used.
SBUG - Page 51
When loading an entire program (not a single block, text, DB), the
CPU's memory is cleared and a "Restart Cold" or "Restart Warm" (see
NOTE below) is done. This means that the CPU's memory remains empty
if the download fails or is aborted. After the download, the CPU will
always remain in Stop.
Since a download can be started when the program is running, the user
is prompted to prevent him inadvertently stopping and restarting a
CPU. Note that if an entire program is downloaded to CPU 0, all other
CPUs will be restarted and will go into Stop. If not connected to CPU
0, only the connected CPU is restarted and will be stopped.
The user can then either overwrite it with "Y", or abort the operation
with "N".
After a successful download, all CPUs are put into Run automatically
if the "Run all CPUs on completion" option is "Yes".
SBUG - Page 52
"File Load ..." is available when the CPU is in Run. This enables a
single block to be downloaded when in Run, thus changing the process
"on the fly". Once a new block is downloaded, the new block is used
in place of the old block. Blocks are added to the end of the existing
code or text segments. The original block is NOT DELETED, it remains
in memory, so if the program is uploaded then all the old blocks will
also be present in the .UPL file. If more than one block with the
same number is present in memory, the *last one* is always used by
the PCD.
Before the block is downloaded, SBUG checks to see if the block calls
any other blocks which are not defined in the CPU, or references Texts
or DBs which do not exist. If so, and the CPU is in Run, a fatal error
occurs, indicating the undefined block, and the download is aborted.
No data will have been downloaded.
If the CPU is not in Run, then the user is prompted: "ABORT, CONTINUE
OR IGNORE (A, C or I) ?". Answering 'A' aborts the download, 'C'
continues the checking and 'I' continues the download without any
further checks.
If the PCD contains Flash EPROM memory, then individual blocks cannot
be downloaded, unless they are Texts or DBs in extension memory.
Texts and Data Blocks in extension memory are NOT added to the end
of the extension memory segment if the Text or DB to be downloaded
already exists, and is the same size. In this case the existing Text
or DB is overwritten. This allows extension memory to be altered if
the code and text segments (and memory map) are in read-only EPROM.
During the "File Save" operation, the checksum on the code and text
segments is calculated. If this doesn't match the checksum stored
in the CPU's header, a warning message is displayed and the correct
(calculated) checksum is written to the file. The warning can mean
either that the code or text of the connected CPU has be modified
with "Write" commands, or that memory has become corrupted.
SBUG - Page 53
File Directory
--------------
File View
---------
Displays the contents of the given ASCII file. The file can be
viewed using the <ARROW>, <PGUP>, <PGDN>, <HOME> and <END> keys.
It can also be scrolled left and right using the <LEFT ARROW> and
<RIGHT ARROW> keys. The default filename extension is ".SRC". If
wildcard characters are used in the file name or the file name is
empty, the directory window is displayed, and a file can be chosen
from the list.
File Compare
------------
If the program in the PCD's memory has been edited on-line, then the
checksum of the program has been invalidated, and "File Compare"
will always fail, even if compared with a copy of the same program.
SBUG - Page 54
File Get-pcdsetup
-----------------
Reads the PCD configuration from the connected PCD and stores it
in the PCDSETUP.DAT file in the current directory. This saves the
"hardware and memory", "S-BUS communications", "modem for SAIA PCD"
and "gateway master port" configurations. These can then be viewed
and edited from the configurator's "SAIA PCD CONFIGURATION" menus.
The Up/downloader's "UPLOAD PCD SETUP" command does the same thing,
but the Up/downloader also has a "DOWNLOAD PCD SETUP" command, which
does the reverse.
File set-load-Options
---------------------
When a new program is downloaded into the connected CPU using the
"File Load" command, the settings of two options are used. The
current settings are shown at the bottom of the screen when "File
Load" or "File set-load-Options" is typed:
If this is "YES", then all PCD Outputs are cleared at the start of
the File Load. If "NO", then the Outputs are not cleared, and retain
their current states. If the PCD firmware does not support this
feature, a warning message will be displayed, and the action will
depend upon the PCD's "Reset Outputs" jumper (if the PCD has one):
If the jumper is in, then outputs are cleared at the start of the
download; if it's out, they are only cleared when the download is
complete.
If "YES", then all CPUs containing programs are put into Run after a
successful "File Load" operation. If "NO", all CPUs will remain in
Stop. CPUs which don't contain programs will always remain in Halt,
regardless off the setting of this switch. Use this switch to minimize
the amount of time that outputs are cleared or not under PCD control.
3.9 Instruction
----------------
Not all instructions are allowed, the program flow, program structure
and definition instructions cannot be executed:
Certain instructions are executed only if the ACCU is High (1). If the
ACCU is Low (0), the instruction is not executed and an error message
is displayed. ACCU dependent instructions are:
Examples:
>Instruction STH I 3
>Instruction MUL R 0,R 1,R 6
>Batch Run TOGGLE_OUTPUT_1 Count 100000
00>Instruction SET O 1 (a batch containing the)
01>Instruction RES O 1 (Instruction command )
00>Instruction SET O 1 (which toggles Output 1)
01>Instruction RES O 1
00>Instruction SET O 1
01>Instruction RES O 1
00>Instruction SET O 1
01>Instruction RES O 1
00>Instruction SET O 1
01>Instruction RES O 1
.
.
.
ABORTED (ESC aborts execution)
>_ (of the batch )
SBUG - Page 56
3.10 Locate
------------
"Locate Next" repeats the previous Locate command, searching for the
next occurrence of the item.
The range of memory to be searched can be set using the "From" and
"To" options. Initially, "From" is set to 0, and "To" is set to the
last program line.
These are the types which can be used in the "Locate Operand" command:
3.11 Restart
-------------
The "Restart" command has two options, "Restart Cold" and "Restart
Warm". A CPU number can also be supplied, so that individual CPU's
(not just the connected CPU) can be restarted. A Restart command
with no CPU number restarts the connected CPU.
"Restart Warm" initialises the CPU's internal data tables, but sets
the instruction pointer to the start of COB 0. XOB 16 is NOT executed
when the CPU is put into Run.
A "rEstart Cold" must be done to recover a CPU from the Halt state.
After the restart, all CPUs remain in Stop, see note below.
Examples:
3.12 Clear
-----------
The "Clear" commands can clear (set to zero) all Outputs, all Flags,
all Timers and Counters, all Registers, All-elements (all the
preceding elements), all elements of a Data Block, or clear the
History Table. This command can also delete all program, text and/or
extension memory, see the clear memory commands below.
Before the command is executed the "ARE YOU SURE (Y or N)?" prompt is
displayed, pressing "Y" executes, "N" or ESCape aborts.
Clear Outputs
Clear Flags
Clear Timers+counters
Clear Registers
Clear All-elements
Clear data-Block
Clear History
Clearing elements if any CPUs are running may cause the program to
crash.
3.13 Print
-----------
Data output to the display window can also be sent to the printer
or to a log file on the disk, for examination later. Output to the
printer is formatted according to the page format defined on the
"Configure" menu. Output to a file is not formatted.
Print Open-file Opens a file for output and executes the "Print
Enable" command. If another file is already open,
it is closed first. If the file already exists,
it will be overwritten.
Print Close-file Closes the file and executes the "Print Disable"
command. It is not necessary to close the file
before using the "Quit" command, the file is
automatically closed on exit of SBUG.
3.14 Help
----------
The "F1" function key can also be used. If the command line is empty,
F1 displays the main help index. If F1 is pressed during the entry
of a command, then the help page displayed will describe that command.
If the DOS command "SET PCD=path" has been executed, usually from the
AUTOEXEC.BAT batch file, this enables SBUG to locate its help file
SBUG.HLP from any sub-directory. "path" gives the drive and directory
name where SBUG.HLP can be found, usually "C:\PCD".
SBUG - Page 61
3.15 Connect
-------------
For example:
3.16 Broadcast
---------------
broAdcast rEstart-cold-all-cpus
All CPUs on the network are reset and go
into Stop.
3.17 Quit
----------
This command exits SBUG and returns to DOS or to the PCD menu.
If batches have been altered and have not been sent to a batch file,
a prompt is displayed:
Answering "Y" exits SBUG without saving the altered batches. "N"
aborts the "Quit" operation, allowing a "Batch Save" command to be
done. If no batches have been altered, or a "Batch Save" has already
been done, this prompt does not appear.
Answer "Y" to quit, "N" to stay in SBUG so that the "rEstart Cold"
can be done. NOTE: If the restart is not done, the program may fail
if the CPU is subsequently put into Run.
4. ERROR REPORTING
===================
A write error occurred while writing this file, the write has
not been completed. The destination disk may not be present,
may be write protected or may be full.
SBUG - Page 64
A read error occurred, the file read has not been completed.
Either the disk was removed or the file on the disk is
corrupted.
The line number given for a "Batch Edit" command does not
exist in the batch, therefore it cannot be edited.
The PCD2 and PCD6.M5 have one CPU (0). The PCD4 has one or
two CPUs (0 and 1). The PCD6 can have up to seven CPUs (0
to 6).
ERROR 71: NEW DATA BLOCK OR SIZE CHANGED, CPU MUST BE IN STOP OR HALT
ERROR 76: EXTENSION MEMORY SEGMENT TOO SMALL: HAS nnK, NEEDS nnK
ERROR 81: MEMORY MAP IN EPROM, CAN'T CHANGE EXTENSION MEMORY SIZE
The "Write s-bUs station" command does not allow more than
one S-BUS station with the same number to exist on the same
network, because both stations would go off line.
ERROR 91: NONVOLATILE REGISTERS ARE FOR PCD1 AND PCD6.M3 ONLY
ERROR 93: GREATER THAN/LESS THAN, NOT ALLOWED FOR FLOATING POINT VALUE
ERROR 95: CAN'T CHANGE TEXT SIZE IF EPROM OR FLASH EPROM MEMORY
4.3 Warnings
-------------
The PCD's formware does not support "NO" for the "Clear all
outputs" setting. All outputs will be cleared anyway.
The PCD does not have the required firmware version. There
are instructions in the .PCD file which WILL NOT RUN on
this PCD.
The .PCD file was designed to run on CPU <n> only, it will
probably not run correctly on the connected CPU.
One of the Batch commands has been used to edit the batches
in memory, and they have not yet been saved to the hard
disk. Answer 'Y' to exit WITHOUT SAVING. Answer 'N' to stay
in SBUG so the "Batch Save" command can be used.
START-UP MESSAGES
The following errors can be detected on POWER UP of the PCD.
The following errors will be detected while the PCD is in RUN, those
which put the PCD into HALT will also write the message into the
HALT REASON REGISTER.
The following diagrams detail the syntax of all the SBUG commands.
To read the diagrams, start at the left, find the box containing the
desired command word, such as "Run", then move from box to box from
left to right, entering each box from the left, and exiting from the
right. The right-hand margin implies <CR> carriage return.
╒═════════════════════════════════════════════════════════════════════╕
│ Run │
│ ╒══════════════════════════════════════════════════════════════╡
│ │ <cpu number 0-6> │
│ │ All-cpus │
│ ╞══════╤═══════════════════════════════════════════════════════╡
│ │ Xob │ 17 | 18 | 19 │
│ ╞══════╧═══════════════════════════════════════════════════════╡
│ │ From <address> │
│ │ ╒═════════════════════╤═════════════════════════════════╡
│ │ │ Count <count> │ │
│ │ │ Until { BP } │ ╒════╤═════════════════════╡
│ │ │ │ │ Or │ Count <count> │
│ │ │ │ │ │ Until { BP } │
│ │ ╞════╤════════════════╡ │ ╞════╤════════════════╡
│ │ │ To │ <address> │ │ │ To │ <address> │
│ │ │ ╞═════╤══════════╡ │ │ ╞═════╤══════════╡
│ │ │ │ Cob │ <number> │ │ │ │ Cob │ <number> │
│ │ │ │ Xob │ │ │ │ │ Xob │ │
│ │ │ │ Pb │ │ │ │ │ Pb │ │
│ │ │ │ Fb │ │ │ │ │ Fb │ │
│ │ │ │ St │ │ │ │ │ St │ │
│ │ │ │ Tr │ │ │ │ │ Tr │ │
│ ╘══════╡ ╞═════╧══════════╡ │ │ ╞═════╧══════════╡
│ │ │ End-of-block │ │ │ │ End-of-block │
╘═════════════╧════╧════════════════╧══════╧════╧════╧════════════════╛
╒═════════╤══════════════════════════════════════════════════════════════╕
│ Display │ Accu (1) │
│ ╞══════════════════════════════════════════════════════════════╡
│ │ iNdex-register (1) │
│ ╞══════════════════════════════════════════════════════════════╡
│ │ cpu-Status │
│ ╞══════════════════════════════════════════════════════════════╡
│ │ Memory-map │
│ ╞══════════════════════════════════════════════════════════════╡
│ │ History │
│ ╞══════════════════════════════════════════════════════════════╡
│ │ Exec-path │
│ ╞══════════════════════════════════════════════════════════════╡
│ │ s-bUs │
│ ╞════════════╤══════════════════════════════════╤══════════════╡
│ │ Input │ <number> │ │
│ │ Output │ ╒══════════╡ │
│ │ Flag │ │ Decimal │ │
│ │ Register │ │ Bcd │ │
│ │ Counter │ │ Hex │ │
│ │ Timer │ ╒═══════════════╡ binarY │ ╒═════════│
│ │ data-Block │ │ To <number> │ Float (2)│ │ Refresh │
│ │ │ │ Count <Count> │ Ascii (2)│ │ (3) │
│ │ │ │ ╘══════════╡ │ │
│ │ │ │ │ │ │
│ ╞════════════╧═══════╧══════════════════════════╡ │ │
│ │ Display-register │ │ │
│ ╞═══════════════════════════════════════════════╡ │ │
│ │ clocK │ │ │
│ ╞════════════╤════════════════╤═════════════════╧════╧═════════╡
│ │ Program │ <address> │ │
│ │ ╞═════╤══════════╡ │
│ │ │ Cob │ <number> │ │
│ │ │ Xob │ │ ╒═════════╡
│ │ │ Pb │ │ │ Refresh │
│ │ │ Fb │ │ ╒═════════════════╡ │
│ │ │ sB │ │ │ To <addresss> │ │
│ │ │ St │ │ │ Count <count> ╘═════════╡
│ │ │ Tr │ │ │ │
│ ╞════════════╧═════╧══════════╧════╧═══════════════════════════╡
│ │ teXt <number> │
│ │ ╒═════════╡
│ │ │ Ascii │
│ │ ╒════════════════╡ Decimal │
│ │ │ To <number> │ Hex │
│ │ │ Count <count> ╘═════════╡
│ │ │ │
╘═════════╧═══════════════════════════════════╧══════════════════════════╛
╒═══════╤═════════════════════════════╤═══════════════════════════════╕
│ Write │ Accu (1) │ 0 │
│ │ │ 1 │
│ ╞═════════════╤═══════════════╡ │
│ │ Status-flag │ Zero │ │
│ │ (1) │ Negative │ │
│ │ │ Positive │ │
│ │ │ Error │ │
│ ╞═════════════╪═══════════════╡ │
│ │ Output │ <number> │ │
│ │ Flag │ ╒════╧═══════════════════════════════╡
│ │ │ │ Manual (2) │
│ │ │ ╞═══════════════╤════════════════════╡
│ │ │ │ To <number> │ <value> │
│ │ │ │ Count <count> │ ╒═══════════╡
│ ╞═════════════╪══════════╧═══════════════╡ │ Decimal │
│ │ Register │ <number> │ │ Bcd │
│ │ Timer │ │ │ Hex │
│ │ Counter │ ╒═══════════════╡ │ binarY │
│ │ │ │ To <number> │ │ Float (3) │
│ │ │ │ Count <count> │ │ Ascii (3) │
│ ╞═════════════╧═════╤════╧═══════════════╧════════╧═══════════╡
│ │ iNdex-register (1)│ <value> │
│ ╞═══════════════════╪═════════════════════════════════════════╡
│ │ Program │ <address> │
│ ╞═══════════════════╪═════════════════════════════════════════╡
│ │ teXt (2) │ <number> │
│ ╞═══════════════════╪═════════════════════════════════════════╡
│ │ clocK │ <dd/mm/yy hh:mm:ss [week [day]] > │
│ ╞════════════╤══════╧═════════════════════════════════════════╡
│ │ data-Block │ <number> │
│ │ │ ╒═════════════════════════════════════════╡
│ │ │ │ Element <element> │
│ │ │ │ ╒═════════╡
│ │ │ │ │ Decimal │
│ │ │ │ ╒═════════╡ Hex │
│ │ │ │ │ <value> │ Float │
│ │ │ │ ╒═══════════════╡ │ Ascii │
│ │ │ │ │ To <element> │ ╘═════════╡
│ │ │ │ │ Count <count> │ │
│ │ │ ╞═════╧═══════════════╧═══════════════════╡
│ │ │ │ Size <size> │
│ ╞════════════╧══════╧═════════════════════════════════════════╡
│ │ s-bUs station <station number> │
│ ╞══════════╤══════════════════════════════════════════════════╡
│ │ passWord │ Change <current password> <new password> │
│ │ │ New <password> ╒═══════════╡
│ │ │ │ <timeout> │
│ │ ╞═════════╤════════════════════════════╧═══════════╡
│ │ │ Enter │ <current password> │
│ │ │ Remove │ │
╘═══════╧══════════╧═════════╧════════════════════════════════════════╛
╒══════╤═══════════════════════════════════════════╕
│ File │ Load │
│ │ ╒════════════════════════════════════╡
│ │ │ <filename> │
│ │ │ ╒══════════════════╤══════════╡
│ │ │ │ Cob │ <number> │
│ │ │ │ Xob │ │
│ │ │ │ Pb │ │
│ │ │ │ Fb │ │
│ │ │ │ sB │ │
│ │ │ │ St │ │
│ │ │ │ Tr │ │
│ │ │ │ tExt │ │
│ │ │ │ Data-block │ │
│ │ │ │ exteNsion-memory │ │
│ ╞══════╧══════╧══════════════════╧══════════╡
│ │ Save │
│ │ ╒═════════════════════════════╡
│ │ │ <filename> │
│ ╞═════════════╡ │
│ │ View │ │
│ ╞═════════════╡ │
│ │ Compare │ │
│ ╞═════════════╧═════════════════════════════╡
│ │ Directory │
│ │ ╒═════════════════════════════╡
│ │ │ <filename mask> │
│ ╞═════════════╧═════════════════════════════╡
│ │ Get-pcdsetup │
│ ╞══════════════════╤════════════════════════╡
│ │ set-load-Options │ Clear-all-outputs │
│ │ │ Run-all-cpus │
╘══════╧══════════════════╧════════════════════════╛
SBUG - Page 87
╒═══════╤═════════════════════════════════════════════════════════╕
│ Batch │ Display │
│ │ ╒═══════════════════════════════════════════════╡
│ │ │ <batch name> │
│ ╞═════════╡ │
│ │ Write │ │
│ │ Kill │ │
│ ╞═════════╧═══════════════════════════════════════════════╡
│ │ Load │
│ │ ╒═══════════════════════════════════════════════╡
│ │ │ <batch file name> │
│ │ │ ╒══════════════════════════│
│ │ │ │ <batch name> │
│ ╞═════════╧════════════════════╧══════════════════════════╡
│ │ Save │
│ │ ╒═══════════════════════════════════════════════╡
│ │ │ <batch file name> │
│ ╞═════════╪══════════════╤════════════════════════════════╡
│ │ Edit │ <batch name> │ <line number> │
│ ╞═════════╪══════════════╧════════════════════════════════╡
│ │ Run │ <batch name> │
│ │ │ ╒════════════════╡
│ │ │ │ Nodisplay │
│ │ │ ╒═══════════════╡ │
│ │ │ │ Count <count> │ │
│ │ │ │ ╘════════════════╡
│ │ │ │ │
│ ╞═════════╪══════════════╪════════════════════════════════╡
│ │ Copy │ <batch name> │ <new batch name> │
│ │ reName │ │ │
╘═══════╧═════════╧══════════════╧════════════════════════════════╛
╒═══════╤═══════════════════════╕
│ Clear │ Outputs │
│ │ Flags │
│ │ Timers+counters │
│ │ Registers │
│ │ All-elements │
│ │ History │
│ │ data-Block │
│ │ │
│ │ Memory (1) │
│ │ Program-memory (1) │
│ │ teXt-memory (2) │ (1) Not available when in
│ │ Extension-memory (1) │ Run or Conditional Run,
╘═══════╧═══════════════════════╛ also clears Data Blocks.
SBUG - Page 88
╒═══════╤═══════════════════════╕
│ Print │ Enable │
│ │ Disable │
│ │ Page │
│ │ Open-file <filename> │
│ │ Close-file │
╘═══════╧═══════════════════════╛
╒═════════╤═════════════════════════╕
│ rEstart │ Cold │
│ │ Warm │
│ │ ╒══════════════════╡
│ │ │ <cpu number 1-6> │
│ │ │ All-cpus │
╘═════════╧══════╧══════════════════╛
╒═════════════════════════════════════════════════════════════╕
│ Trace │
│ ╒══════════════════╡
│ │ To <address> │
│ ╒═════════════════╡ Count <count> │
│ │ From <address> │ │
│ ╒══════════╕ │ ╘══════════════════╡
│ │ No-Calls │ │ │
│ ╞══════════╧════╧═════════════════╤══════════════════╡
│ │ Mode │ One-block │
│ │ │ All-blocks │
╘════════╧═════════════════════════════════╧══════════════════╛
╒═════════╤═══════════════════════════════════════════════════╕
│ Locate │ ╒nstruction <mnemonic [mc] [operand]> │
│ ╞═══════════════════════════════════════════════════╡
│ │ Mnemonic <mnemonic> │
│ ╞═══════════════════════════════════════════════════╡
│ │ Operand <[type] value> │
│ ╞═══════════════════════════════════════════════════╡
│ │ Next │
│ ╞═══════════════════════════════════════════════════╡
│ │ From <address> │
│ │ ╒═════════════════════════════════╡
│ │ │ To <address> │
│ ╘═════════════════╡ │
│ │ │
╘═══════════════════════════╧═════════════════════════════════╛
SBUG - Page 89
╒═══════════╤═════════╤══════════╤══════════╤═══════════════════════╕
│ broAdcast │ Write │ Output │ <number> │ 0 │
│ │ │ Flag │ │ 1 │
│ │ ╞══════════╪══════════╪═══════════════════════╡
│ │ │ Register │ <number> │ <value> │
│ │ │ Timer │ │ ╒═════════════╡
│ │ │ Counter │ │ │ Decimal │
│ │ │ │ │ │ Bcd │
│ │ │ │ │ │ Hex │
│ │ │ │ │ │ binarY │
│ │ │ │ │ │ Float (1) │
│ │ │ │ │ │ Ascii (1) │
│ │ ╞══════════╪══════════╧═════════╧═════════════╡
│ │ │ clocK │ <dd/mm/yy hh:mm:ss [week [day]]> │
│ ╞═════════╧══════════╧══════════════════════════════════╡
│ │ Run-all-cpus │
│ ╞═══════════════════════════════════════════════════════╡
│ │ Stop-all-cpus │
│ ╞═══════════════════════════════════════════════════════╡
│ │ rEstart-cold-all-cpus │
│ ╞═════════╤═════════════════════════════════════════════╡
│ │ run-Xob │ 17 │
│ │ │ 18 │
│ │ │ 19 │
╘═══════════╧═════════╧═════════════════════════════════════════════╛
(1) Floating-point & Ascii units for "broAdcast Write Register" only.
REVISION HISTORY
05-Jan-98 V2.1
1) Supports 512KB RAM/EPROM/Flash EPROM for PCD2.
2) Added ERROR 29: CODE MUST BE MULTIPLE OF xxK FOR FLASH EPROM
and ERROR 30: TEXT/DB MUST BE MULTIPLE OF xxK FOR FLASH EPROM
21-Mar-97 $208
1) PCD1 can now have 13KB extension memory.
2) Now supports PCD6.M3.
3) Added "Serial port for S-BUS MODEM" to "Serial ports for
PC" menu and improved the screen's texts and layout.
4) PCD1 and PCD2 can now have flash eprom (128KB=112KB prog).
5) Added "BreakMode" value to MODEM.DAT file, see 2.7.1.
6) Add note on break mode and the break length, section 2.7.2.
15-Jan-97 $205
1) Added S-BUS "Data" mode selection to "S-Bus communications"
and "Gateway master port" menus.
21-Jun-96 V2.0
01-Nov-95 $199
1) Port 0 can now be used as the gateway port on all PCD types
(was only on PCD6).
16-Oct-95 $198
1) Modifications for PCD1.
2) "Serial port for P800 connection" now called the "Serial
port for PGU connection".
3) Added ERROR 28: GATEWAY NOT SUPPORTED BY PCD1 and
WARNING 5: PGU CONNECTION BAUD RATE IS NOT 9600.
24-Apr-95 V1.9
10-Apr-95 $18C
1) If the PCDCOLOR.DAT file in the PCD Programming Utilities
directory was read only, because it was on a network drive
or had the read-only attribute set, then SCONFIG did not
issue an error message if it tried to update PCDCOLOR.DAT
when the color set was changed (sometimes a brief "Access
denied" message displayed by DOS was visible).
SCONFIG now checks for this and issues "ERROR 27: ACCESS TO
MASTER PCDCOLOR.DAT FILE DENIED", and the prompt "Create
PCDCOLOR.DAT file in the current directory (Y or N) ?" is
displayed. This creates a PCDCOLOR.DAT file in the current
directory which is used instead of the one in the main PCD
programming utilities directory.
13-Mar-95 $18B
1) Added "Auto-answer on" and "Auto-answer off" strings to
"Modem for PCD" menu, see 2.7.
06-Feb-95 $18A
1) Re-designed the main menu and added the new "Gateway
master port" configuration screen, see sction 2.6.
2) Each modem type now has separate PCDReset and PCDInit
strings which are displayed on the "Configure/Modem for
SAIA PCD" menu. These replace the "Reset" and "AnswerOn"
strings of $187, and allow the PC and the PCD to have
different PC and PCD reset and init strings for the same
modem type, if required.
3) WARNING messages are now numbered. Added warnings 3 and 4.
Added ERROR 26.
19-Jul-94 $187
1) SWMR 652: S-BUS mode (Break/Parity) is now selectable from
the "s-Bus communications" screen.
2) Added "Modem for SAIA PCD" screen , changed "Modem type" to
"Modem for PC". 'Modem reset' and 'auto-answer' on strings
can now be chosen for the SAIA PCD.
3) Added selected CPU type description to "S-BUS communications"
screen.
4) Added section 2.6.2 "Important notes on modem configuration".
5) Added "WARNING: PCD'S S-BUS PGU PORT NOT CONFIGURED FOR
PUBLIC LINE MODEM" and "WARNING: PORT COMn DOESN'T EXIST".
12-Nov-93 $179
1) SWMR 575: TS delay, TN delay and Timeout are now ALWAYS used
for S-BUS comms (were only used for modems). Changed text on
"Serial ports" and "s-Bus communications" screens.
24-Sep-93 $175/V1.71
1) SWMR 541 & 542: "Echo=yes/no" now removed from modem
configuration. If the modem echoes command characters
these are now ALWAYS ignored because we don't know if the
modem is in echo on mode or not. Responses from the modem
are now recognized by being delimited with CR & LF, e.g.
<CR><LF>OK<CR><LF>, so they are not confused with command
characters which may be (or may not be) echoed back.
2) "Reset modem" string now displayed on "modem type" menu.
3) SWMR 548: The break length has been modem from the "Modem
type" screen to the "Serial ports" screen. BreakLen has
been removed from the MODEM.DAT file and is now in the
PCDSETUP.DAT file.
09-Jun-93 V1.7
1) New "Hardware and memory" menu. Defines the PCD type and
memory allocation, including extension memory (which was
called data memory).
2) New "s-Bus communications" menu for defining the S-BUS
station number and PGU port.
3) New "Modem type" menu, which selects the modem type from
those defined in the MODEM.DAT file.
4) Graftec code edtor name can now be entered (default SEDIT).
5) Separate serial ports and baud rates can now be selected for
P800, S-BUS and the EPROM programmer.
6) Section 3 Configuration Data removed. This is described in
PG3's source code documentation.
7) New errors 20 to 25.
28-May-92
1) Data memory allocation added for PCD6, completely new
"Memory, PCD, S-BUS" menu.
2) Memory allocation now has 4-digit input fields, to support
values up to 1024K (was max. 999K).
3) New error message "ERROR 19: EXACTLY nKB OF DATA MEMORY MUST
BE ALLOCATED".
4) If the PCDCOLOR.DAT file is not found or invalid, the default
colour set is used if a colour screen is present (monochorome
was used before even on a color screen).
06-Dec-91 $154
1) Baud rate for P800/PGU can now be entered on the "Serial
ports" menu (SWMR 120).
2) "Colour set" screen now shows Graftec editor colours.
3) Now has F1=hyperhelp.
4) Add errors 14 to 18.
06-Oct-91 $153
1) New PCD6.R600 memory module is selectable (512KB, 768KB or
1024KB).
2) Memory allocation now allows code up to 256K lines and text
segment up to 999K characters.
23-Aug-91 $152
1) SWMR 199 and 130: Min. chars per line now 40 (was 80).
2) Change "Memory and PCD type" to "Memory, PCD, S-BUS".
Add "S-BUS station number" to the sub-menu, see 2.7.
New ERROR 13.
3) SGRAF data is no longer in the PCDSETUP.DAT file (moved
to PCDMENU.DAT).
07-Sep-90 V1.4
1) SWMR 121. Can now select 64, 128 or 256K byte memories for
PCD4 (support for PCD7.R1 memory card). Changed text on
memory allocation menu.
22-Nov-89 V1.3
1) Now called SCONFIG, was called SINSTALL. Changed name because
"install" has the wrong meaning, "configure" is a more accurate
description.
2) User selectable Editor and Word processor programs. EXE, COM
or BAT file names can be entered (defaults to SEDIT and PE)
(SWMR 24).
3) Add memory card selection (SWMR 25).
4) Printer configuration now accepts 80 to 200 characters per
line (SWMR 35).
5) Add PCD4/PCD6 selection (SWMR 74)
6) Now works in colour as defined in PCDCOLOR.DAT.
7) Now has colour select menu which selects the colour set for
the entire package. This copies a chosen file (PCDCOLOR.n
to PCDCOLOR.DAT).
8) Now allows selection of COM1, COM2, COM3 or COM4 for PCD and
Eprom Programmer.
9) New default memory maps for PCD6 and PCD4.
10) PCDSETUP.DAT file now contains SGRAF data for D.Lüthi.
11) New format for "List" command output.
02-Dec-88 V1.2
1) INSTALL.DAT install data file now named PCDSETUP.DAT.
2) "pRint setup" command changed to "List the setup".
3) Registered user name now in a pretty box, to match
the main menu.
23-Mar-88 V1.1
1) New text on Memory allocation menu, to briefly describe
how to partition the R511 and R512 RAM cards, which don't
have a full 64K of memory (2.7).
2) Add Registered User name to main menu, shortened text on
main menu to allow it to fit.
3) Install data file format changed. It now contains the
Registered User name and a Package Indicator flag. The
file is also encrypted. The description of this file has
been removed from this document.
4) Text segment size in memory allocation can now be up to
256K characters, 3 digits now allowed (was 2, max. 99K).
5) Data on 'present configuration' screen displayed in
reversed video.
6) Use ENTER instead of ESCape to accept input on any screen,
and return to main menu. All prompts changed to indicate
this.
25-Jan-88 V1.0
1) If line length too long, line wraps around. Used to be
truncated.
2) Command characters displayed in bold video.
3) "eXit" changed to "Quit".
4) "Abort" exits immediately if the setup has not been
changed.
CONTENTS
════════
PAGE
1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . 2
1. INTRODUCTION
════════════════
The PCDSETUP.DAT file contains the "registered user's name" and the
number of the package which has been purchased. This data is encoded
into the file when the customer purchases a copy of the PCD
Programming Utilities.
All programs in the SAIA PCD Programming Utilities package use data
in the PCDDSETUP.DAT file, which must be either in the current
directory or in the directory containing the other programs. The DOS
"SET" command should be used to set environment variable "PCD" to
indicate this directory (e.g. "SET PCD=C:\PCD").
Introduction continued
──────────────────────
Three types of entry fields are used on the menus. All entry fields
are displayed in intensified video to separate them from any text on
the screen.
Movement between entry fields is by the use of the ARROW keys, the
SPACE bar (except when on a "switch" field, see below), the TAB or
or the backtab (<-) keys.
Select field: These are found on the main menu only. This field
allows selection of a sub-menu or execution of a
process. The selected field is highlighted in
reverse video.
Data entered into a data field is checked only when ENTER or ESC is
pressed to leave the sub-menu.
This is the first screen displayed, all the configuration options can
be selected from here.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 MAIN MENU │
├────────────────────────────────────────────────────────────────────────────────┤
│╓──────────────────────────────────────────────────────────────────────────────┐│
│║ U.CROAKED LTD, COFFIN MANUFACTURERS, STIFF STREET, GRAVESEND ││
│╚══════════════════════════════════════════════════════════════════════════════╛│
│ │
│┌ SAIA PCD CONFIGURATION ──────────────────────────────────────────────────────┐│
││ Hardware and memory Select PCD type, memory type and memory allocation ││
││ S-Bus communications Configure the PCD's S-BUS station and PGU port ││
││ MoDem for SAIA PCD Modem for S-BUS PGU port via public line modem ││
││ Gateway master port Configure PCD for use as an S-BUS gateway ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│┌ PERSONAL COMPUTER CONFIGURATION ─────────────────────────────────────────────┐│
││ Serial ports for PC Select the PC's COM ports, baud rates and timing ││
││ Modem for PC Modem for Personal Computer using public line modem ││
││ Printer Define printer page format and control strings ││
││ Editor program names Editor, Graftec code editor and word processor names ││
││ Colour set Select the colours, for colour screens only ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│┌ COMMANDS ────────────────────────────────────────────────────────────────────┐│
││ List configuration List the present configuration on the printer ││
││ Quit Exit configurator, save or discard the configuration ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press ARROW or SPACE to select, ENTER or capital Command letter to execute. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 HARDWARE AND MEMORY │
├────────────────────────────────────────────────────────────────────────────────┤
│ ┌───────────────┐ │
│ PCD processor type . . . │ PCD6.M1/M2/M3 │ │
│ └───────────────┘ │
│ Code/text/DB memory . . 256K Bytes, PCD6.R510/R600 │
│ │
│ Extension memory . . . . 256K Bytes │
│ │
│ │
│ ┌─────┬─────────┬─────────┬─────────┐ │
│ Memory Allocation: │ CPU │ CODE │ TEXT/DB │EXTENSION│ │
│ ├─────┼ K Lines ┼ K Bytes ┼ K Bytes ┤ │
│╓─────── NOTE ────────┐ │ 0 │ 56__ │ 32__ │ 256_ │ │
│║ Changes do not take │ │ 1 │ 0___ │ 0___ │ 0___ │ │
│║ effect in the PCD │ │ 2 │ 0___ │ 0___ │ 0___ │ │
│║ until the "ALLOCATE │ │ 3 │ 0___ │ 0___ │ 0___ │ │
│║ MEMORY" operation │ │ 4 │ 0___ │ 0___ │ 0___ │ │
│║ is done from the │ │ 5 │ 0___ │ 0___ │ 0___ │ │
│║ "Up/download" menu, │ │ 6 │ 0___ │ 0___ │ 0___ │ │
│║ or until "SDNLD /M" │ ├─────┼─────────┴─────────┼─────────┤ │
│║ is executed. │ │TOTAL│ 256K Bytes │ 256KB │ │
│╚═════════════════════╛ └─────┴───────────────────┴─────────┘ │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to select the type, ARROW moves cursor, ESC or ENTER accepts. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
The first, and the most important, item to be configured is the PCD
type. This governs the maximum number of CPUs in the system, and
the memory sizes which are available.
The "extension memory size" should only be set to a value other than
"None" if extension memory is present. Extension memory is always
RAM memory, and contains Texts and Data Blocks 0..7999 (or or 0..4999
for a PCD1, 0..5999 for a PCD2). Mixed EPROM and RAM is allowed on
certain memory cards, with the code/text/DB memory in EPROM, and
extension memory in RAM.
Once the correct memory types have been selected, the memory can be
divided between the CPUs from the "Memory Allocation" box. When the
the cursor is in this box, pressing 'D' restores the default memory
allocation. The default allocation is also selected if the PCD type
or memory size is changed.
SCONFIG - Page 7
17KB RAM Default on-board RAM, with no chip in the USER PROG socket.
32/64/128KB + 13KB @Extension memory@
With 32KB RAM or 64/128KB RAM/EPROM in the USER PROG
socket,
the on-board RAM can be used as 13KB extension memory.
112KB FLASH EPROM
128KB flash eprom chip, 112K available to user program.
32KB RAM Default on-board RAM, with no chip in the USER PROG socket
32/64/128/512KB(*) + 24KB @Extension memory@
With 32KB RAM or 64/128/512KB(*) RAM/EPROM in the USER
PROG socket, the on-board RAM can be used as 24KB
extension memory.
112/448KB FLASH EPROM
128KB or 512KB(*) Flash EPROM chip, 112KB or 448KB is
available for the user program.
(*) To use a 512KB chip, PCD2 hardware revision M or later is needed.
The memory configuration must be loaded into the PCD with the
"ALLOCATE MEMORY" command from the "Up/download" menu, or by using
"SDNLD /M" from the DOS prompt. It is also programmed into EPROM by
the "Program eproms" utility (SPROM). Allocating memory *DELETES*
all user programs in the PCD.
SCONFIG - Page 8
Extension memory is additional RAM memory for storing Texts and Data
Blocks. The standard text/DB memory segment holds TEXTs and DBs
0..3999. Extension memory holds TEXTs and DBs 4000..7999 (or 4000..
4999 for a PCD1, 4000..5999 for a PCD2). TEXTs and DBs in extension
memory are accessed faster than those stored in the text memory
segment, and so are ideal for storing large arrays for data logging
or user program configuration.
The PCD6.R1xx public memory module must be used, with the PCD6.R600
memory card. This can contain RAM or EPROM for code and text/DB memory,
and RAM for extension memory. The amount of extension memory is
selected in 256KB steps because one pair of memory chips holds 256KB.
The PCD7.R300 memory module must be used. This contains either RAM or
EPROM for the code and text/DB segments, freeing up the 172KB or RAM
on the CPU card for use as extension memory.
The PCD1 has an additional memory socket (marked "USER PROG") which
accepts a RAM, EPROM or Flash EPROM chip. If this chip is present,
then the on-board RAM provides 13KB of extension memory.
The PCD2 has an additional memory socket (marked "USER PROG") which
accepts a RAM, EPROM or Flash EPROM chip. If this chip is present,
then the on-board RAM provides 24KB of extension memory.
SCONFIG - Page 9
This screen defines the S-BUS station number, and configures an S-BUS
PGU port for connection to a Personal Computer running the SAIA PCD
Programming Utilities. The S-BUS configuration is stored in the PCD's
public memory.
Each S-BUS station must have a unique station number (0..254). If the
PCD does not use S-BUS protocol, set the station number to 255. If
no S-BUS PGU port is required, set all the "PGU PORT" switches to
"None", all other entry fields are then ignored.
The "PGU Port Allocation" texts are different for each PCD type.
│ ┌─────┬──────────┐
│ PGU Port Allocation: │ CPU │ PGU PORT │
│ ├─────┼──────────┤
│ PCD1: Select port 0 or 1. │ 0 │ None │
│ Only port 1 works with a └─────┴──────────┘
│ public line modem.
SCONFIG - Page 10
Timing (if 0, then the default value is used, see next page):
The above three values should be set to the minimum values required by
the hardware. If (TS delay + TN delay) is greater than about 500ms
then the "Debug" program WILL NOT WORK. It polls the PCD every 500ms,
and all the processing time is taken up by these delays. Timeout should
also be set as low as possible because this affects the processing of
key depressions if the PCD is off line.
┌───────┬─────────────────────────────┐
│ BAUD │ TIMEOUT* TS DELAY TN DELAY │
├───────┼─────────────────────────────┤
│ 110 │ 15000 27 14 │
│ 150 │ 9000 20 10 │
│ 300 │ 5000 20 10 │
│ 600 │ 3000 5 3 │
│ 1200 │ 2000 3 2 │
│ 2400 │ 1000 2 1 │
│ 4800 │ 500 2 1 │
│ 9600 │ 250 1 1 │
│ 19200 │ 200 1 1 │
│ 38400 │ 200 1 1 │
└───────┴─────────────────────────────┘
* For S-BUS Data Mode, all TIMEOUT values are 50% longer, e.g.
250=375.
Before configuring S-BUS, define the correct PCD type from the
"Hardware and memory" menu. S-BUS configuration does not take effect
until the "CONFIGURE S-BUS" command is done from the "Up/download"
menu, or until "SDNLD /S" is executed from the DOS prompt. The
Personal Computer also needs to be configured for S-BUS from the
"Serial ports for PC" screen.
SCONFIG - Page 12
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 MODEM FOR SAIA PCD │
├────────────────────────────────────────────────────────────────────────────────┤
│╓──────────────────────────────────────────────────────────────────────────────┐│
│║ If using a public line (dial-up) modem on the PCD's S-BUS PGU port, set the ││
│║ "S-BUS communications" screen's "PGU via Public Line Modem" flag to "Yes". ││
│║ Then select from this screen the type of modem which will be connected to ││
│║ the PCD. The modem configuration is defined in a file called MODEM.DAT, ││
│║ which can be edited with any ASCII text editor such as PE or EDIT. Only two ││
│║ control strings are needed, one to reset the modem, and another to initialize││
│║ the modem into "auto-answer mode" so that it will answer an incoming call. ││
│║ If the PCD contains RAM, these strings must be loaded into the PCD using the ││
│║ "CONFIGURE S-BUS" command from the "Up/download" menu, or with "SDNLD /S" ││
│║ from the DOS prompt. If the PCD contains EPROM memory, then new EPROMs must ││
│║ be programmed. ││
│╚══════════════════════════════════════════════════════════════════════════════╛│
│ ┌─────────────────┐ │
│ SAIA PCD modem name │ Factory Default │ │
│ └─────────────────┘ │
│┌ PCD MODEM COMMAND STRINGS ───────────────────────────────────────────────────┐│
││ Reset modem "ATZ\r" ││
││ Auto answer on "ATM0E0S0=2S25=250\r" ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to select modem type, ENTER or ESC accepts. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
If using a public line (dial-up) modem on the PCD's S-BUS PGU port,
use this screen to select the type of modem which will be connected
to the PCD. Modem configurations are defined in the MODEM.DAT file.
If this file does not contain your modem type, then it can be edited
with any ASCII text editor such as PE or EDIT.
Only two control strings are needed, one to reset the modem and
disable auto-answer mode, and another to enable auto-answer mode
so that the modem will answer an incoming call and connect to the
remote modem. To initialize the modem, the "reset" string is sent
first, followed 3 seconds later by the "auto-answer on" string.
When using a public line modem, you must also set the "PGU via
Public Line Modem" flag on the "S-BUS communications" screen to
"Yes", and "S-BUS mode" on the same screen to "Break" (unless your
modems can transfer the parity bit).
SCONFIG - Page 13
┌─────┐ ┌─────┐
│ PCD │ │ etc.│ Up to 4 S-BUS masters
└──┬──┘ └──┬──┘
│ │
┌──┴───────┴──┐<─── Up to 4 slave #gateway# ports
│ PCD gateway │
│ station │
└──────┬──────┘<─── Master gateway port
│
┌────────┬───┴────┬────────┬──── // ───┐
┌──┴──┐ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐ ┌──┴──┐
│ PCD │ │ PCD │ │ PCD │ │ PCD │ ... │ etc.│ S-BUS slave network
└─────┘ └─────┘ └─────┘ └─────┘ └─────┘
The baud rates of the slave and master gateway ports can be selected
independently, as can the S-BUS signalling mode (Break/Parity).
SCONFIG - Page 14
Gateway port: This field defines the port number of the master
gateway port, 0..3. If "None" is chosen, no master
gateway port is configured and all other fields are
ignored.
Port on CPU: This field is only shown for a PCD6. It defines which
CPU has the master gateway port.
Baud rate: The S-BUS network's baud rate. It does not need to be
the same as the slave gateway port's baud rate.
┌────────────┬──────────────────────────────────────────────────────┐
│ Baud rate │ 110 150 300 600 1200 2400 4800 9600 19200 38400 │
│ Timeout ms │ 15000 9600 4800 2400 120 600 300 150 75 40 │
└────────────┴──────────────────────────────────────────────────────┘
The slave gateway port can be configured either as the S-BUS PGU port
(see section 2.4), or by using SASI instructions.
The S-BUS PGU port is always linked to the master gateway port. This
means that if the S-BUS PGU port receives a telegram which is not for
the gateway station itself (the address doesn't match), it will be
automatically re-transmitted via the master gateway port.
With "SASI":
"UART:<baud_rate>[,<timeout>,<ts-delay>,<tn-delay>];"
"MODE:GS<sig_mode>;DIAG:<flag>,<register>"
<baud_rate> 110|150|300|600|1200|2400|4800|9600|19200|38400
<timeout> Not used, should be blank or 0
<ts-delay> Training sequence delay in ms, blank or 0=use default
<tn-delay> Turnaround time in ms, blank or 0=use default
<sig_mode> 0=break, 1=parity
<flag> First diagnostic flag, e.g. F100
<register> Diagnostic register, e.g. R32
The gateway station is always the master of the S-BUS network, and
like the other masters it can exchange data through the master
gateway port using the STXM and SRXM instructions. To do this, the
port must be configured for the new GM mode (Gateway Master mode)
using the SASI instruction.
"MODE:GM,<dest_reg>;DIAG:<flag>,<register>
Note that the UART definition and MODE options are not specified,
these are defined by the master gateway port's configuration. The
"GM" SASI can only be executed by the CPU which owns the master
gateway port.
SCONFIG - Page 17
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 MODEM FOR PC │
├────────────────────────────────────────────────────────────────────────────────┤
│ ┌──────────────────┐ │
│ PC modem type . . . . │ Hayes Compatible │ │
│ └──────────────────┘ │
│┌ PC MODEM COMMAND STRINGS ────────────────────────────────────────────────────┐│
││ Reset modem . . . . . "ATZ\r" ││
││ Initialize modem . . not defined ││
││ Dial command prefix . "ATDT" ││
││ Dial command suffix . "\r" ││
││ Hangup command . . . "ATH0\r" ││
││ Select command mode . "~~~+++~~~" ││
││ 500ms delay character "~" ││
││ Auto-answer on . . . "ATS0=1\r" ││
││ Auto-answer off . . . "ATS0=0\r" ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│┌ RESPONSES FROM PC MODEM ─────────────────────────────────────────────────────┐│
││ OK response . . . . . "OK" ││
││ Connected response . "CONNECT" ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│┌ MISCELLANEOUS ───────────────────────────────────────────────────────────────┐│
││ Connect timeout (secs) 45 Dial retries 3 ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to select modem type, ENTER or ESC accepts. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
When a modem is selected, values for that modem are read from the
MODEM.DAT file and displayed.
The baud rate for the modem, delays and timeouts, are defined on
the "Serial ports for PC" menu.
SCONFIG - Page 18
Auto-answer on This string must put the modem into auto-answer mode
so that it will automatically answer an incoming call
and connect to the remote modem. This is used to
enable "auto-answer mode". This string usually loads
a register in the modem (S0) with a ring count. When
the ring count is non-zero, the modem answers an
incoming call on the defined number of rings.
Auto-answer off This must disable auto-answer mode, so that the modem
will not automatically answer an incoming call. This
string usually sets the modem's ring count register
(S0) to 0.
Strings can contain escape sequences for the common ASCII control
characters or for hex values in strings. These are preceded by a
backslash '\':
\r 0x0D CR carriage return
\n 0x0A LF line feed
\a 0x07 BEL bell
\b 0x08 BS backspace
\f 0x0C FF form feed
\t 0x09 HT tab
\v 0x0B VT vertical tab
\xhh 0xhh hex value \x00..\xFF
\\ 0x5C \ backslash
\" 0x22 " quotation mark
Do NOT initialize the modem to return single digit result codes (e.g.
"0"), these will not work. String values, enclosed by CR/LF characters
must be returned (see Hayes command "V1").
Some modems have the ability to detect if the line is busy (engaged)
or there is no dial tone. If the modem has this capability, it is
useful to enable it with the "Init" string. This speeds up the dial
retries, because the dialler will be able to detect these conditions
instead of waiting for the dial timeout period to elapse.
"Break mode" can be unreliable when used with some modems, because
they do not always pass the break signal directly through to the
remote PCD. You may need to experiment with the break length to
obtain optimum performance. To do this, connect to the remote modem
and run the Debug program (SBUG) and display a refreshed register.
Observe the modem's TX/RX lamps which should be continuously flashing.
If they occasionally stop for a few moments it means that a comms
error has occurred, comms continues after a retry. If many retries
occur, quit SBUG and change the break length from the "Serial ports
for PC" screen. When you run Debug again, it will use the new break
length. Other S-BUS timing values can also be adjusted in this way.
SCONFIG - Page 21
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 SERIAL PORTS FOR PC │
├────────────────────────────────────────────────────────────────────────────────┤
│╓──────────────────────────────────────────────────────────────────────────────┐│
│║ Up to four serial ports (COM1..COM4) may be present in your PC. Select the ││
│║ ports and baud rates for PC to PCD communications and the EPROM Programmer. ││
│║ Ports can be shared if required. ││
│╚══════════════════════════════════════════════════════════════════════════════╛│
│ Serial ports detected . . . . . . . . COM1 COM2 COM3 │
│ ┌──────┐ │
│ Serial port for PGU connection . . . . │ COM3 │ Baud rate 9600 │
│ └──────┘ │
│ Serial port for S-BUS connection . . . COM3 Baud rate 9600 │
│ │
│ Serial port for S-BUS MODEM connection COM3 Baud rate 9600 │
│ │
│ Serial port for EPROM Programmer . . . COM1 Baud rate 9600 │
│ │
│┌ S-BUS TIMING FOR PC ─────────────────────────────────────────────────────────┐│
││ TS delay in ms (0, or 1..15000) 0____ ─┬─ 0 = Use minimum default delays ││
││ Timeout in ms (0, or 1..15000) 0____ │ ││
││ TN delay in ms (0, or 1..15000) 0____ ─┘ ││
││ Break length (characters, 1..25) 4_ ─── For S-BUS "Break" mode only ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to select the port, ARROW moves cursor, ESC or ENTER accepts. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
2.9 Printer
────────────
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 PRINTER │
├────────────────────────────────────────────────────────────────────────────────┤
│ ┌─────┐ │
│ IBM compatible printer . . . . . . . . . │ Yes │ │
│ └─────┘ │
│ Automatic line feed after carriage return No ─┌───┬────────┐ │
│ A│ │ │ │
│ Use form feed character at end of page Yes ─├───┼────────┤ │
│ │ │ Page │ │
│ A) Blank lines at top of page . . (0..20) 0_ B│ │ Body │ │
│ │ │ │ │
│ B) Lines for page body . . . . (25..255) 60_ ─├───┼────────┤ │
│ C│ │ │ │
│ C) Blank lines at end of page . . (0..20) 0_ ─└───┴────────┘ │
│ │ D │ E │ │
│ D) Spaces for left margin . . . . (0..20) 0_ │
│ │
│ E) Characters per line . . . . (40..255) 132 │
│ │
│ Initialization string (Hex) __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │
│ │
│ Deinitialization string (Hex) __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to change (Yes/No), ARROW moves cursor, ESC or ENTER accepts. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
This screen defines the printer type, its page size and initialization
or de-initialization strings which should be sent to the printer
before and after printing. See section 3 for details of each item.
The page size is shown in the diagram on the right of the screen. The
sizes of items (A) to (E) can be given. The initailization string is
typically used to set the printer to compressed pitch or to set the
margin or page length etc. The deinitialsation string could reset the
printer to normal pitch etc.
The SAIA PCD Programming Utilities uses parallel printer LPT1. If you
have a serial printer, a serial port can be used. Configure the port
and redirect printer output with the DOS "MODE" command. Put the
"MODE" commands in your AUTOEXEC.BAT file. Refer to your "DOS User's
Guide and Reference" manual for details.
MODE COM3:9600,E,8,1,P (This sets the baud rate etc. for COM3)
MODE LPT1=COM3 (Redirects LPT1 printer output to COM3)
2) Use the DOS "PRINT" command from the "Ms-dos command" menu (which
ignores the init/de-init strings) to print using the default
format of your printer, and the utilities' print commands to
print using the format controlled by the init/de-init strings.
SCONFIG - Page 25
Enter the names of your preferred instruction list code editor and
your word processor (text editor). These programs are invoked from
the PCD Programming Utilities main menu by the "Edit" and "Word
processor" commands, and from the Graftec editor's "Edit Code"
command.
For the "Name of the Code Editor" enter "SEDIT.EXE" if you want to
use SAIA's dedicated instruction list editor, or enter the name of
any ASCII text editor (for example "EDIT.COM" or "PE.EXE") if you
prefer to edit source files using a general purpose text editor.
Other editors may be available from SAIA in the future.
For the "Name of Word Processor" enter the name of your favorite
general purpose text editor (e.g. "EDIT.COM" or "PE.EXE"). This
editor can be used to edit ASCII files such as specifications and
documentation files. The Graftec editor is usually "SEDIT.EXE", but
if left blank then SGRAF's internal (simple) editor is used.
Program names can contain a drive and/or path name. If the complete
drive, path name and file type is given (e.g. C:\PCD\SEDIT.EXE), it
speeds up the loading of the programs. Program names can be those
of a .COM, .EXE or .BAT file.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD OFFLINE CONFIGURATOR V2.1 COLOUR SET │
├────────────────────────────────────────────────────────────────────────────────┤
│ THIS IS THE HEADER COLOUR COLOUR SET FILE: PCDCOLOR.0 │
│╓──────────────────────────────────────────────────────────────────────────────┐│
│║ Selects the colour set for a colour screen, or highlighting for a monochrome ││
│║ screen. The selected colour set is demonstrated on this display. The colour ││
│║ set is defined in files PCDCOLOR.0 to PCDCOLOR.9. The colour file is copied ││
│║ into file PCDCOLOR.DAT when a colour set is chosen. PCDCOLOR.9 is a custom ││
│║ colour definition file, which can be edited to change the colours. ││
│╚══════════════════════════════════════════════════════════════════════════════╛│
│ ┌───────────────┐ │
│ Menu item This is a menu item. │ This is a box │ │<───────────────14 │
│ └───────────────┘ ▓ 1 │ │
│ Cursor This is the menu cursor. ┼ 2 │ │
│ ░ 3 │ │
│ ┌────────────── THIS IS A WINDOW ───────────────┐ ├─────┬─────┐ │ │
│ │ This is a window text, and a window Cursor │ ┼ 4 ┼ 5 ┼ 6 │ │
│ └───────────────────────────────────────────────┘ ░ 7 ░ 8 ░ 9 │ │
│ ┼ 10 ┼ 11 ┼ 12 │ │
│ This is the help text colour, and the help item colour. ├─────┴─────┘ │ │
│ ░ 13 │ │
│ This is the colour of normal text. ┼ 14 │ │
│ └─────────────────1 │
│ ERROR MESSAGE COLOUR │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to select colour set, ESC or ENTER accepts. │
│ Status line colour: Data F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
The colour set screen demonstrates the colours in the selected colour
set. Other colour sets are selected by pressing the SPACE key. The
colour set can't be changed if you have a monochrome screen. If you
have an electro-luminescent or LCD display it may be emulating a
colour screen, and selecting the correct colour set may improve display
readability. For example, some LCD displays do not have blinking video,
so colour set 5 should be used.
Several colour sets have been provided. These are stored in colour set
files named PCDCOLOR.n, where 'n' is a digit 0..9, e.g. PCDCOLOR.1.
The name of the selected color set file is displayed at the top of
the screen. Pressing the SPACE key loads the next PCDCOLOR.n file and
displays its colours.
The color set used by the utilities is always read from the file named
PCDCOLOR.DAT. If this file exists in the current directory then it is
used, otherwise the file in the PCD Programming Utilities directory
is used.
Press ESC or CR to accept the selected colour set. When a new colour
set
is chosen, the selected PCDCOLOR.n file is copied into the PCDCOLOR.DAT
file in the PCD directory on exit of SCONFIG.
SCONFIG - Page 27
NOTE: Do *NOT* edit anything else in this file, and do not change the
order of the hex numbers. The default colour set (CGA) is used if the
file is invalid.
Each colour set file has been designed for use with a particular type
of monitor:
S-BUS COMMUNICATIONS
Station number (0..254, 255=none) 0
┌─────┬──────────┐┌─────┬──────────┐
PGU Port Allocation: │ CPU │ PGU PORT ││ CPU │ PGU PORT │
├─────┼──────────┤├─────┼──────────┤
PCD6.M2 is required. │ 0 │ 0 ││ 4 │ None │
│ 1 │ None ││ 5 │ None │
│ 2 │ None ││ 6 │ None │
│ 3 │ None ││ │ │
└─────┴──────────┘└─────┴──────────┘
SERIAL PORTS
Serial port for PGU connection . . . . COM3 Baud rate 9600
Serial port for S-BUS connection . . . COM3 Baud rate 9600
Serial port for S-BUS MODEM connection COM3 Baud rate 9600
Serial port for EPROM Programmer . . . COM1 Baud rate 9600
S-BUS timing for PC:
TS delay in ms (0, or 1..15000) 0
Timeout in ms (0, or 1..15000) 0
TN delay in ms (0, or 1..15000) 0
Break length (characters, 1..25) 4
SCONFIG - Page 29
PRINTER
IBM compatible printer . . . . . . . . . Yes
Automatic line feed after carriage return No
Use form feed character at end of page Yes
A) Blank lines at top of page . . (0..20) 0
B) Lines for page body . . . . (25..255) 66
C) Blank lines at end of page . . (0..20) 0
D) Spaces for left margin . . . . (0..20) 0
E) Characters per line . . . . (40..255) 132
Initialization string (Hex) None
Deinitialization string (Hex) None
2.13 Quit
──────────
├────────────────────────────────────────────────────────────────────────────────┤
│ QUIT: Configuration altered, save the changes (Y, N or ESC) ? _ │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
Pressing 'Y' will save the changes and exit. Pressing 'N' exits
WITHOUT saving the changes. ESC aborts the "Quit" command and
remains on the Configurator menu.
If the configuration has not been changed, the above prompt is not
displayed, and an immediate exit is made. No files are updated.
SCONFIG - Page 30
Not enough memory to load the help text. Should never occur.
The help file is not the one supplied with this version of
the Programming Utilities.
ERROR 20: CPU WITH TEXT OR EXTENSION MEMORY MUST HAVE CODE
ERROR 25: PCD6.M5 ONLY PORT 2 (RS-232) SUPPORTS PUBLIC LINE MODEM
Only this port has the necessary control lines for use with
a public line modem.
Warning messages
────────────────
The serial port is not present. The available ports are shown
A COM port which is not present should only be selected if
the PCDSETUP.DAT file is to be used on another machine.
WARNING 2: PCD'S S-BUS PGU PORT NOT CONFIGURED FOR PUBLIC LINE MODEM
Only 9600 baud should be used for the current default PGU
port connection. This menu allows it to be changed so that
the baud rate could be increased in the future.
REVISION HISTORY
05-Jan-98 V2.1
21-Jun-96 V2.0
24-Apr-95 V1.9
06-Feb-95 $18A
1) Password entry is now prompted for if data blocks are to
be read or written because this uses telegrams which are
not part of the reduced protocol.
2) Added "ERROR 29: VALUES PER LINE RANGE IS 1..256".
05-Jul-94 $189
1) User-defined output file formats and data separators.
The number of values per line in the .DBK file can now be
defined on the SDAT menu.
2) A new program called SDATFORM.EXE has been written.
This converts a .DBK file into a user-defined format for
reading by a database or spreadsheet package (e.g. Excel).
See section 9.
29-Nov-93 $17A
1) When the "LOAD DATA" operation is selected, the lower part
of the screen (which contains entry fields use only by the
"SAVE DATA" operation) is now blanked.
16-Nov-93 $179
1) Add "ERROR 28: OUT OF TEXT/EXTENSION MEMORY ON DB xxxx".
In previous versions then "ERROR 22: COMMAND NOT ACCEPTED
(NAK RESPONSE)" was displayed when there was not enough
memory to create a new DB. The new error 28 now gives a
a better description of the error.
21-Jun-93 $171
1) SDAT can now be run from the DOS prompt as well as being
menu-driven, see section 2.
09-Jun-93 V1.7
1) Now handles DBs 4000..7999 in extension memory.
2) Works with S-BUS and modems.
3) Can now abort the transfer of large data blocks by
pressing ESCape.
4) Load/save DBs now works much faster.
5) New error messages 21 to 27.
06-Dec-91 $154
1) Now displays "hyperhelp" instead of ASCII help file.
2) Added errors 19 and 20.
10-Sep-91 $152
1) No SDAT.DAT file now, stores data in PCDMENU.DAT.
06-Oct-90 V1.4
1) Can now load/save Data Blocks.
2) Add sections 6.1 - 6.3.
3) Add errors 15 to 18, change error 6 text.
1. INTRODUCTION . . . . . . . . . . 1
3. THE MENU . . . . . . . . . . . 2
7. ERROR MESSAGES . . . . . . . . . 9
8. IMPORTANT NOTES . . . . . . . . . 12
1. INTRODUCTION
════════════════
This program (SDAT.EXE) can be used to save and restore the values of
Registers, Counters, Timers, Flags, Inputs, Outputs and Data Blocks.
It can also read a file containing user defined data, and load it
into the PCD. This feature can be used to re-configure a program or
to provide a new "recipie" etc.
The SAVE DATA operation reads element values from the PCD and stores
them in an ASCII data file (.DBK).
The LOAD DATA operation reads an ASCII data file (.DBK) and loads the
element values into the PCD. The data file can be created either by
the SAVE DATA operation or by using any word processor (PE etc).
SDAT - Page 2
Examples:
SDAT (invokes menu-driven SDAT)
SDAT /R50 /I100 (invokes menu-driven SDAT, with 50 R/T/C
per line, and 100 I/O/F)
SDAT C:\DATA1 (loads data from file C:\DATA1.DBK)
SDAT C:\DATA1 R0-4095H
(saves all registers to file C:\DATA1.DBK
in hex)
SDAT ALLDATA R0-4095 C0-1599 F0-8191
(saves all R/T/C/F to file ALLDATA.DBK in
the current directory)
SDAT can also be invoked from the PCD Programming Utilities main menu
using the "Transfer data" command.
Execution examples:
Reading data...
Writing to file...
Operation complete
C:\WORK>SDAT TEST
Verifying file...
Writing data to PCD...
Operation complete
SDAT - Page 3
SDAT returns the following status values to DOS when invoked from
the DOS prompt. A non-zero value means that the operation failed.
SDAT will have displayed an error message on the screen before
exiting. The return value can be checked by using ERRORLEVEL in a
batch file.
0 Operation successful
1 Invalid command line parameter
2 Failed, communications or other error
3 Aborted with Ctrl+C or ESC
SDAT - Page 2
3. THE MENU
============
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD DATA LOADER V2.1 │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│┌──────────────────────────────────────────────────────────────────────────────┐│
││ Operation, SPACE to select LOAD DATA: Data file -> PCD ││
││ ││
││ Data file name . . (.DBK) Q:TEST________________________________________ ││
│└──────────────────────────────────────────────────────────────────────────────┘│
│ │
│┌──────────────────────────────────────────────────────────────────────────────┐│ ┐
││ ADDRESS RANGES FOR THE "SAVE DATA" OPERATION ││ │
│├──────────────────────────────────────────────────────────────────────────────┤│ ├─ This section is
││ ││ │ visible only
││ Registers . . (R 0..4095) _____ 4095_ Register units Decimal ││ │ when the "SAVE
││ ││ │ DATA" operation
││ Counter/Timers (C 0..1599) _____ 1599_ R|T|C|DB values per line 5__ ││ │ is selected
││ ││ │
││ Flags . . . . (F 0..8191) _____ 8191_ I|O|F values per line 10_ ││ │
││ ││ │
││ Outputs/Inputs (O 0..8191) _____ _____ ││ │
││ ││ │
││ Data Blocks . (DB 0..7999) 0____ 7999_ DB units . . . Decimal ││ │
│└──────────────────────────────────────────────────────────────────────────────┘│ ┘
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Press SPACE to select operation. ARROW keys move, ENTER executes, ESC exits. │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
The cursor is moved between the entry fields on the menu using the
ARROW, TAB or BackTab keys. Pressing ESCape exits to DOS or to the
PCD Programming Utilities menu. Pressing <CR> (Enter) executes the
selected operation. Function key F1 displays the help file SDAT.HLP.
The operation must be selected first by moving the cursor onto the
"Operation" field and using the SPACE bar to select:
The ADDRESS RANGES FOR "SAVE DATA" OPERATION box, on the lower part
of the screen, is only visible if the "SAVE DATA" operation is
selected. The address range entry fields are not used by the "LOAD
DATA" operation.
Before executing the SAVE DATA operation, the start and end addresses
of each element type to be saved must be entered on the menu. To
exclude an element type from being saved in the data file, leave the
start address blank. If the start address is blank, the end address
is ignored.
The units for representing the values of Registers and Data Blocks
saved in the data file can be selected as decimal, hex or floating
point. For floating point units, if the value is not a valid floating
point number, then it is stored in decimal. Timers and Counters are
always saved in decimal.
The number of values per line for 32-bit values and for boolean
values can also be entered.
Data Blocks may or may not be present in the PCD's memory. SDAT
must read the PCD's memory to determine if the Data Block exists.
The start and end Data Block numbers should be set to the smallest
possible values, otherwise SDAT loses time examining non-existant
Data Blocks. It can take several minutes to check for the existence
of 8000 Data Blocks!
SDAT - Page 4
Before data can be loaded into the PCD, a valid data file (.DBK) must
be created. This can either be created by the SAVE DATA operation, or
it can be edited using any ASCII word processor (PE etc). The format
of the data file is described in section 6.
The data file is verified before any data is loaded into the PCD.
If an invalid line is found in the data file, an error message is
displayed (which shows the line number) and the LOAD DATA operation
is aborted. No data from an invalid data file is loaded.
Data is downloaded into the PCD in the same order that it is defined
in the data file. The download of new data is not synchronized with
the execution of the program. It may be necessary to define elements
in a certain order so that the program in the PCD will run correctly
as the data is being downloaded. For example, a Flag could be set
which is read by the program and indicates that new data has been
downloaded. When this Flag is set, the program can copy the data into
working Registers or Flags, reset the Flag, and continue processing
using the new data. Here is an example of a data file and program
which illustrates this:
The program:
...
STH F 100 ; IF NEW DATA DOWNLOADED
CFB H 100 ; CALL FB TO COPY DATA INTO WORKSPACE
RES F 100 ; CLEAR THE NEW DATA DOWNLOADED FLAG
...
When a new Data Block is loaded, a Flag can be set to notify the
program, which can then copy the data block into Registers using
the GET instruction. For example:
...
STH F NEWDATA ; IF A NEW DATA BLOCK IS AVAILABLE
JR L NODATA
GET DB 100 ; READ IT INTO THE WORKING REGISTERS
R WORK
RES F NEWDATA ; AND RESET THE DATA AVAILABLE FLAG
NODATA:
...
SDAT - Page 5
The data file (default type .DBK - meaning Data Block) is an ASCII
file which contains the element type, address and a set of values
to be loaded. Values can be in any units - decimal (the default),
hex, binary, ASCII. Floating point is also supported for Registers
and Data Blocks. Individual elements can be defined with their own
values, or a set of elements can be defined with a single value
(except for Data Blocks). The data file can also contain comments
and blank lines.
The order of the data in the file is unimportant, although only one
type can be defined per line.
6.1 Elements
─────────────
The format for R|T|C|I|O|F values in the ".DBK" file is like this:
Where:
R 0: 0 1 2 3 4 5 ; R 0 = 0, R 1 = 1, R 2 = 2, R 3 = 3 etc.
; INVALID EXAMPLES
Where:
6.3 Units
──────────
Binary End the binary number (1's & 0's) with 'q' or 'Q'
7. ERROR MESSAGES
══════════════════
A file name (.DBK) is required for both the save and the
load operations.
The Data Block must already exist in the PCD's memory before
data can be loaded into it. SDAT cannot create new Data
Blocks. This can only be done by the assembler or debugger.
The address may be in use as a TEXT, since Texts and Data
Blocks share the same addresses.
The Data Block is not the same size as the existing DB.
The size cannot be changed if the CPU is running because it
requires a "Restart Cold" to register the new DB size.
8. IMPORTANT NOTES
═══════════════════
Inputs and Outputs share the same addressing space, although each has
a unique address. SDAT has no way of knowing which addresses are Inputs
and which are Outputs. Therefore, Inputs are saved as Outputs 'O' in
the data file. It is not possible to download the state of Inputs into
the PCD, writes to Inputs are ignored.
These also share the same addressing space. SDAT treats these as the
same elements, C 100 references the same element as T 100. However,
if Timers are loaded with new values, they will immediately begin
decrementing. Which are Timers and which are Counters is defined by
the DEFTB instruction executed by CPU 0.
Data transfers can be done when the CPU is in any mode (Run, Stop,
Halt, Conditional Run or Conditional Stop). If any CPU is in Run
when loading new data into the PCD, ensure that its program is not
affected as the new data is downloaded, see section 5.
Tiny conversion errors may occur with floating point values if they
are uploaded from the PCD and converted from binary representation
into ASCII for the data file. If the data file is re-loaded into the
PCD it is converted back from ASCII into binary. During the convertion,
the least significant bit of the 32-bit precision value may be lost.
For example, this may change a value of 2.5 to 2.4999999. This happens
because the binary representation of a decimal floating point number
can never be exact (unless we had an infinate number of bits for the
value). These errors are so small that they can normally be ignored.
Data Blocks
Data Blocks may or may not be present in the PCD's memory. SDAT
must read the PCD's memory to determine if the Data Block exists.
The start and end Data Block numbers should be set to the smallest
possible values, otherwise SDAT loses time examining non-existant
Data Blocks. It can take over one minute just to check for the
existence of 4000 Data Blocks.
SDAT - Page 13
The format of the ".DBK" file created by SDAT may not be suitable
for some applications. For example, it cannot be read into a spread-
sheet program such as Excel, and cannot be easily processed by a
database package. For this reason, the DBK file format program
SDATFORM.EXE has been provided. This utility reads and processes a
".DBK" file, created when SDAT reads data from the PCD, inserts a
user-defined delimiter between data values, and creates a new ".OUT"
file.
SDATFORM will only work on files created by SDAT. It may not work on
files created manually by a user with an ASCII text editor, because
the format of manually entered files is slightly different and is
less consistant.
Run the program from the DOS prompt (or the "Ms-dos command" menu):
>SDATFORM ; TEST
SDAT - Page 14
REVISION HISTORY
05-Jan-98 V2.1
21-Jun-96 V2.0
24-Apr-95 V1.9
09-Jun-93 V1.7
1) /E and /NE switches, Extension/No Extension (was /D /ND).
2) Handles new TFR and CPBI instructions.
3) Disassembles new encoded indirect LAN texts.
26-May-92
1) New /D and /ND switches to control disassembly of data
segment.
2) Turning on a disassebly control switch /C (Code), /T (Text)
or /D (Data) now automatically turns all the others off.
E.g. SDISASM FILE /T disassembles only the Text.
SDISASM FILE /C/D disassaembles the code and data, this is
the same as SDISASM FILE /NT.
06-Dec-91 $154
1) Can now disassemble new DATA segment.
04-Oct-90 $139
1) Empty texts "" now listed (SWMR 138).
2) Now disassembles Data Blocks. Invalid Data Blocks are shown
as texts.
3) Added "Error 19: Invalid data block" and "Error 68: Invalid
data block number".
02-Mar-90 $132
1) Now converts binary LAN texts into ASCII format and
inserts the $LAN..$ENDLAN directives.
22-Nov-89 V1.3
1) Allow start and end addresses to be given so that small
sections of the file can be disassembled. This prevents
huge .DSR files being created, which are too big to be
assembled. Added new switches to allow only the code or the
text to be disassembled:
/C /NC Code NoCode
/T /NT Text NoText (SWMR 68)
2) Gives help if invoked with a bad command line from DOS.
3) Removed PG1 format from DLS output.
4) Now disassembles faster due to better file buffering.
5) Added "Invalid address" error and re-numbered the error
messages.
02-Dec-88 V1.2
Changed sign-on format to match Assembler:
Disassembling: file
To: file
22-Mar-88 V1.1
1) Allow either '/' or '-' characters as switch delimiters
(2.0).
2) Missing or invalid install data file is now a fatal
error, add "Fatal error 13: Improper installation"
(4.1).
3) Remove Warning 1 (Section 4.3 removed).
4) Add Registered User name to listing and source format
output (5.1 and 5.2).
25-Jan-88 V1.0
Changed error messages 43, 58, 60, 61. All error messages
now lower case (4.2).
CONTENTS
========
PAGE
1 OVERVIEW 2
4 ERROR HANDLING 5
1. OVERVIEW
============
Procedure:
Where:
SDISASM FRED
Disassemble only the code in file FRED.PCD, and send the listing
to the printer:
SDISASM FRED /P /C
Invocation example:
C:\>SDISASM FRED
C:\>_
SDISASM - Page 5
Limitations:
- Only one output file is produced. This file may be very large
because it will contain all the code and texts in the program.
If the source file produced is too big, the assembler SASM
will not be able to re-assemble it (depending on personal
computer memory size). To overcome this problem, use the start
and end addresses, and the switches, to create several smaller
files.
4. ERROR HANDLING
==================
If SDISASM is invoked from DOS, disk read and write errors will be
preceded by the standard DOS disk error prompt, for example:
Pressing 'A' causes a return to DOS, closing any output file, perhaps
leaving a partly written output file on the disk, the printer deinit-
ialisation string is NOT sent to the printer. Pressing 'R' will retry
the disk operation, allowing recovery. Pressing 'I' causes a return
to the disassembler program, which will display its error message,
close and delete the output file and exit to DOS.
If SDISASM is invoked from the menu, DOS disk error handling is dis-
abled (by the menu program). In this case, the fatal error message
is displayed directly, and control is return to the menu.
The output file has the same name as the input file. If
disassembly continued, the output would overwrite the
input file.
- Invalid instructions.
- Unexpected operands.
- Missing operands.
Error messages are reported to the console with an error number, the
instruction line number where the error occurs and a text describing
the error. The error description also appears as a comment in the
output, on the line containing the error.
The listing type output of the .DLS file is similar to the .LST file
produced by the assembler, except that the width is 80 characters
(plus any margin), and any errors found are indicated by an error
message as a comment.
Tabs are used for all spaces, minimizing the size of the output file.
The title lines appear at the start of each page. The title lines show
the input file name, the creation date and time of the input file, the
disassembly date and time and the page number.
The dates and times are in a COUNTRY dependent format (see MS-DOS
Manual for COUNTRY command).
Listing Example:
1 2 3 4 5 6 7 8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
*** SAIA PCD DISASSEMBLER V1.7 *** PAGE 1
FILE: MAMI.PCD ( 9.11.89 9.08 ) DISASSEMBLED: 23.11.89 16.52
0 COB 1
1 0
3 CSB 1
4 ECOB
;
. . .
92 STXTX 1
93 20
94 LD T|C 10
95 6000
97 RES F 240
98 NOP
99 NOP
100 EST
;
;END
SDISASM - Page 10
Tabs are used for all spaces, minimizing the size of the output file.
The title line, containing the input file name, it's creation date
and time, and the disassembly date and time appears only once at the
top of the source listing.
The dates and times are in a COUNTRY dependent format (see your DOS
Manual for COUNTRY command).
1 2 3 4 5 6 7 8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
; FILE: MAMI.PCD ( 9.11.89 9.08 ) DISASSEMBLED: 23.11.89 16.52
; PRE-RELEASE VERSION FOR SAIA INTERNAL USE ONLY
COB 1
0
CSB 1
ECOB
;
. . .
STXTX 1
20
LD T|C 10
6000
RES F 240
NOP
NOP
EST
;
;END
REVISION HISTORY
05-Jan-98 V2.1 No changes
21-Jun-96 V2.0
1) $INIT segments with actual addresses are now listed in
the .DOC file.
07-Jun-95 B2.0d
1) SWER 848: Add "Fatal Error 14: SDOC doesn't support $AUTO".
09-Jun-93 V1.7
1) Can now use a temporary file for storing automatic comments
to prevent "out or memory' errors when processing very
large files. New /TEMP switch. This also causes macro
definitions to be stored in a temporary file.
2) 32-bit binary values can now be listed in binary if the
new /Q switch is used. Binray values of up to 12 bits long
are now always listed in binary, regardless of the /Q
switch. Previously binray 32-bit values were always
converted to hex.
3) Improved EQU/DEF statement output format.
4) The DOC statement now supports all data types. COB, XOB, PB,
FB, SB, ST, TR, TEXT and DB have been added (4.5), which
means that these can now have automatic comments.
5) $INIT segments containing XOB 16 initialization code are
not listed.
6) Updated to be compatible with assembler SASM V1.7.
7) New /R (Remove blank lines) and /NR (No removal of blank
lines) (2.).
06-Dec-91 $154
1) New "/Dysm[=typ]" switch for defining symbols on the DOS
command line (SWMR 244).
2) All SASM $154 changes also implemented.
04-Sep-91 $152
1) Added section 3.4 Important Notes.
2) Now formats EQU, DEF and DOC statements.
EXTN statements are not listed anymore (they cannot be
formatted because more than one external symbol usually
appears on the same line).
10-Apr-91 V1.51
1) Added /E /NE switches, control listing of EQUate, DEFine,
EXTN and DOC statements.
2) Absolute address in DOC listing now 6 digits to allow for
future program memory expansion.
04-Oct-90 $139
1) Now handles X (text) and DB (Data Block) types.
2) SWMR 145/146: Added /G /NG switches, control listing of
Graftec ST/TR incoming/outgoing parameter lists.
19-Apr-90 $133
1) Documentation can now include the source module line numbers,
use the new /L switch. (SWMR 111)
2) Blank lines in the source file are not listed in the
documentation - use ';' at the start of the line to produce
blank lines.
3) Corrected and updated the examples in section 5.
22-Nov-89 V1.3
1) Now allows more than 80 characters per line (SWMR 6).
2) Doesn't convert lower case symbols to upper case (SWMR 6).
3) Now puts labels into the DOC file (SWMR 6).
4) Allows international character set in labels and symbols
(SWMR 32).
5) Supports expressions in symbol field, eg. FRED+1, TOTO-100.
New /O /NO switches enable/disable this feature. This can be
disabled because the offset may affect the columnation of the
DOC file (SYMBOL+OFFSET may be too wide for the field).
(SWMR 42).
6) Now puts texts into DOC file (SWMR 70).
7) Allows 10 character symbol names (SWMR 71).
8) Gives help if invoked with an incorrect command line from DOS.
9) User selectable comments in DOC file using new switches:
/U User comments only
/A Automatic comments only
/B Both user and automatic comments
10) Don't put lines between $SKIP..$ENDSKIP directives into the
.DOC file.
11) The ';' is NOT stripped from comments.
05-Dec-88 V1.2
1) New, improved documentation format:
- No numeric opcodes.
- Automatic commenting
- Column containing absolute operands.
- Column containing user symbols.
- Shows absolute addresses for jump instructions.
2) "Free memory" indication given.
3) Fatal Error messages renumbered.
4) Warning 0 removed.
22-Mar-88 V1.1
1) Allow either '/' or '-' characters as switch
delimiters.
2) Missing or invalid install data file is now a fatal
eror. Add "Fatal error 13: Improper installation".
Remove Warning 1.
03-Aug-87 Preliminary.
SDOC - DOCUMENTATION GENERATOR - Page 1
CONTENTS
========
PAGE
1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . 2
3. COMMENTS . . . . . . . . . . . . . . . . . . . . . . . 5
3.1 Automatic Comments . . . . . . . . . . . . . . . . 5
3.2 User Comments . . . . . . . . . . . . . . . . . . 6
3.3 Choice of Comments . . . . . . . . . . . . . . . . 6
3.4 Important notes . . . . . . . . . . . . . . . . . 6
5. DOCUMENTATION EXAMPLES . . . . . . . . . . . . . . . . 8
5.1 User OR automatic comments (default, no switches) 10
5.2 User comments only (/U switch) . . . . . . . . . . 11
5.3 Automatic comments only (/A switch) . . . . . . . 12
5.4 Both comments (/B switch) . . . . . . . . . . . . 13
5.5 With source file line numbers (/L switch) . . . . 14
6. ERROR HANDLING . . . . . . . . . . . . . . . . . . . . 15
6.1 Error Messages . . . . . . . . . . . . . . . . . . 16
SDOC - DOCUMENTATION GENERATOR - Page 2
1. INTRODUCTION
================
SDOC uses information from the map file (.MAP) produced by the linker.
The map file contains the start address of the source module, and a
list of all global symbols. The global symbols are loaded into the
symbol table before the source file is processed, thus resolving all
externals. The module's start address provides the absolute addresses
for the documentation.
Documentation files can only be produced when the entire program has
been assembled and linked without errors.
Documentation files are primarily for use by PCD operators (in the
factory for example), not by the programmers themselves, where the
listing files produced by the assembler (.LST) may be of more use.
Functional Diagram
------------------
+--------+ +--------+
| .MAP | | .DOC |
| file |--------+ +---->| file |
| | | ************ | | |
+--------+ +------->* *------+ +--------+
* SDOC *
+--------+ +------->* *------+ +++++++++++
| .SRC | | ************ | + .DOC +
| file |--------+ +---->+ to +
| | + printer +
+--------+ +++++++++++
SDOC - DOCUMENTATION GENERATOR - Page 3
Where:
File names can contain a drive and path name, eg. "A:\SRC\". The
name of the .DOC file produced is the name of the source file, with
extension ".DOC".
C:\>SDOC EXAMPLE
C:\>_
SDOC returns a value to DOS on exit. This value can be used by the
parent process or batch file (using the ERRORLEVEL parameter) which
invoked SDOC.
3. COMMENTS
============
I, O, F, T, C, R
COB, PB, FB, SB, IST, ST, TR
TEXT (or X), DB
SEMA (or S)
If both DOC and EQU automatic comments exist for an item, then
the comment attached to the symbol has priority. For example, if
these two lines occur in a source file, then the automatic comment
for SWITCH will be "Big red button":
Here, BASEADDS has the comment "INPUT CARD 2", this is also assigned
to INPUT1 and INPUT2. INPUT3 is assigned the comment "UNUSED INPUT",
it has its own automatic comment.
If both comments are selected with the /B switch, then some lines
will have two comments. In this case, the user comment is listed
first, followed by the automatic comment in brackets. If the line has
only one comment, either a user or an automatic comment, then this is
listed.
* The PCD4.B900 I/O card has an input and an output on the same
address. In order to have different automatic comments for both
the input and the output, symbols MUST be used for both elements,
otherwise SDOC will use the same automatic comment for both.
* By default, SDOC removes ALL blank lines from the source file.
The /NR switch disables this feature, and blank lines are not
removed. This may spoil the documentation format, because EQU,
DEF and DOC statements may be removed, and all $INCLUDEs,
macros and false conditional statements are removed, but the
blank lines which were used as spacing between these statements
will not be removed. This produces large blank areas in the
documentation. To solve this problem, all blank lines should
normally be removed. This also removes blank lines which may
be needed, so instead of using blank lines for spacing, use
empty comment lines ";...", which are not removed.
SDOC - DOCUMENTATION GENERATOR - Page 7
COMMENT Shows either the comment entered in the source file for
this line (user comment, see section 3.2), or an automatic
comment (see section 3.1). Automatic comments are attached
to symbols using EQU or to elements by using the DOC
definition. Section 3.3 describes how comments are chosen
for listing in this column.
Certain data from the source file is removed, and does NOT appear
in the documentation:
* ALL blank lines are removed. For blank lines in the documentation
use a ';' at the start of the source line.
* Macro definitions and calls are removed. Only the code and
comments produced when the macro is expanded are listed.
* If the /NE switch is used, then all EQUate, DEFine, DOC and EXTN
statements are removed. Otherwise they are re-formatted into
tidy columns, and listed.
SDOC - DOCUMENTATION GENERATOR - Page 8
5. DOCUMENTATION EXAMPLES
==========================
NOTES:
7) User comments.
SDOC - DOCUMENTATION GENERATOR - Page 9
*** SAIA PCD MACRO ASSEMBLER V1.7 *** FILE: EXAMPLE.SRC (14/06/93 17:01 ) ASSEMBLED: 14/06/93
17:03 PAGE 1
SAIA AG, CH-3280 MURTEN
NOTES:
; DOCUMENTATION EXAMPLE
(1)
DOC I 1 ; Fault contact (2)
OnSwitch EQU I|O 0 ; Power on switch
Alarm EQU F 123 ; H if alarm condition
ConvCtrl EQU PB 100 ; Conveyor control PB
(3)
;---------- CONVEYOR CONTROL (4)
5 COB 0
6 0 ; No time supervision
8 CPB 100 ConvCtrl ; Conveyor control PB
9 STH F 123 Alarm ; If there's an alarm
10 JR H 2 (12) Label ; then skip the process
11 CPB 100 process ; Process control FB
Label: (8)
12 STH I|O 1 ; If there's a fault
13 OUT F 123 Alarm ; then set the alarm flag
14 ECOB (1)
NOTES:
; DOCUMENTATION EXAMPLE
(1)
5 COB 0
6 0 ; No time supervision
8 CPB 100 ConvCtrl
9 STH F 123 Alarm ; If there's an alarm
10 JR H 2 (12) Label ; then skip the process
11 CPB 100 process
Label:
12 STH I|O 1 ; If there's a fault
13 OUT F 123 Alarm ; then set the alarm flag
14 ECOB
NOTES:
; DOCUMENTATION EXAMPLE
(1)
5 COB 0
6 0
8 CPB 100 ConvCtrl ; Conveyor control PB (2)
9 STH F 123 Alarm ; H if alarm condition
10 JR H 2 (12) Label
11 CPB 100 process ; Process control FB
Label:
12 STH I|O 1 ; Fault contact
13 OUT F 123 Alarm ; H if alarm condition
14 ECOB
NOTES:
1) EQU, DOC, DEF and EXTN statements are removed because the /NE
switch was used.
; DOCUMENTATION EXAMPLE
(1)
5 COB 0
6 0 ; No time supervision
8 CPB 100 ConvCtrl ; Conveyor control PB
9 STH F 123 Alarm ; If there's an alarm (H if alarm condition)
10 JR H 2 (12) Label ; then skip the process
11 CPB 100 process ; Process control FB
Label:
12 STH I|O 1 ; If there's a fault (Fault contact)
13 OUT F 123 Alarm ; then set the alarm flag (H if alarm
condition)
14 ECOB
NOTES:
1) EQU, DOC, DEF and EXTN statements are removed because the /NE
switch was used.
1 ; DOCUMENTATION EXAMPLE
3
7 DOC I 1 ; Fault contact
9 OnSwitch EQU I|O 0 ; Power on switch
10 Alarm EQU F 123 ; H if alarm condition
11 ConvCtrl EQU PB 100 ; Conveyor control PB
12
13 ;---------- CONVEYOR CONTROL
14
15 0 PB 100 ConvCtrl ; Conveyor control PB
16 1 STH I|O 0 OnSwitch ; If switch is on
17 2 ANL F 123 Alarm ; and there are no alarms
18 3 OUT I|O 32 motoron ; then turn on the motor
19 4 EPB
20
21 ;---------- MAIN COB
22
23 5 COB 0
24 6 0 ; No time supervision
25 8 CPB 100 ConvCtrl ; Conveyor control PB
26 9 STH F 123 Alarm ; If there's an alarm
27 10 JR H 2 (12) Label ; then skip the process
28 11 CPB 100 process ; Process control FB
29 Label:
29 12 STH I|O 1 ; If there's a fault
30 13 OUT F 123 Alarm ; then set the alarm flag
31 14 ECOB
6. ERROR HANDLING
==================
The validity of the .MAP and .SRC files are checked first:
SDOC checks that the .MAP file is indeed the map file which was created
when the file to be documented was linked. It may not be able to detect
a map file which has since been edited or corrupted. These are checked:
* The file's code, text and extension memory sizes should match
those in the .MAP file.
* The actual number of global symbols in the file must be the same
as in the .MAP file.
* All external symbols in the map file which the map file indicates
are referenced by the source file must actually be referenced,
and no other externals should be referenced by the source file.
This is also reported as "Fatal Error 10: Source file error",
and can be remedied by re-assembling and linking the file.
All fatal errors cause the SDOC program to terminate, and a return is
made to DOS or the invoking menu. After a fatal error, if possible,
the DOC file is deleted, or if the output is to the printer, a form
feed is done and the de-initialisation string is sent.
SDOC - DOCUMENTATION GENERATOR - Page 16
Fatal Error 10: Source file error in <file>, re-assemble and link
REVISION HISTORY
05-Han-98 V2.1 No changes
29-May-96 B2.0d
1) Added Warning 3: Addr <n>: SB <n> has no Initial Step (IST),
and
Warning 4: Addr <n>: More than one Initial Step (IST) in SB <n>
29-Mar-95 $185C
1) Added Graftec structure checks, see section 1.
2) New error messages
3) The default switch is now /NL (was /L), which means that
an FB parameter cross-refernce list is NOT generated by
default.
08-Jun-94 $185d
1) Handles new TFRI/STXMI/SRXMI instructions.
09-Jun-93 V1.7
1) Handles new TFR and CPBI instructions.
17-Jan-92 $155
1) SWMR 255: Change "Line" in error and warning messages
to "Adds", it's an absolute line address number, not
a source file line number.
05-Nov-90 V1.4
1) Now handles text (X) and data block (DB) parameters for
PUT and GET.
2) Corrected range check for SRXM/STXM count (0..16).
22-Nov-89 V1.3
1) Gives help if invoked with an incorrect command line from
DOS.
CONTENTS
════════
Page
1. OVERVIEW . . . . . . . . . . . . . . . . . . . 2
1.1 Bloctec parameter checks . . . . . . . . . . 3
1.2 Graftec parameter checks . . . . . . . . . . 4
4. FATAL ERRORS . . . . . . . . . . . . . . . . . 8
5. WARNINGS . . . . . . . . . . . . . . . . . . . 9
6. RECOVERABLE ERRORS . . . . . . . . . . . . . . 10
7. LIMITATIONS . . . . . . . . . . . . . . . . . 13
SFBREF - Page 2
1. OVERVIEW
════════════
For Bloctec, it checks that all Function Block (FB) parameter values
and references are valid. It can also produce a cross-reference list
if all Function Blocks and their parameters.
For Graftec, it checks that the incoming and outgoing parameters for
all Steps (ST) and Transitions (TR) are in the correct Sequential
Blocks.
Action diagram
──────────────
. . . .
The Assembler (SASM) and the Linker (SLINK) do not provide 100%
checks for Function Block parameters. The size of the program and
database required for detailed FB parameter checks would drastically
reduce the performance of the Assembler and Linker. Because of this,
the FB parameter checking is done by this stand-alone program, which
can be executed after the linkage, if required.
SB 0: SB 1:
┌──────────────┐ ┌──────────────┐
╔═══╧═══╗ │ ╔═══╧═══╗ │
║ ║ IST 0 │ ║ ║ IST 100 │
╚═══╤═══╝ │ ╚═══╤═══╝ │
│ │ │ │
───┼─── TR 0 │ ───┼─── TR 100 │
│ │ │ │
┌───┴───┐ │ ┌───┴───┐ │
│ │ ST 1 │ │ │ ST 101 │
└───┬───┘ │ └───┬───┘ │
│ │ │ │
───┼─── TR 1 │ <──┬──> ───┼─── TR 1 │
│ │ │ │ │
└──────────────┘ │ └──────────────┘
│
└─ ERROR: TR 1 is in SB 0 not SB 1
SB 0 SB 1
IST 0 IST 100
I 1 I 1
O 0 O 100
EST EST
TR 0 TR 100
I 0 I 100
O 1 O 101
ETR ETR
ST 1 ST 101
I 0 I 100
O 1 O 1
EST EST
TR 1 ESB
I 1
O 0
ETR
ESB
SFBREF - Page 5
Where:
Invocation Examples:
C:\>SFBREF FRED
C:\>SFBREF TTACO /P
or
C:>SFBREF /P TTACO
The standard title lines are present, indicating the input file name
and creation date, the creation date of the listing, and the reg-
istered users identification.
If any errors or warnings are found, these are listed at the beginning
of the listing.
For each parameter, there is a list of all its values, and the program
line number where each value is assigned. Parameters are given values
in the Function Block parameter lists that follow "Call Function Block"
(CFB) instructions.
*** SAIA PCD FB PARAMETER LIST V1.7 *** MODULE: FBR10.UPL (27-04-88 13:41 ) PRODUCED: 27-04-88 13:41
PAGE 3
GOBI DESERT YACHT CLUB, GOBI DESERT
000 1 00306 I|O 0 00326 I|O 8191 00350 I|O 0 00370 I|O 8191
00394 I|O 0 00414 I|O 8191 00438 I|O 0 00458 I|O 8191
000 3 00308 T|C 0 00328 T|C 1599 00352 T|C 0 00372 T|C 1599
00396 T|C 0 00416 T|C 1599 00440 T|C 0 00460 T|C 1599
NO FUNCTION BLOCKS
NO PARAMETERS
4. FATAL ERRORS
════════════════
The input or output file name is not a valid DOS file name,
or is a device name.
Error when writing the output file. Usually this means that
the destination disk is full.
5. WARNINGS
════════════
Warning 1: Addr <n>: Parameter not referenced: CFB <n> Param <n>
Warning 4: Addr <n>: More than one Initial Step (IST) in SB <n>
6. RECOVERABLE ERRORS
══════════════════════
These are listed to the display and also at the start of the FB
parameter cross-reference list. They do not cause SFBREF to abort,
but are all fatal programming errors. Executing a program containing
errors in the PCD will produce unexpected results.
All of these errors (except errors 30, 41 and 42) are also detected
by the Assembler (SASM) and the Linker (SLINK). They can, however,
be introduced by editing the program using the debugger (SBUG) or
doenloading individual Steps and Trsnaitions, and then uploading the
altered program.
"Addr <n>" indicates the absolute address (program line number) where
the error occured.
Error 28: Addr <n>: Missing parameter(s): CFB <n> from Param <n>
Error 30: Addr <n>: Bad parameter: CFB <n> Param <p> (val): <adr>
<mnemo>
7. LIMITATIONS
═══════════════
Due to the nature of certain PCD instructions there are some rare
programming errors which cannot be detected. These occur only with
instructions where the maximum value (or type) of the third or fourth
operand is dependent on the value (or type) of the first or second
operand.
NOTE: SFBREF does not know what value will be in the Index Register
at run time, and so CANNOT detect indexing errors on FB parameters.
REVISION HISTORY
05-Jan-98 V2.1 No changes
21-Jun-96 V2.0
27-Feb-96 $19D
1) SWMR 602: Filename validity check now checks for 8+3
characters.
24-Apr-95 V1.9
09-Jun-93 V1.7
1) Whenever the cursor is in a filename entry field, pressing
function key F5 displays the pop-up directory window, from
which a file name can be chosen.
2) "File display" command improved, can now display any sized
file.
06-Dec-81 $154
1) Now has F1=Help.
2) Add errors 11 and 12.
12-Sep-91 $152
1) Sort option and all entry field data now stored in
PCDMENU.DAT file.
06-Nov-90 V1.4
1) Gives "invalid file name" error if '*' not followed by
'.' or end of name, e.g. "FIL*NAM.*RC" is invalid.
2) Allows wildcard chars * and ? in "erase" command.
4) Now allows wildcard chars in "rename" command.
4) Added "ERROR 10: FILE NOT FOUND: <filename>".
22-Nov-89 V1.3
1) Allows Copy xxx*.SRC to yyy*.SRC.
2) More than one '.' allowed in a file name during entry.
Added ERROR 9: INVALID FILE NAME to handle this.
3) "Copy" assumes current directory if no "To" filename entered.
4) Now works in colour as defined in PCDCOLOR.DAT.
5) Tab characters expanded to spaces by "Print" command.
6) New "Sort Directory" command so that the directory can be
sorted by file name or by file extension.
7) Erase command now prompts "Are you sure (Y or N)?".
8) Corrected bug where "Rename" actually copied a file if the
the drive/directory name was given.
05-Dec-88 V1.2
1) Drive and directory names are now allowed in all file names.
File name entry fields increased to 42 characters.
2) Prompt line and menu texts corrected.
3) Format operation can now format either diskettes A or B
(user selectable) on a two diskette system.
4) File names now checked for validity. New error message
9, invalid file name.
5) Faster "Display" option, now shows "Memory free" which
indicates the maximum size of file which can be displayed,
the entire file is read into memory.
25-Jan-88 V1.1
1) Blinking up and down pointers now indicate if the directory
occupies more than one window full (2.0).
2) Change use of keys in Display File (6.0).
3) Add off-screen indicators in Display File (6.0).
02-Nov-87 V1.0
1) Section 9. Format diskette now formats drive A if the
system has one floppy disk, or drive B if the system has 2
floppy disks. The user cannot select which drive is to be
formatted.
2) Section 10.0. Corrected error messages 2-5 and 8.
04-Mar-87 Preliminary.
SFILE - File Handling Page 1
CONTENTS
========
PAGE
1. OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . 2
3. COPY FILES . . . . . . . . . . . . . . . . . . . . . . 5
4. ERASE FILES . . . . . . . . . . . . . . . . . . . . . 7
5. RENAME FILES . . . . . . . . . . . . . . . . . . . . . 8
6. DISPLAY FILE . . . . . . . . . . . . . . . . . . . . . 9
7. PRINT FILE . . . . . . . . . . . . . . . . . . . . . . 12
8. COMPARE FILES . . . . . . . . . . . . . . . . . . . . 13
9. FORMAT DISKETTE . . . . . . . . . . . . . . . . . . . 14
1. OVERVIEW
============
During the entry of file names and other information, the directory
display can still be viewed using the PGUP and PGDN keys, as shown
by the second prompt line, see the screen examples.
SFILE - File Handling Page 2
Overview continued
------------------
SFILE uses the DOS format program, and FORMAT.COM (or FORMAT.EXE)
must be accessible for the "Format Diskette" operation to work.
FORMAT does not need to be in the current directory, providing the
correct search path has been specified using the PATH command,
usually executed from batch file AUTOEXEC.BAT.
SFILE - File Handling Page 3
This is the first screen displayed, from it the user can select any
operation.
The current drive and directory name, number of files in the current
directory, and the remaining space on the disk are shown on line 3.
The directory itself is shown in a directory window, which holds up
to 22 directory entries. This can be paged up and down using the
PGUP and PGDN keys. Blinking up and/or down arrows show that there
are more files to be seen by paging the window.
File name, File extension, File size, Creation date and time
The format of the creation date and time is dependent on the country,
see the DOS command "COUNTRY".
The directory display also shows entries for the parent directory
(file ".."), the current directory (file ".") and any sub-directories.
For a directory, the word "<DIR>" is displayed in the file size
column, indicating this is a directory not a file. See the screen
examples.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA FILE HANDLING UTILITIES V2.1 │
├────────────────────────────────────────────────────────────────────────────────┤
│ Sorted by: File name Files: 34 Bytes free: 520192 │
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │ . <DIR> 2─20─87 10:49 L946 10406 3─04─87 11:33 │ │
│ │ .. <DIR> 2─20─87 10:49 LISTINGS <DIR> 3─04─87 18:45 │ │
│ │ BACKUP BAT 287 2─27─87 15:13 MK C 272 3─04─87 11:33 │ │
│ │ C BAT 169 3─04─87 9:29 MK EXE 7076 3─04─87 11:34 │ │
│ │ DATA 54989 3─04─87 8:26 MK OBJ 458 3─04─87 11:33 │ │
│ │ DATA1 5071 3─04─87 11:23 PE PRO 2352 1─12─87 12:10 │ │
│ │ DIR 1620 3─05─87 7:56 S 64 3─04─87 9:15 │ │
│ │ L461 5071 3─04─87 11:32 SFCMD C 19673 3─04─87 9:58 │ │
│ │ L462 5082 3─04─87 11:31 SFCMD OBJ 7220 3─04─87 10:00 │ │
│ │ L463 5093 3─04─87 11:32 SFDSP C 14290 3─04─87 14:22 │ │
│ │ L484 5324 3─04─87 11:31 SFDSP OBJ 3393 3─04─87 14:23 │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────┐ │
17 │ │ Copy files │ Display file Format diskette │
│ └────────────┘ │
19 │ Erase files Print file Sort directory │
│ │
21 │ Rename files coMpare files Quit │
│ │
23 │ error message line.... │
├────────────────────────────────────────────────────────────────────────────────┤
│ ARROW, SPACE or TAB selects, ENTER or Command letter executes. │
│ View directory with PGUP and PGDN. F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
SFILE - File Handling Page 5
3. COPY FILES
==============
The "From" and "To" file names can contain the global file name
characters "*" and "?". "*" matches all characters in the file name
or extension, the "?" matches any single character. Disk drive names
and full path names are allowed.
For example, this will copy all files from the current directory to
drive A:
From *.*_______________________________________
To A:________________________________________
This will copy all ".SRC" type files from directory SOURCE on drive
C: into the current directory:
From C:\SOURCE\*.SRC___________________________
To __________________________________________
SFILE - File Handling Page 6
Once the copy is completed, the title line is restored (if it has
scrolled off the screen) and the user is prompted to press any key to
continue. When a key is pressed, a return is made to the main menu.
If the current directory has been updated by the copy, this will be
shown in the new directory display on the main menu.
For example:
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA FILE HANDLING UTILITIES V2.1 │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│ Copying from *.* to A: │
│ │
│ SFILE.OBJ │
│ ABCD.UPL │
│ SFILE.SRC │
│ SFCMD.SRC │
│ SFINP.SRC │
│ SFTXE.SRC │
│ SLOAD.EXE │
│ 7 file(s) copied │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ COPY ENDED: Press any key to continue _ │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
SFILE - File Handling Page 7
4. ERASE FILES
===============
The user can now enter a file name for the file to be erased. The
wildcard file name characters "*" and "?" are accepted.
Once the file name has been entered, when ENTER is pressed to start
the erase, this prompt is displayed:
├────────────────────────────────────────────────────────────────────────────────┤
│ ERASE FILES: Are your sure (Y or N) ? _ │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
This gives the user the opportunity to abort the operation. Pressing
'Y' will erase the file(s), pressing 'N'or ESC will abort.
After the erase, the directory display is then updated, and menu is
re-displayed on lines 17 to 21.
5. RENAME FILES
================
The user can enter the present and new file names, the pressing
ENTER when both filenames have been entered will do the rename.
When the rename is complete, the directory display is then updated,
and the selectable function list is re-displayed on lines 17 to 21.
If the file to rename does not exist, a file with the new name
already exists, or the rename fails (file to rename is read only
or the disk write protected), an error message is displayed, see
section 10.
SFILE - File Handling Page 9
6. DISPLAY FILE
================
The user can enter the name of the file to be displayed, pressing
ENTER will display the file.
Left and right scrolling is supported since listing (.LST) files and
source files may be up to 152 characters wide (132 + right hand
margin).
The file name, the line number of the first line on the screen, and
the column number of the first column on the screen are displayed
in bold video on line 25.
If the text is wider than the screen, bold flashing '<<' or '>>'
characters will appear on the left or right of line 25, indicating
that more text can be seen by using the <left arrow> and <right
arrow> keys.
Tab characters are expanded to spaces for the display. Other special
characters such as form-feeds are displayed as standard IBM graphics
characters, see the IBM manuals for the character set.
Only text files should be displayed, displaying any other files such
as object files (.OBJ) or absolute files (.PCD, .UPL, .EXE etc.)
will produce erroneous displays, containing truncated lines and lost
characters.
Display file screen example, the last page of a source file is shown:
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA FILE HANDLING UTILITIES V2.1 │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│ fb strget ; read a string from serial port buffer │
│ sti strix ; | save Index Register │
│ set = strerr ; | set error flag │
│ sei k 0 ; | pointer to first character │
│ ; | │
│loop1: ; | repeat │
│ sth = portne ; | | exit loop │
│ jr l getend ; | | if buffer empty │
│ srxdx = port ; | | read a char from the given port │
│ = string ; | | into the indexed register │
│ ini = strexp ; | | next character │
│ jr h loop1 ; | until expected number reached │
│ ; | │
│ acc h ; | if normal termination │
│ res = strerr ; | reset error flag │
│ ; | │
│getend: rsi strix ; | recover Index Register │
│ efb │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Use PGUP, PGDN, HOME, END and ARROW keys to view file, ESC exits. │
├────────────────────────────────────────────────────────────────────────────────┤
│ Line: 123 Col: 1 F1=Help >> │
└────────────────────────────────────────────────────────────────────────────────┘
SFILE - File Handling Page 12
7. PRINT FILE
==============
The user can now enter the name of the file to be printed, this
must be an ASCII text file (.SRC, .LST etc.).
If the file does not exist, or the printer is not ready, an error
message is displayed, and the file name can be re-entered or the
printer made ready before re-trying the operation.
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ PRINTING FILE: Press ESC to abort print. │
│ View directory with PGUP and PGDN. F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
If the printer goes not ready during the print, an error message is
displayed, and printing is stopped. The print must then be restarted
from the beginning.
8. COMPARE FILES
=================
The "Name of first file" field is selected first. The "Name of second
file" field is selected by pressing ENTER, DOWN ARROW or UP ARROW.
When both file names are entered, and the cursor is on the "Name of
second file" field, pressing ENTER begins the compare operation.
If both files exist, the screen is cleared except for the title line,
the "WAIT" prompt is displayed, the cursor is placed on line 3 and
the following message is displayed:
Files compare ok
Compare error: Files are different lengths
Compare error: Files are not the same
The header in PCD and UPL type files containing identical code and
text segments will be different. Therefore, if either of the files
has a PCD or UPL extension, the header is not compared (the first 40
bytes of the file are skipped during the compare operation).
SFILE - File Handling Page 14
9. FORMAT DISKETTE
===================
When ENTER is pressed after selecting the drive name and system
files copy option, the screen is cleared except for the title line,
and the following is displayed (the warning message is in bold
video):
*** WARNING: THIS WILL DELETE ALL THE FILES ON THE DISKETTE ***
Press <CTRL+C> to abort the format.
During the format, the user is prompted to enter a volume label for
the diskette. If no volume label is required, press ENTER without
entering a label.
Example:
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA FILE HANDLING UTILITIES V2.1 │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│ FORMATTING DISKETTE IN DRIVE A: │
│ │
│ *** WARNING: THIS WILL DELETE ALL THE FILES ON THE DISKETTE *** │
│ Press <CTRL+C> to abort the format. │
│ │
│ Insert new diskette for drive A: │
│ and strike ENTER when ready │
│ │
│ Formatting...Format complete │
│ │
│ Volume label (11 characters, ENTER for none) ? FRED │
│ │
│ │
│ 1213952 bytes total disk space │
│ 1213952 bytes available on disk │
│ │
│ Format another (Y/N) ? _ │
│ │
│ │
│ │
│ │
│ │
│ │
└────────────────────────────────────────────────────────────────────────────────┘
Note that the FORMAT program's prompts may vary slightly according
to the machine, different IBM compatible computers may have slightly
different FORMAT programs.
SFILE - File Handling Page 16
DOS disk error handling is disabled, except when the COPY and FORMAT
programs are running. For these, the standard "Abort, Retry, Ignore ?"
prompts will follow the disk error message. In all other cases, on a
disk or other error, an error message is displayed in bold video on
line 23 accompanied by a long beep.
REVISION HISTORY
05-Jan-98 V2.1
24-Apr-95 V1.9
09-Jun-93 V1.7
1) Help texts updated.
2) Now works with DOS 5.
06-Dec-91 $154
Texts and error messages updated.
14-Mar-90 $001
Preliminary, SWMR 106.
SHELP - Page 1
1. INTRODUCTION
================
The files SHELP.EXE and SHELP.HLP should be copied into the same
directory as the other PCD Programming Utilities. The environment
string "PCD" must be set to point to this directory (so that SHELP
can find SHELP.HLP), for example:
SET PCD=C:\PCD
C:>SHELP
C:>_
To unload SHELP from memory, execute the SHELP command again, for
example:
C:>SHELP
C:>_
The display uses the entire screen, and has the traditional title
and prompt lines. This is the main index page (example only):
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA POPUP HELP V2.1 │
├────────────────────────────────────────────────────────────────────────────────┤
│ INDEX │
│────────────────────────────────────────────────────────────────────────────────│
│ Accumulator LAN2 command texts INSTRUCTION SET: │
│ Assembler directives LAN2 diagnostic flags Bit │
│ Comments Macros Integer │
│ Condition codes Medium control codes Floating point │
│ Conditional assembly Operator precedence Bloctec │
│ Constants SASI texts Graftec │
│ Data types Status flags Communications │
│ Declarations Texts LAN2 │
│ Diagnostic flags Data Blocks Control │
│ Diagnostic register Extension memory Special │
│ Exception Org'n Blocks Definition │
│ Expressions Index register │
│ Help on help │
│ Include files │
│ Instruction index │
│ Jump labels │
│ │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ HELP: Select a highlighted help topic using the arrow keys, then press ENTER. │
│ Use PGUP and PGDN to view pages, ESCape exits. F1=Index F9=Back F10=Forward │
└────────────────────────────────────────────────────────────────────────────────┘
Other help topics, for which there is another help screen, are shown
highlighted on the display. For the index page, all the topics are
highlighted. Highlighted topics are selected by moving the reverse
video cursor with the arrow keys. Press ENTER to display the help
screen of the selected topic.
The PGUP and PGDN keys can also be used to view the help screens.
Some help displays have more than one screen of information. This
is indicated by --PgDn-> in the bottom right-hand corner of the
display. Press the PGDN key to view the other pages.
The F9 and F10 keys can be used to display the help screens which
have already been displayed. A circular buffer containing the last
20 help screens displayed is maintained, F9 moves back in this buffer,
F10 moves forward.
The F1 key displays the main help index, and ESCape restores the
display and returns control to the application which was running
before Alt+Shift+H was pressed.
SHELP - Page 4
4. ERROR MESSAGES
=================
Once loaded, SHELP detects these errors. They are all fatal, and
the user is prompted "CAN'T CONTINUE: Press any key to exit".
One of these errors will occur if the SHELP.HLP file is not the
correct version (SHELP.EXE and SHELP.HLP are different versions).
Not enough memory to load a page from the help file. Should
never occur, if it does then notify SAIA Technical Support
immediately.
Since SHELP was loaded, the environment has been changed, and
SHELP can't find the help file SHELP.HLP.
There was a problem reading the SHELP.HLP file. This can occur if
the diskette containing SHELP has been removed, or if SHELP.HLP
is corrupted.
REVISION HISTORY
05-Jan-98 V2.1
1) Add downloader errors 42..44:
Error 42: Code segment not downloaded
Error 43: Text segment not downloaded
Error 44: Extension memory segment not downloaded
20-Jun-97 $209
1) Add downloader SDNLD errors 37 to 41.
24-Mar-97 $208
1) Add Flash EPROM suppport.
2) Added loader SLOAD menu error messages:
ERROR 25: GATEWAY NOT SUPPORTED BY PCD1
ERROR 28: MEMORY MAP CORRUPTED OR INVALID
21-Jun-96 V2.0
20-Mar-96 $19G
1) SWMR 680 & 815: Added handling for $CPU, $STATION and $PCDVER
assembler directives. Added section 4.3 Downloader Warnings.
14-Mar-96 $19F
1) Added "UPLOAD PCD SETUP" and "DOWNLOAD PCD SETUP" commands.
See sections 2.2.8 and 2.2.9.
2) Added description of function keys to section 2.2.1.
3) Added section 2.4 Changing PCD RAM Backup Batteries.
12-Feb-96 $19D-$19E
1) Added "Run all CPUs on completion" and "Clear all outputs"
switches. The main screen's layout has been changed. See 2.2.
2) S-BUS can now be configured via an S-BUS connection. SLOAD
automatically re-connects to the original PCD using the
new S-BUS configuration. This works for the station number,
baud rate and signalling mode. See 2.2.4.
3) Add ERROR 27, remove ERROR 25.
4) The uploader SUPLD.EXE now has /NX switch (No eXtension)
which prevents extension memory being uploaded.
5) Some uploader SUPLD.EXE error messages re-numbered.
6) The downloader SDNLD.EXE now displays the states of all
CPUs (Run/Stop/Halt etc.) on completion of an operation,
so we know which CPUs were put into run etc. by the /R
and /RA switches.
7) Changed SDNLD Error 28 to "Error 28: The PCD4.M4 cannot
use port 2 or 3 as a PGU port", old error 28 removed.
See 4.3.
16-Oct-95 $198
1) PGU mode support.
24-Apr-95 V1.9
06-Feb-95 $18A
1) The "CONFIGURE S-BUS" command now writes the gateway
configuration to the PCD. This is defined on the
"Configure/Gateway master port" screen, now displayed by
pressing function key F6.
2) New downloader error messages:
Error 31: Not enough space for header, delete CPU 0's
code or reallocate memory
Error 32: PCD <fw version> only supports the "Factory
Default" modem
Error 33: PCD <fw version> doesn't support the S-BUS
gateway
Error 34: PCD <fw version> doesn't support selectable
Break/Parity signalling
18-Aug-94 $188
1) SDNLD now downloads the PCDReset and PCDInit strings defined
on the new "Configure/Modem for SAIA PCD" menu.
2) Added error messages:
Error 30: Modem type <modem type> not found in <filename>
Error 31: Firmware <version> only supports the "Factory Default"
modem
Error 32: Not enough space for header, memory must be
reallocated
18-Jul-94 $187
1) Function keys are now used as short-cut keys to display
configuration screens: F2=Hardware and memory, F3=S-BUS,
F4=PCD modem.
2) The "Verify during download" switch position is now saved in
the PCDMENU.DAT file.
09-Jun-93 V1.7
1) "Data segment" now called "Extension Memory".
2) Switches /X /NX (eXtension, No eXtension).
3) SDNLD now configures S-BUS, using the new /S and /NS
switches.
4) SLOAD menu has three new commands:
CONFIGURE S-BUS
COMPARE FILE AND CPU CONTENTS
DOWNLOAD EXTENSION MEMORY
5) Function key F5 displays the pop-up directory window.
6) Now supports S-BUS and modem communications.
7) The number of SUPLD.EXE and SDNLD.EXE return values has
been reduced (3.4 and 4.4).
8) New loader menu errors 20 to 26 (2.3).
9) New SUPLD.EXE and SDNLD.EXE errors, and all errors have
been renumbered.
28-May-92
1) Shows new data segment if present.
2) Modified loader menu: separate verify Yes/No switch; new
"DOWNLOAD DATA SEGMENT ONLY" operation; segment sizes
increased to 4 digits, and 7 digits for used/free sizes.
3) SUPLD and SDNLD now upload/download the new data segment.
4) SDNLD has new /D (Data) /ND (NoData) switches.
5) SUPLD and SDNLD now show the percent complete when the
upload or download is in progress.
6) New error messages for data segment.
7) SDNLD now automatically verifies the first 4 bytes of every
1K bytes downloaded, to ensure that memory is not write
protected and the memory chips are present.
8) SDNLD now displays "Stopping all CPUs" when it sends the
initial "restart cold all CPUs" telegram.
05-May-92 V1.6
1) Add SDNLD error:
Error 21: Wrong CPU type selected in configuration.
06-Dec-91 $154
1) New /R (Run), /RA (RunAll) and /NR (NoRun) switches for
SDNLD.
2) SLOAD menu now has F1=hyperhelp.
3) Add SLOAD errors 16 to 19.
08-Oct-91 $153
1) Now supports 1MB R600 memory, for up to 256K code lines or
999K text characters.
2) SDNLD now doesn't verify file's checksum before download,
it does this DURING the download (saves time, especially
if the file is 1MB!).
12-Sep-91 $152
1) SDNLD now downloads S-BUS header if /M option given.
2) "Improper installation" error changed to "PCDSETUP.DAT
not found or invalid".
12-Nov-90 V1.4
22-Nov-89 V1.3
1) More than one '.' allowed in a file name during entry (SWMR 7).
2) Different memory map for PCD4/PCD6. PCD4 has max 2 CPUs,
PCD6 has max 7 (SWMR 16).
3) Verifies enough to detect missing memory chip or write
protected memory (verifies every mod 256 bytes). (SWMR 23).
4) Rellocate memory clears security code in mail box (SWMR 27).
5) Now called "PCD LOADER" not "PCD6 LOADER" (SWMR 37).
6) Now works in colour as defined in PCDCOLOR.DAT.
7) New signon texts for SUPLD and SDNLD. These both now show
the line number being uploaded/downloaded.
8) SUPLD & SDNLD now give help if invoked with an incorrect
command line from DOS.
9) Memory map display now shows "Free Memory".
10) Now supports COM1, COM2, COM3 and COM4.
11) Added "Error 17: No program name in PCD" for SUPLD.
01-Dec-88 V1.2
1) Added loader menu ERROR 14 (2.3).
2) Install data file now called PCDSETUP.DAT
30-May-88 V1.1
1) File name entry field extended to 42 characters, to
allow a drive and/or path specification (2.2).
2) Add Error 16: CPU not programmed. Return value 3 is
returned to DOS. If an upload was attempted from a
CPU with no code, and empty UPL file was produced.
If an upload was done from unprogrammed EPROM, the
code length was read as FFFFFFFFH, and it attempted
to upload 4294967295 program lines! (3.3, 3.4).
3) Text segment size can be up to 256K, which requires
3 digits on the memory map display (2.2).
25-Jan-88 V1.0
1) Now does P8-PCD interface test before and after up/down
load. Added error 13 (2.3), error 15 (3.3), error 19
(4.3).
2) Improve entry field texts on loader menu (2.2).
3) Missing or invalid INSTALL.DAT file is a fatal "Improper
installation" error (2.3, 4.3).
CONTENTS
========
PAGE
1. INTRODUCTION . . . . . . . . . . . . . . . . . . 2
3. SUPLD - UPLOADER . . . . . . . . . . . . . . . . 20
4. SDNLD - DOWNLOADER . . . . . . . . . . . . . . . 26
1. INTRODUCTION
================
The downloader SDNLD can download code, text and/or extension memory
data to any CPU in the connected PCD. It can also write the memory,
S-BUS, modem and gateway configurations into the PCD. Configuration
data is defined by using the offline configurator SCONFIG, which can
be accessed from the main menu's "Configure" command, or by using
the function keys: F2=PCD type+memory, F3=S-BUS, F4=PCD modem, F6=
Gateway.
The uploader SUPLD can upload the code, text or extension memory
from any CPU in the connected PCD, and can also upload the PCD
configuration into file PCDSETUP.DAT.
The loader menu can itself be called from the main PCD menu with the
"Up/download" option, or can be invoked directly from DOS with the
following command:
SLOAD <CR>
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD LOADER V2.1 CPU: 0 Type: D6M2D$6m Memory: RAM │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│╓───┬──────────┬──────────────────────┬──────────────────────┬─────────────────┐│
│║ │ PROGRAM │ CODE SIZE (Lines) │ TEXT SIZE (Bytes) │ ││
│║ C │ NAME │ SEG USED FREE │ SEG USED FREE │ CPU STATUS ││
│╟───┼──────────┼──────────────────────┼──────────────────────┼─────────────────┤│
│║ 0 │ BATMAN-2 │ 56K 5743 51501 │ 32K 0 32768 │ STOP ││
│║ 1 │ │ 0K 0 0 │ 0K 0 0 │ DISCONNECTED ││
│║ 2 │ │ 0K 0 0 │ 0K 0 0 │ DISCONNECTED ││
│║ 3 │ │ 0K 0 0 │ 0K 0 0 │ DISCONNECTED ││
│║ 4 │ │ 0K 0 0 │ 0K 0 0 │ DISCONNECTED ││
│║ 5 │ │ 0K 0 0 │ 0K 0 0 │ DISCONNECTED ││
│║ 6 │ │ 0K 0 0 │ 0K 0 0 │ DISCONNECTED ││
│╚═══╧══════════╧══════════════════════╧══════════════════════╧═════════════════╛│
│ │
│ Operation, SPACE selects DOWNLOAD FROM FILE TO CPU │
│ File name TEST.UPL__________________________________ │
│ CPU number 0 │
│ Verify memory writes No │
│ Clear all outputs Yes │
│ Run all CPUs on completion No │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ SPACE selects operation, ARROW moves cursor, ENTER executes, ESC exits. │
│ Configuration: F2=PCD type+memory F3=S-BUS F4=PCD modem F6=Gateway F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
If a new memory card has been installed, or the PCD's memory has
been corrupted, then the message "HEADER NOT INITIALIZED" may be shown
for one or more CPUs. Memory must be reallocated before continuing.
RAM memory can be corrupted if the backup battery fails.
If not connected, or the CPU is powered off, the title line (which
normally shows the connected S-BUS station, CPU number, type and memory
type) is left blank, the memory map box remains empty, an error message
is displayed and the user is prompted to press any key to abort. The
same thing happens if the PCDSETUP.DAT configuration data file cannot
be read. No loader operations can be done if not connected to a CPU.
Operation:
File name:
This is the name of the .PCD or .UPL file for a DOWNLOAD, UPLOAD or
COMPARE operation. When the cursor is in this field, press function
key F5 will show the directory window, which allows a file name to
be chosen. '<' or '>' characters are shown if the file name is too
long for the field, to indicate the field can be scrolled.
CPU number:
If this is "Yes", then all the data is read back and compared. This
makes the download take twice as long. Note that even if verify is
"No", the first 4 bytes of every 1K bytes downloaded are still
verified to ensure that the memory chips are not write protected,
missing or faulty. S-BUS and memory allocation are ALWAYS verified.
If this is "Yes", then all PCD Outputs are cleared at the start of
a DOWNLOAD or CONFIGURE S-BUS operation. If "No", then the Outputs
are not cleared, and retain their current states. If the PCD firmware
does not support this feature, a warning message is displayed, and
the action will depend upon the PCD's "Reset Outputs" jumper (if the
PCD has one): If the jumper is in, then outputs are cleared at the
start of a download; if it's out, they are only cleared when the
download is complete.
NOTE: All PCD Outputs are ALWAYS cleared by the ALLOCATE MEMORY
operation.
If "Yes", then all CPUs containing programs are put into Run after
a successful DOWNLOAD or CONFIGURE S-BUS operation. If "No", all
CPUs will remain in Stop. CPUs which don't contain programs will
always remain in Halt, regardless off the setting of this switch.
Use this switch to minimize the amount of time that outputs are
cleared or are not under PCD control.
Only set this switch to "Yes" if the downloaded program(s) have been
tested and you know they will run correctly without damaging any
controlled hardware.
LOADER - Page 6
The prompt line changes according to which entry field the cursor is
on.
On "Operation" field:
├────────────────────────────────────────────────────────────────────────────────┤
│ SPACE selects operation, ARROW moves cursor, ENTER executes, ESC exits. │
│ Configuration: F2=PCD type+memory F3=S-BUS F4=PCD modem F6=Gateway F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
Function keys
-------------
Function keys F2, F3, F4 and F6 allow direct access to the "Configure"
program's menus. This allows the PCD configuration to be entered OFF
LINE, before writing it into the PCD with the CONFIGURE S-BUS,
ALLOCATE MEMORY, or DOWNLOAD PCD SETUP commands.
The data shown on these menus is read from the PCDSETUP.DAT file, it
is NOT necessarily the same as the data in the connected PCD. The
UPLOAD PCD SETUP command can be used to read the current data from
the connected PCD.
The DOWNLOAD PCD SETUP command writes ALL the above data to the PCD
in one go, but this deletes ALL code, text and extension memory in
the PCD. To configure only S-BUS, the PCD modem and the gateway,
without deleting memory, use the CONFIGURE S-BUS command.
LOADER - Page 8
Invokes the SDNLD program. It reads a PCD absolute object file (type
.PCD or .UPL) and writes it into the PCD's memory. The code, text and
extension memory segments (if present) are downloaded.
If "Verify memory writes" is "Yes", then every byte written into the
PCD's memory is read back and compared. This makes the download take
twice as long. If verify is not selected, a verify is still done for
the first 4 bytes of every 1K bytes downloaded, to ensure that the
memory chips are not write protected, missing or faulty.
The "Clear all outputs" switch defines whether outputs are cleared
during the download or retain their original states. If the switch
is "Yes", then all outputs are cleared at the start of the download.
If "No", the action depends upon the PCD firmware version or the
position of the PCD's "Reset outputs" jumper (if present): For new
PCD firmware which has the "Don't clear outputs" feature, outputs
are not cleared. For old firmware, outputs are always cleared, but
when they are cleared is defined by the position of the PCD's "Reset
Outputs" jumper (if present) - if set to "Reset", then all outputs
are cleared at the START of the download, otherwise all outputs are
cleared at the END of the download.
The "Run all CPUs" switch puts all CPUs back into Run mode as soon
as the program has been successfully downloaded if it is "Yes". If
"No" then all CPUs remain in Stop.
If the "Clear all outputs" switch is "No", and the connected PCD's
firmware does not support this feature, then this prompt is
displayed:
├────────────────────────────────────────────────────────────────────────────────┤
│ WARNING: Old PCD firmware, outputs will be cleared!! Continue (Y or N) ? _ │
│ Configuration: F2=PCD type+memory F3=S-BUS F4=PCD modem F6=Gateway F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
Invokes SUPLD program. It reads the PCD's code, text and extension
memory segments (if present), and writes them to an absolute object
file (.UPL).
An upload can be done regardless of the CPU's status (Run, Stop etc.),
but uploading while the CPU is in Run may slightly affect he connected
CPU's program execution time.
If the code or text has been modified since it was downloaded (the
checksum is invalid), the uploader displays "Warning 1: Code or text
has been modified".
Pressing 'Y' starts the upload and the file is overwritten, 'N' or
ESCape aborts.
LOADER - Page 10
Invokes the SDNLD program with the /M (Map) switch. This dynamically
partitions the PCD's memory into code, text and extension memory
segments for each CPU. The partitioning must first be defined on the
"Configure/Hardware and memory" menu (press function key F2).
Pressing 'Y' continues and does the memory allocation, 'N' or ESCape
aborts.
This command deletes ALL the code, text and extension memory for
all the CPUs in the PCD. All CPUs are reset and will stay in Halt,
all Outputs are cleared.
LOADER - Page 11
Invokes the SDNLD program with the /S switch. This configures the
PCD's S-BUS station number, PGU port, S-BUS timing, master gateway
port and the PCD's modem if the PGU port uses a dial-up modem.
All CPUs are reset, and will go into Stop unless the "Run all CPUs"
switch is "Yes". All Outputs are cleared unless the "Clear all
outputs" switch is "No". The S-BUS station number alone can be
changed using the Debug program's "Write s-bUs station" command,
which does NOT reset the PCD or affect the outputs.
LOADER - Page 12
The compare is very fast because it does not actually compare each
byte, but only compares the segment sizes and their checksums.
If the CPU's memory and the PCD file match, this text is displayed
on line 24:
COMPARE OK: FILE <filename> and CPU n CONTENTS ARE THE SAME
If the program in the PCD's memory has been edited on-line using
a programming unit (SBUG or PG1), then the checksum of the program
has been invalidated, and "File Compare" will always fail, even if
compared with an uploaded (saved) copy of the new program.
LOADER - Page 13
All CPUs are reset, and will stay in Stop unless the "Run all CPUs"
switch is "Yes". All Outputs are cleared unless the "Clear all
outputs" switch is "No".
LOADER - Page 14
This command reads the memory allocation, S-BUS setup, gateway and
modem configuration from the connected PCD and saves it in the
PCDSETUP.DAT file in the current directory. The existing config-
uration in PCDSETUP.DAT is overwritten.
After uploading the setup, it can be viewed and edited using the
F2=PCD type+memory, F3=S-BUS, F4=PCD modem and F6=Gateway keys.
The "Configure" program (SCONFIG.EXE) can also be used, select the
"SAIA PCD CONFIGURATION" menus.
The setup can be written back to the PCD using the DOWNLOAD PCD SETUP
command.
Upload and download PCD setup commands are useful when changing the
PCD's RAM backup batteries.
This command can be used to download the data saved by the UPLOAD
PCD SETUP command.
Upload and download PCD setup commands are particularly useful when
changing the PCD's RAM backup batteries.
This command deletes ALL the code, text and extension memory for
all the CPUs in the PCD. All CPUs are reset and will stay in Halt,
all Outputs are cleared.
LOADER - Page 15
Valid CPU numbers are 0-6 for a PCD6, 0-1 for a PCD4, or 0
for the PCD1, PCD2 and PCD6.M5.
The connection between the P800 and the PCD6 CPU is bad.
Power off the PCD6, remove, clean and re-connect the P800.
The PCD1 cannot have a gateway. Correct the PCD type from
the "Hardware and memory" menu.
The connected PCD type does not match the PCD type selected
in the "Configure/Hardware and memory" menu. Press function
key F2 and correct it. Make sure the memory map is also
correct.
LOADER - Page 18
PCDs have one or two RAM memory backup batteries, which need to be
replaced every few years (see the "Battery Change" labels).
There is a battery on the main CPU board, which backs up the memory
containing the Registers, Flags, Timers and Counters data. On the
PCD1 and PCD2 this battery also backs up the memory allocation,
S-BUS, gateway and modem configuration, and the user program, texts
and extension memory, if RAM is being used.
On the PCD4, the PCD6.M5 and PCD6, memory allocation, S-BUS, gateway
and modem configuration, and the user program, texts and extension
memory are backed up by the battery on the public memory module, if
RAM is being used. Texts and Data Blocks 4000..7999 in extension
memory are also backed up by this battery.
To replace the batteries without losing any data, use this procedure:
2) Use the UPLOAD PCD SETUP command to upload the memory allocation,
S-BUS, gateway and modem configuration into the PCDSETUP.DAT file.
This can be skipped if the user program is in EPROM memory.
3) If changing the battery on the CPU card, you may want to save the
current values of Registers, Counters, Timers and/or Flags. If
the PCD has RAM extension memory containing Texts and Data Blocks
4000..7999, these may also need to be saved. Use the "Transfer
data" program (SDAT.EXE), upload the data you want to save into a
file.
4) SWITCH OFF THE PCD, then replace the batteries. Ensure the +ve and
-ve polarity is correct!
5) If the setup was saved in step 2, use the DOWNLOAD PCD SETUP
command to write it back into the PCD.
6) Download the programs and/or extension memory back into each CPU
using the DOWNLOAD FROM FILE TO CPU or DOWNLOAD EXTENSION MEMORY
commands.
8) The real time clock in the PCD (if fitted) may also need to be
reset using SBUG's "Write clocK" command.
LOADER - Page 20
3. SUPLD - UPLOADER
====================
The uploader SUPLD.EXE reads the code, text and extension memory
(if present) from any CPU and stores it in an absolute object file
(.UPL) with the same format as a ".PCD" file. The uploaded file can
be downloaded using SDNLD or disassembled using SDISASM. An upload
can be done regardless of the CPU's status (Run, Stop etc.), but
uploading while the CPU is in Run may slightly affect the CPU's
program execution time.
SUPLD 1 TEST /NX Uploads the code and text only from CPU 1
and stores it in file TEST.UPL. Extension
memory is not uploaded.
LOADER - Page 21
Example:
C:\>SUPLD 0 A:FRED.PCD
Uploading code
Uploading texts/DBs
Upload complete
If SUPLD is invoked from DOS, disk read and write errors will be
preceded by a standard DOS disk error prompt, for example:
This occurs when the checksum of the CPU's code and text
does not match the checksum stored in the CPU's header.
This normally occurs only if the code or text has been
modified using the debugger or the hand-help programming
unit. It can also occur if the CPU's header or memory has
been corrupted (low RAM backup battery etc).
The CPU number must be 0-6 for a PCD6, 0-1 for a PCD4 or
0 for a PCD1, PCD2 or PCD6.M5. If no CPU number is given,
then the file name must not be all digits, otherwise it is
interpreted as a CPU number.
LOADER - Page 23
The requested CPU does not exit, has never been programmed,
or does not contain a program name (if default file name is
to be used).
Is the COM port correct and is the PCD's PGU port connected
to it? The port number is defined on the "Configure/Serial
ports" menu.
0 Upload successful
1 Invalid command line parameter
2 Upload failed, communications or other error
3 Upload aborted with Ctrl+C or ESC
LOADER - Page 26
4. SDNLD - DOWNLOADER
======================
Examples:
C:\>SDNLD FRED 0 /R
Downloading code
Downloading texts/DBs
Downloading extension memory
CPU 0 running
Complete
LOADER - Page 28
C:\>SDNLD FRED /M
Allocating memory
Downloading code
Downloading texts/DBs
CPU 0 halted
CPU 1 halted
Complete
C:\>SDNLD /M
Allocating memory
CPU: 0 1
Code: 14 0 K lines
Text: 8 0 K bytes
Extn: 0 0 K bytes
Complete
C:\>_
The PCD does not have the required firmware version. There
are instructions in the .PCD file which WILL NOT RUN on
this PCD.
The .PCD file was designed to run on CPU <n> only, it will
probably not run correctly on the connected CPU.
The .PCD file was designed to run on S-BUS station <n> only,
it will probably not run correctly on the connected station.
LOADER - Page 30
If SDNLD is invoked from DOS, disk read and write errors will be
preceded by a standard DOS disk error prompt, for example:
The CPU number must be 0-6 for a PCD6 or 0-1 for a PCD4 or
0 for a PCD1, PCD2 or PCD6,M5. If no CPU number is given,
the destination filename must not be all digits, otherwise
it is interpreted as a CPU number.
The requested CPU does not exit, has never been programmed,
or memory has never been allocated. Doesn't occur if the
"/M" switch is given.
Error 13: Not enough space for code: Has nnK, needs nnK
Error 14: Not enough space for text: Has nnK, needs nnK
Error 15: Not enough extension memory: Has nnK, needs nnK
Error 29: Memory MAP in EPROM, can't change size of extension memory
Error 31: Not enough space for header, memory must be reallocated
The new feature which allows modem control strings for the
PCD to be defined from the "Configure/Modem for SAIA PCD"
menu cannot be used because CPU 0's contains a program, and
there is no space to extend the configuration header.
Reallocate the memory, then configure S-BUS and download
all the programs.
Error 32: PCD <version> only supports the "Factory Default" modem
The new feature which allows modem control strings for the
PCD to be defined from the "Configure/Modem for SAIA PCD"
menu is not supported by the version of the firmware in the
PCD. The firmware must be upgraded.
Error 37: PCDx.xx firmware does not support S-BUS Data Mode
Error 38: Only the PCD6.M3 supports serial channel 4 (PGU port)
Error 39: Incorrect memory allocation, the PCD does not contain
Flash EPROM
Error 40: Incorrect memory allocation, the PCD contains Flash EPROM
SDNLD returns the following status values to DOS or the parent process.
All non-zero values mean that the download or memory reallocation
failed, and PCD memory may be empty or corrupted. SDNLD will have
displayed an error message on the screen before exiting. The return
value can be checked by using ERRORLEVEL in a batch file.
0 Download successful
1 Invalid command line parameter
2 Failed, communications or other error
3 Download aborted with Ctrl+C or ESC
REVISION HISTORY
05-Jan-98 V2.1
1) Can generate HEX files for PCD2's 4MBit EPROM.
2) New error messages 33..35.
21-Jun-96 V2.0
03-Jun-96 B2.0d
1) Add ERROR 33: INVALID PCDn MEMORY SIZE, PRESS F2 AND SELECT
64 OR 128KB. The PCD1 and PCD2 accept 64 or 128KB EPROMs
only. Remove 32KB EPROM from EPROM TYPES box in section 5.
2) Show PCD1 RAM/EPROM jumper in 5.6.
16-Oct-95 $198
1) Support for PCD1.
24-Apr-94 V1.9
06-Feb-95 $18A
1) Now programs the gateway configuration into EPROM or
hex files. This is defined on the "Configure/Gateway
master port" screen, displayed by pressing F6.
2) Added "F6=Gateway" so that the gateway master port
configuratiuon can be viewed and edited.
3) Added "F7=Password" to allow a password and timeout to
be defined and programmed into the EPROM.
4) New error messages:
ERROR 31: INVALID TIMEOUT, RANGE IS 1..60 MINUTES
ERROR 32: MISSING PASSWORD
16-Aug-94 $188
1) Now programs the "extended header" into EPROM. This
programs the "Modem for SAIA PCD" reset and init strings
defined on the new "Configure/Modem for SAIA PCD" screen.
2) Now has a new "verify configuration" prompt to give
the user the opportunity to verify and change the config-
uration before programming the EPROMs:
VERIFY CONFIGURATION: Press F2, F3 then F4, ENTER
accepts, ESC aborts
The "check configuration" screen has been removed.
3) New error messages:
ERROR 29: CAN'T RUN PROGRAM: SCONFIG.EXE
ERROR 30: MODEM TYPE <modem name> NOT FOUND IN MODEM.DAT
18-Jul-94 $187
1) Add function keys for configuration (calls SCONFIG):
F2=Hardware and memory, F3=S-BUS, F4=PCD modem. Remove
section 2.4 "Check configuration".
02-Apr-94 $184
1) SWMR 601: Starter Package checks.
Add ERROR 27 and 28.
2) <S> now skips the programming of an EPROM, was SPACE which
was too easy to press by mistake.
25-Sep-93 $174
1) SWMR 530: Display "Check configuration" screen to allow
the configuration to be checked before programming it into
EPROMs. See section 2.4.
31-Jul-93 $173
1) Now creates "extension memory initialization segment".
New /NX /CX command line switches to control generation
of this segment (7).
19-Jul-93 $171
1) Removed ERROR 17, changed text of ERROR 20.
2) Now programs "extension memory initialization segment"
into text memory.
09-Jun-93 V1.7
1) Now programs the extension memory mam and the S-BUS PGU
port configuration into EPROMs.
2) Supports the PCD2 which has only one EPROM.
3) Supports new EPROM types, if the ERTEC PGS53 is being used.
4) The "Hex file name" and "Hex format" fields or now only
displayed if the "Create HEX files from PCD files" operation
is selected.
5) Function key F5 displays the pop-up directory window when
the cursor is in a filename entry field.
6) New error messages 24 to 27.
7) Add sections on PCD7.R1/R3 and PCD2 memories.
31-Jan-92 $155A
1) Change ERROR 1 text.
06-Dec-91 $154
1) Now has F1=hyperhelp.
2) Added error messages 22 and 23.
09-Oct-91 $153
1) Add description of new PCD6.R600 memory module (5.2).
2) Re-write to work with up to 1MB of EPROMs to support new
PCD6.R600 memory module. Previously SPROM create the image
for up to 8 EPROMS (256K bytes) in the IBM PC's memory, but
this method was not possible for larger memories.
3) "Processing file" box not shown anymore. Files are now read
during programming.
4) "Verifying EPROM" box not shown anymore. This pass was
removed to speed up the process, since the EPROM data is
verified by the EPROM programmer during programming, and is
again checked by the PCD when it verifies the EPROM checksum
during it's power-up sequence.
5) New error messages:
ERROR 15: MEMORY ALLOCATION TOO BIG FOR THIS EPROM TYPE
ERROR 21 CHECKSUM ERROR ON FILE: <filename>
6) Can now create extended Tektronix hex files > 64K.
12-Sep-91 $152
1) Stores menu data in PCDMENU.DAT, file SPROM.DAT not used.
10-May-91 $151
1) Now handles "ERTEC PGS53" programmer type.
2) "PCD6.R500" can now be selected as the EPROM type.
3) New error messages 16..20, plus messages from ERTEC PGS53.
Error 6 and 10 message texts changed.
4) Failed and aborted status boxes now blink to make them more
noticeable.
5) "Blankcheck" now displays "EPROM IS BLANK" on line 23.
6) Hex files now have the extension ".HEX" (was ".1" to ".8").
The last character of the hex file name is now "1" to "8"
to indicate the EPROM number.
7) New status box "LOADING FIRMWARE INTO PGS53".
8) A fancy beep is now issued when the programming of an EPROM
is complete.
9) A command-line switch "/19" has been added, this sets the
baud rate for communication with the EPROM programmer to
19200 baud. The default is 9600 baud.
10) Added EPROM/memory card table to section 5.
04-Dec-90 V1.4
1) SWER 2: Added error message 15, PCD4 can have only 2 eproms.
20-Jun-90 $13x
1) If the processor type is PCD4, the menu shows only two CPUs
(0 and 1). The PCD4 always has two EPROMs, so instead of the
"required eproms" box, a "number of eproms" box is shown.
2) The EPROM type (27C256, 27C512 or 27C1001) can now be selected.
This is for use with the new PCD7.Rxx module, or the PCD4.R110
modified for 27C512. (SWMR 121 and 122).
3) Added "ERROR 14: MODIFIED PCA2.P16 CAN ONLY PROGRAM 27C256
EPROMS".
4) Hex files can now contain more than 64K (except Tektronix).
5) Now has F1=Help. Help text in SPROM.HLP.
6) Added details of memory card types to section 5.
22-Nov-89 V1.3
1) More than one '.' allowed in a file name during entry (SWMR 7).
2) Allows disk drive in file name (SWMR 28).
3) Now works in colour as defined in PCDCOLOR.DAT.
4) Saves menu data in SPROM.DAT.
5) Now supports COM1, COM2, COM3 and COM4.
22-Mar-88 V1.0
Update after final code test. Added EPROM verify after
programming.
11-Mar-88 Preliminary.
CONTENTS
════════
Page
1. OVERVIEW . . . . . . . . . . . . . . . . . 1
2. USING SPROM . . . . . . . . . . . . . . . 2
2.1 Program EPROMs from PCD files . . . . 4
2.2 Blankcheck EPROMs . . . . . . . . . . 7
2.3 Create HEX files from PCD files . . . 8
2.4 Using a password . . . . . . . . . . . 9
3. ERROR HANDLING . . . . . . . . . . . . . . 10
3.1 Error messages . . . . . . . . . . . . 10
3.2 Messages from ERTEC PGS53 . . . . . . 14
6. EPROM PROGRAMMERS . . . . . . . . . . . . 26
6.1 ERTEC PGS49 . . . . . . . . . . . . . 26
6.2 ERTEC PGS53 . . . . . . . . . . . . . 27
6.3 PCA2.P16 . . . . . . . . . . . . . . . 27
1. OVERVIEW
════════════
SPROM provides all the functions needed to program EPROMs for the
SAIA PCD range of processors:
2. USING SPROM
═══════════════
C:>SPROM [switch]
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD EPROM PROGRAMMING UTILITIES V2.1 PCD Type: PCD6.M1/M2 │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│ Operation, press SPACE to select: Program EPROMs from PCD files │
│ │
│ Hex file name (*1.HEX to *8.HEX): __________ Hex format: Intel │
│ │
│ EPROM programmer type: ERTEC PGS49 EPROM type: I27256 (32KB) │
│ │
│ CPU 0: __________________________________________ │
│ │
│ CPU 1: __________________________________________ │
│ │
│ CPU 2: __________________________________________ │ ┐
│ │ │
│ CPU 3: __________________________________________ │ │
│ │ │ PCD6
│ CPU 4: __________________________________________ │ ├──── ONLY
│ │ │
│ CPU 5: __________________________________________ │ │
│ │ │
│ CPU 6: __________________________________________ │ │
│ │ ┘
23 │ BAUD RATE: 19200 │
├────────────────────────────────────────────────────────────────────────────────┤
24 │ SPACE selects operation, ARROW or TAB moves cursor, ESC exits. │
│ F2=PCD type+memory F3=S-BUS F4=PCD modem F6=Gateway F7=Password F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
The menu contains two types of entry fields, select fields and file
name entry fields. Entry fields are shown in bold video.
Select fields allow the selection of one choice from a list of two or
more choices, using the SPACE bar.
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 3
File name entry fields are indicated by a dotted line, and accept
valid DOS file names. If on a file name entry field, pressing the
SPACE bar clears to the end of the field, and moves the cursor to
the next field. Pressing function key F5 displays a pop-up window
containing showing all the ".PCD" files, from which a file name can
be chosen.
If the PCD4 processor type has been selected during the configuration,
then only two CPUs can be present (0 and 1), and only two file name
fields are displayed.
Movement from one field to another is by the use of the ARROW, TAB,
BACKTAB or SPACE keys.
The blank area to the left of the CPU file name fields is for the
pop-up status window display, described in the following sections.
Line 23 is for error and status messages. Error messages are displayed
in bold video, accompanied by a "beep".
Line 24 is the prompt line. This indicates which keys can be used,
or in certain cases will ask a question requiring a Yes or No (Y or N
key) response.
On the menu, the first select field, "Operation", allows the selection
of the operation to be performed. This can be:
Answering 'Y' (or 'y') begins the operation, 'N' (or 'n') aborts,
returning the cursor to the menu.
When not executing an operation, the ESCape key will exit SPROM,
returning the the main PCD Programming Utilities menu or to DOS,
depending on from where SPROM was invoked.
The "Hex file name" and the "Hex format" fields are used only when
the "Create HEX files from PCD files" operation is selected. See
section 2.3.
This operation requires the file names of each PCD file for each CPU
to be entered, and the "EPROM programmer type" and "EPROM type" to be
selected. The correct configuration must also have been defined from
the "Configure/Hardware and memory" (F2), "Configure/s-Bus
communications" (F3) and "Modem for SAIA PCD" (F3), "Configure/
Gateway master port" (F6) screens. To define a password to be
programmed into EPROM, press F7, see section 2.4.
CPU file names are the names of each absolute object file (executable
program) to be programmed for each CPU. The default file type is
".PCD", this is automatically appended to the file name, and need not
be entered. ".UPL" (uploaded programs) can also be programmed, but
the ".UPL" file type must be entered.
┌──────────────────────────┐
│ ╔═══ PCD6.R5xx/R6xx ═══╗ │
│ ║ ┌──┬───┬───┬───┬───┐ ║ │
│ ║ │┌┐│ 2 │ 4 │ 6 │ 8 │ ║ │
│ ║ │││├───┼───┼───┼───┤ ║ │
│ ║ │└┘│ 1 │ 3 │ 5 │ 7 │ ║ │
│ ╚ └──┴───┴───┴───┴───┘ ╝ │
└──────────────────────────┘
During programming, the status window indicates the EPROM and the
hexadecimal address of the byte being programmed. Addresses are from
0 to 1FFFF hex according to EPROM type, but usually not all bytes
in an EPROM require programming. During programming, each individual
byte is verified automaticlly by the EPROM programmer.
┌──────────────────────────┐
│ ╔══════════════════════╗ │
│ ║ PROGRAMMING ║ │
│ ║ EPROM 1 ║ │
│ ║ ║ │
│ ║ ADDRESS 001234 ║ │
│ ╚══════════════════════╝ │
└──────────────────────────┘
┌──────────────────────────┐
│ ╔══════════════════════╗ │
│ ║ ║ │
│ ║ OPERATION ║ │
│ ║ COMPLETE ║ │
│ ║ ║ │
│ ╚══════════════════════╝ │
└──────────────────────────┘
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 6
┌──────────────────────────┐ ┌──────────────────────────┐
│ ╔══════════════════════╗ │ │ ╔══════════════════════╗ │
│ ║ ║ │ │ ║ ║ │
│ ║ OPERATION ║ │ │ ║ OPERATION ║ │
│ ║ ABORTED ║ │ │ ║ FAILED ║ │
│ ║ ║ │ │ ║ ║ │
│ ╚══════════════════════╝ │ │ ╚══════════════════════╝ │
└──────────────────────────┘ └──────────────────────────┘
This checks that the entire EPROM has been erased (all data bytes
are 0FFH).
For this operation, the correct "EPROM programmer type" and "EPROM
type" must be selected, the file names are not required.
┌──────────────────────────┐
│ ╔══════════════════════╗ │
│ ║ ║ │
│ ║ CHECKING EPROM ║ │
│ ║ IS BLANK ║ │
│ ║ ║ │
│ ╚══════════════════════╝ │
└──────────────────────────┘
For this operation, the CPU file names must be entered, the correct
"Hex format" and "EPROM type" must be selected, and the "Hex file
name" must be entered. The correct memory allocation and S-BUS
configuration must also have been defined from the "Configure/
Hardware and memory" (F2) and "Configure/s-Bus communications" (F3)
and "Modem for SAIA PCD" (F3) menus.
All hex files have the extension ".HEX". The last digit of the file
name indicates which EPROM each file is for. For example, if the
hex file name is "DEMO", and 2 EPROMs are required, then 2 hex files
are produced: "DEMO1.HEX" and "DEMO2.HEX", which should be programmed
into EPROMs 1 and 2. If the entered hex file name is 8 characters
long, then the last character is lost.
┌──────────────────────────┐
│ ╔══════════════════════╗ │
│ ║ ║ │
│ ║ CREATING HEX FILE ║ │
│ ║ DEMO1.HEX ║ │
│ ║ ║ │
│ ╚══════════════════════╝ │
└──────────────────────────┘
At the start of the operation, all files with names matching those
that will be created are deleted.
The size of each hex file depends on the selected "EPROM type".
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 9
PCDs with the latest firmware (PCD2 V003, PCD4 V005, PCD4.M4 V001,
PCD6.M5 V004, PCD6 V007) now have a password protection mechanism.
╔═════════════════════════════════════════╗
║ CONFIGURE ONLINE PASSWORD ║
║ ║
║ Password: RUMPLESTILTSKIN__________ ║
║ Timeout: 0_ (1..60 minutes ║
║ ║
║ ENTER accepts, ESCape removes password. ║
╚═════════════════════════════════════════╝
Once the password has been programmed into EPROM, it can be changed
only by re-programming all the EPROMs.
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 10
3. ERROR HANDLING
══════════════════
Recovery is possible from all errors by correcting the fault and re-
starting the operation. See the notes accompaying the error message
descriptions below.
ERROR 7: CODE SEGMENT TOO SMALL: CPU n: FILE name: HAS nnK: NEEDS nnK
ERROR 8: TEXT SEGMENT TOO SMALL: CPU n: FILE name: HAS nnK: NEEDS nnK
The selected EPROM type cannot be used with the PCD type
selected on the "Configure/Hardware and memory" menu.
The checksum on the .PCD or .UPL file was invalid. This can
be caused by trying to process the wrong file type, or by a
corrupted file, or by a rare personal computer memory read
error. Retry the operation, or re-generate the file and try
again.
ERROR 24: EXTENSION MEMORY TOO SMALL: CPU n: FILE x: HAS nK: NEEDS nK
The PCD modem type which has been selected from the
"Configure/Modem for SAIA PCD" screen (press F4) cannot be
found in the MODEM.DAT file. Perhaps the wrong MODEM.DAT
file is being read: SPROM first looks for MODEM.DAT in the
current directory, then in the PCD Programming Utilities
directory.
ERROR 33: INVALID PCD1 MEMORY SIZE, PRESS F2 AND SELECT 64 OR 128KB
ERROR 33: INVALID PCD2 MEMORY SIZE, PRESS F2 AND SELECT 64/128/512KB
ERROR 34: CANNOT PROGRAM 4MBIT (512KBYTE) EPROMS, CAN ONLY CREATE
HEX FILES
SPROM does not support 4 megabit EPROMs, but if the 4MBit
(512KB) EPROM type is selected, SPROM can be used to
create HEX files.
ERROR 35: FLASH EPROM MEMORY IS SELECTED, PRESS F2 AND DEFINE EPROM
MEMORY
SPROM cannot program Flash EPROM memory, Flash EPROM is
programmed by the downloader.
The ERTEC PGS53 returns its own detailed error message texts, which
do not have error message numbers:
PROGRAMMING ERROR: (LEFT SOCKET) ADR: nnnnnnH REQU: ddH ACT: aaH
Self explanatory.
One file is produced for each EPROM, the last character of each file
is the EPROM number (1 to 8). All hex files have the extension
".HEX".
If the EPROM type is 271001 por 27010, which contains more than 64K
bytes, then the extended hex file formats are used, which contain
addresses greater than 16 bits.
The most common is the "Intel" hex format, which will be accepted by
almost all EPROM programming software.
Motorola: Exorciser format for EPROMs up to 64K bytes (S1 records with
16-bit addresses), or Exormax format for 128K byte EPROMs
(S2 records with 24-bit addresses).
The end-of-file record consists of the colon start character, the byte
count (always "00"), the execution address (always "0000"), the record
type (always "01"), and the usual record checksum.
Examples:
:100000000102030405060708090A0B0C0D0E0F0045<CR><LF>
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0<CR><LF>
:00000001FF<CR><LF> eof record │ │
││ │ │ │ │ │
││ │ │ │ │ └─── Terminator
││ │ │ │ └────── Checksum (2 digits)
││ │ │ └──── Data characters (2 per byte), or checksum if eof record
││ │ └────── Record type ("00" for data record, "01" if eof record)
││ └────────── Address (4 digits, "0000" if eof record)
│└──────────── Byte count (2 digits, "00" if eof record)
└───────────── Start character
:02000002aaaaCC<CR><LF>
│ │ │ │ │
│ │ │ │ └─── Checksum
│ │ │ └─────── Offset address (segment, multiplied by 16)
│ │ └───────── Record type "02" = extended address record
│ └───────────── Always "0000"
└─────────────── Always "02" for 2 bytes of data
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 17
Each data record begins with two start characters, either "S1" or
"S2". The third and fourth characters are the number of data bytes
in the record+3. For "S1" records, the next four characters are the
ROM address of the first data byte in the record. For "S2" records,
the next six characters are the address. The data bytes follow, each
byte represented by two hex digits (the number of data bytes is three
less than the byte count). Next is the checksum, which is the 1's
complement of the sum of the byte count, address and data bytes
before conversion to ASCII.
The end-of-file record begins with start characters "S9", the byte
count (always "03"), the address (always "0000") and the eof record
checksum.
Examples:
S1130000102030405060708090A0B0C0D0E0F0045<CR><LF>
S1130010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0<CR><LF>
S1030000FC<CR><LF> eof record │ │
│ │ │ │ │ │
│ │ │ │ │ └─── Terminator cr/lf
│ │ │ │ └────── Checksum (2 digits)
│ │ │ └─── Data characters (2 per byte), or checksum if eof record
│ │ └─────── Address (4 digits, "0000" if eof record)
│ └───────── Byte count + 3 (2 digits, "00" if eof record)
└─────────── Start characters ("S1" if data record, "S9" if eof record)
S214000000102030405060708090A0B0C0D0E0F0045<CR><LF>
S214000010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0<CR><LF>
│ │ │ │ │ │
│ │ │ │ │ └─── Terminator cr/lf
│ │ │ │ └────── Checksum (2 digits)
│ │ │ └─── Data characters (2 per byte)
│ │ └─────── Address (6 digits)
│ └───────── Byte count + 4 (2 digits)
└─────────── Start characters "S2"
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 18
16-bit addresses
────────────────
Each record begins with a slash start character '/', followed by the
four digit address of the first data byte. Next is a 2-digit byte
count,
representing the number of data bytes in the record. The next 2 digits
are the checksum of the address and byte count. Data bytes follow, rep-
resented by pairs of hex digits. Following the data bytes is a checksum
of the data bytes only.
Checksums are the modulo-256 sum of the 4-bit binary values of each hex
digit to be checksummed.
Example:
/000010010102030405060708090A0B0C0D0E0F0045<CR><LF>
/00101002FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27<CR><LF>
/00000000<CR><LF> eof record │ │
││ │ │ │ │ │
││ │ │ │ │ └── Terminator cr/lf
││ │ │ │ └───── Data checksum (2
digits)
││ │ │ └───- Data characters (2 per byte)
││ │ └───────- Checksum of address and byte count
││ └─────────- Byte count (2 digits, "00" if eof record)
│└───────────- Address (4 digits, "0000" if eof record)
└───────────── Start character
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 19
The checksum is the modulo-256 sum of all the hex ASCII nibbles in the
record, excluding the '%' (and the checksum itself).
%3B6F7101234567812345678123456781234567812345678123456781224<CR><LF>
││ ││ │││
││ ││ ││└──── Data characters
││ ││ │└───── Address (1 nibble in this example)
││ ││ └────── Number of nibbles in address (1 nibble in this example)
││ │└──────── Checksum (2 digits)
││ └───────── Record type (6 = data record, 8 = end record)
│└─────────── Number of nibbles in record
└──────────── Start character '%'
%3E6274FFC01234567812345678123456781234567812345678123456781234<CR><LF>
││ │
│└──┴───── 4-digit address
└───────── Number of nibbles in address
The end-of-file record is type 8, with the same address as the FIRST
record in the file, and no data bytes:
%0A8404FFC0<CR><LF>
│ ││ ││
│ ││ │└────── Address - must be same as first record's address
│ ││ └─────── Number of nibbles in address
│ │└───────── Checksum (2 digits)
│ └────────── Record type (8 = end-of-file record)
└──────────── Number of nibbles in record
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 20
┌───────────────┬───────────────┬──────────────────┬───────────────┬───────────┐
│ MEMORY SIZE │ EPROMs │ MEMORY MODULE │ PUBLIC MEMORY │ PCD TYPE │
╞═══════════════╪═══════════════╪══════════════════╪═══════════════╪═══════════╡
│ 64KB │ 2 x 27256 │ PCD6.R500 │ PCD6.R100 │ PCD6 │
│ (16K lines) │ 2 x 27256 │ PCD4/PCD7.R1xx │ - │ PCD4/6.M5 │
│ * = only half │ 2 x 27512 │ PCD7.R1xx │ - │ PCD4/6.M5 │
│ of 271001 is │ 2 x 271001 * │ PCD7.R1xx │ - │ PCD4/6.M5 │
│ accessible │ 1 x 271001 │ - │ - │ PCD1/PCD2 │
├───────────────┼───────────────┼──────────────────┼───────────────┼───────────┤
│ 128KB │ 4 x 27256 │ PCD6.R500 │ PCD6.R100 │ PCD6 │
│ (32K lines) │ 2 x 27512 │ PCD7.R1xx/.R300 │ - │ PCD4/6.M5 │
│ │ 2 x 271001 * │ PCD7.R1xx │ - │ PCD4/6.M5 │
│ │ 1 x 271001 │ - │ - │ PCD1 │
├───────────────┼───────────────┼──────────────────┼───────────────┼───────────┤
│ 256KB │ 8 x 27256 │ PCD6.R500 │ PCD6.R100 │ PCD6 │
│ (64K lines) │ 2 x 271001 │ PCD7.R1xx/.R300 │ - │ PCD4/6.M5 │
├───────────────┼───────────────┼──────────────────┼───────────────┼───────────┤
│ Up to 1MB │ 2, 4, 6 or 8 │ PCD6.R600 │ PCD6.R200 │ PCD6 │
│ (256K lines) │ x 271001 │ (mixed RAM/EPROM)│ │ │
└───────────────┴───────────────┴──────────────────┴───────────────┴───────────┘
This memory card is only for PCD6 systems, it is plugged into the
PCD6.R1 public memory module. Either 2, 4 or 8 x 27256 EPROMs (max.
200nS, 12.5Vpp) can be used.
The EPROMs can be removed from the card and programmed individually,
or can be programmed while mounted on the R500 card by using the
PCD8.P71 switch box to select each EPROM (use EPROM type PCD6.R500).
This memory card plugs into the PCD6.R200 public memory module (it
won't work on the R100). Only 271001 pr 27010 (128K byte) EPROMs can
be used. It is also possible to have RAM on this card for extension
memory, containing writable Texts and Data Blocks, with read-only
Texts and Data Blocks being stored in EPROM.
At present, the PCD4 can address only 128K bytes of a 271001 EPROM.
The remaining 128K bytes in the pair of 128KB EPROMS cannot be
accessed. If over 64K bytes (16K code lines) is addressed in a
single 128KB EPROM, if hex files are produced then these cannot be
programmed using an EPROM programmer which supports only 16-bit
addresses in hex files.
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 22
The PCD1 accepts only one EPROM. Either a 64K byte (28-pin 27512) or
a 128K byte (32-pin 271001/27010) EPROM can be used. A jumper on the
main board selects EPROM or RAM, both EPROM types are pin-compatible.
If the smaller 28-pin 64K byte EPROM is used, this should be inserted
in the lower 28 pins of the 32-pin socket.
┌── Set jumper to
│ position 'E' to use
┌───o───┐ ┌──┐ and EPROM
32-pin EPROM (271001/27010) 1│. .│32 │:║│
2│. .│31 │:║│
┌───o───┐ └──┘
28-pin EPROM (27512) │ │ RE R = RAM
│ │ E = EPROM
│ │
│ │
│ │
└───────┘
The PCD2 accepts only one EPROM. Either a 64K byte (28-pin 27512) or
a 128K byte (32-pin 271001/27010) EPROM can be used. A jumper on the
main board selects EPROM or RAM, both EPROM types are pin-compatible.
If the smaller 28-pin 64K byte EPROM is used, this should be inserted
in the lower 28 pins of the 32-pin socket.
┌───o───┐
1│. .│32 32-pin EPROM (271001/27010)
Set the jumper to 2│. .│31
position "E" to ┌───o───┐
use an EPROM ──────┐ │ │ 28-pin EPROM (27512)
│ │ │
┌──┐ │ │
R = RAM │:║│ │ │
E = EPROM │:║│ │ │
└──┘ └───────┘
RE
If EPROM memory is used, then the 24K bytes of built-in RAM can be
used as extension memory, to contain writable Texts and Data Blocks.
NOTE: PCD2 revision M hardware supports a 512KB (4MBit) EPROM.
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 23
The EPROM types which can be programmed are limited by the EPROM
programmer:
(*) The PCA2.P16 uses a 21V programming pulse (Vpp), and type F27256
should normally be selected. However, the P16 can be modified
to supply a 12.5V programming pulse, so I27256 types can be
programmed.
EPROM type F27256 uses a 21V programming pulse, which will DAMAGE
12.5V EPROMs. Some 128K byte EPROMs have the "mask ROM" pinout, and
are not compatible with the PCD hardware, e.g. TC571001, 27C1000.
Different EPROM types have different Vcc and Vpp voltages during
programming. If the wrong voltages are applied because the wrong EPROM
type is selected the EPROM could be damaged or unreliably programmed,
but generally a +/- 0.25V difference is acceptable, providing the byte
programming time is not too short, e.g. don't program 2ms/byte devices
with a 100uS/byte algorithm.
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 24
6. EPROM PROGRAMMERS
═════════════════════
Drivers for almost any type of EPROM programmer can be added, the only
requirement is that it has an RS232 serial interface, which can be used
to select the EPROM type, and to read, write and blankcheck the EPROMs.
New drivers may be added if there is enough customer support...
This programmer can program the full range of EPROM types, and also
has a "copy" socket which enables very fast EPROM duplication using
ERTEC's "PGS.EXE" software (supplied with the PGS53). SPROM uses only
the left-hand socket for programming EPROMs.
The ERTEC PGS53 returns its own detailed error message texts, which
do not have error message numbers. See section 3.2.
Always wait at least 15 seconds after power-up before using the PGS53
(calibration time).
6.3 PCA2.P16
─────────────
This old SAIA PCA2.P16 programmer can be used to program only 27256
EPROMs. SAIA does not recommend this because its very slow - but it
can be used if nothing else is available. SPROM uses only the right-
hand "COPY" socket.
The baud rate of the P16 should also be set to 9600 by setting the DIL
switches inside the unit, and the EPROM Programmer baud rate set to
9600 on the "Configure/Serial ports" menu. The faster speed decreases
the programming time.
If the P16 is not modified, the 21V programming pulse will PERMANENTLY
DAMAGE 12.5 Vpp EPROMS. Once modified, the P16 CANNOT be used to
program EPROMs which require 21 Vpp.
The fast programming algorithm used by the P16 does not raise the
supply voltage (Vcc) to 6V, as is required by the algorithm, therfore
programming may not be as reliable as that done by the ERTEC machines.
(Using the slow algorithm would take 50 minutes to program 32KB!).
SPROM - SAIA PCD EPROM PROGRAMMING UTILITIES - Page 28
PCA2.P16 Continued
──────────────────
The modification for 12.5 Vpp operation can take two forms:
2) Use the 27256 LED driver output from the 74LS273, pin 12,
buffered via two spare inverter gates on a 7406, to drive a
DIL reed relay which, when activated, connects a 10K variable
resistor across R3. When the 27256 LED is lit, the programming
voltage should be adjusted for 12.5V +/- 0.1V. When not lit
(another EPROM type is selected), the programming voltage
will be the original 21V.
The text memory segment may not be large enough to hold the extension
memory initialization segment, and a "TEXT SEGMENT TOO SMALL" error
might occur. This must be corrected by increasing the text memory size
from the "Configure/Hardware and memory" (F2) menu to the size shown.
If not enough memory is available, one of the SPROM command line
switches described below can be used.
For example:
REVISION HISTORY
05-Jan-97 V2.1 No changes
09-Jun-93 V1.7
1) Don't list unused I/Os after the last I/O address
(graphical format) rounded up to the next 100 boundary.
This saves paper because most PCDs don't have 8192 I/Os.
2) Now processes elements which are referenced inside
encoded binary LAN texts (defined in $LAN..$ENDLAN).
3) Handles new TFR and CPBI instructions.
06-Dec-91 $154
1) LAN text processing updated.
2) Now handles '@' in STXT texts correctly (SWER 225).
10-Sep-91 $152
1) ST / TR lists now show incoming and outgoing ST/TR numbers.
2) Change "Fatal error 0" text.
05-Oct-90 V1.4
1) Data Blocks now listed.
2) Added "Error 23: Data block <n> multi-defined" and "Error 24:
Invalid data block number: <n>".
3) If a constant is not a valid floating point number, the
floating point value is left blank (was ?.??????).
4) More detail shown for Graphical representation (3.2):
. = not referenced and not defined
X = referenced via Index register (might not be defined)
N = defined but not referenced
U = directly referenced but undefined
D = defined and directly referenced
5) Initial Steps are now listed with Steps.
22-Nov-89 V1.3
1) Corrected problem with tab characters (bug in V1.2).
2) Now lists resources referenced in texts (SWMR 34).
3) Gives help if invoked with an incorrect command line from DOS.
4) Correct the sort order of 32-bit constants (bug in V1.2).
5) Now works faster, better file buffering.
6) Changed switches /L & /NL to /N & /NN, for Numeric, NoNumeric.
7) Changed switch /N /NN to /D /ND for Definition instructions.
22-Mar-88 V1.2
1) Allow '/' or '-' characters as switch delimiters (2.0).
2) Missing or invalid install data file is now a fatal
error. Add "fatal error 0: Improper installation".
Remove section 4.1 and Warning 1. Section 4.2 becomes
4.1, 4.3 becomes 4.2.
3) Registered Users name now appears on each page of the
Resource Table (3.0 and 6.0).
16-Sep-87 V1.0
1) Name of output file displayed at start of processing
(2.0).
2) Decimal, hexadecimal and floating point representations
of 32-bit constants now listed in table (3.1, 6.0)
3) The length of each code block is now listed (3.1, 6.0)
4) The length of each text is now listed (3.1, 6.0)
4) Better error detection (4.0), but certain errors are NOT
detected if the relevant pass is skipped (4.0).
5) New error messages (4.3).
6) Add example section (6.0).
CONTENTS
========
PAGE
1. OVERVIEW 2
5. HOW IT WORKS 12
5.1 Performance and Limitations 12
1. OVERVIEW
============
The graphical representation shows a matrix for each element and block
type, with one position representing each element or block. If the
postion shows a character, then the element or block is used, if "."
then it is not used.
Functional Diagram
------------------
+--------+
| .RES |
+---->| file |
| | |
| +--------+
+--------+ ************ |
|.PCD or | * *------+
| .UPL |--------->* SRES * OR
| file | * *------+
+--------+ ************ |
| +++++++++++
| + .RES +
+---->+ to +
+ printer +
+++++++++++
SRES - RESOURCE TABLE GENERATOR - Page 3
The resource table generator is invoked from DOS with the command:
Where:
File names may contain an optional drive and path specification, for
example "A:\SOURCE\".
SRES - RESOURCE TABLE GENERATOR - Page 4
Invocation continued
--------------------
Invocation example:
C:\>SRES CONTROL
C:\>_
SRES returns a value to DOS on exit. This value can be used by the
parent process or batch file (using the ERRORLEVEL parameter) which
invoked SRES.
Each page of the Resource Table has two title lines, giving the module
name and its creation date and time, the creation date and time of
the Resource Table, the page number, and the Registered User name.
Each element, constant and code block is grouped by type and sorted by
value.
Elements which are referenced indirectly via the index register are
grouped and sorted separately, and are listed after the directly
referenced elements. For indexed elements, the element description is
postfixed with an "x", for example "I|Ox" and "Fx".
Element, constant and code block types are as follows. When grouped
type, the following order is used (the same order is used for the
graphical representation).
Element types:
Constant types:
Special instructions:
Element types:
Constant types, these are separated into 13-bit (K) constants and
32-bit (CONST) constants.
Elements and code blocks are grouped by type, and are shown in a
matrix of up to 100 elements or blocks per line, in sub-groups of 10,
so that an individual element can be quickly located by its number.
All fatal errors cause the program to terminate, and return is made
to DOS or the invoking menu. After a fatal error, the .RES file or
printout will usually be either empty or not present.
The command line must contain the name of the input .PCD or .UPL
file to be processed.
The entered file name does not produce a valid DOS file name.
The file does not exist (if it's a .PCD or .UPL input file), or
the file cannot be opened for writing if it's a .RES output
file.
These do not prevent the creation of the resource table, but may affect
its content. If a recoverable error is detected, the bad program line
is ignored.
Errors 10 to 14 are detected during the first pass. The are listed at
the start of the resource table.
The error messages are displayed on the console, and also appear in the
resource table. The number of errors found is also listed at the end
of the table, and as a sign-off message on the console:
The code block at Line <n> has been defined more than once in
the same program, only the first definition is processed. This
can be caused in uploaded programs if another copy of the block
was loaded using the debugger's "File Load" command.
Text <n> has been defined more than once in the same program,
only the first definition is processed. This can be caused in
uploaded programs if another copy of the text was loaded using
the debugger's "File Load ... tExt" command.
The text number is greater than 3999. This error can be caused
by corrupted text memory.
Data block <n> has been defined more than once in the same
program. This can be caused in uploaded programs is a second
copy of the data block was downloaded using the debugger's
"File Load ... Db" command.
The data block number is greater than 7999. This error can
be caused by corrupted data block memory.
SRES - RESOURCE TABLE GENERATOR - Page 12
5. HOW IT WORKS
================
The total number of elements, constants and code blocks may be very
large in a large program. This means that a large ammount of memory
would be required to hold a data structure containing information on
all the elements, constants and blocks in a large program.
Elements are processed in the same order as they appear in the table.
The input file is processed in up to 4 passes. Less than 4 passes may
be done if a particular pass is not required.
The input file is read in blocks of 32K bytes (8K instruction lines),
so if the file is less than 32K bytes in size, it will actually be read
only once, and not once each time it is processed. Most .PCD/.UPL files
are less than 32K bytes.
TYPE NUMBER ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
0000000000 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 7777777777 8888888888 9999999999
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
0000 D.D.DDDD.D DDDDDDD.DD D.DDDDDDDD DDDDD....D DDDDDDDDDD DDDDDDDDDD D......... .......... .......... ..........
0100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0200 D.D.DDDD.D DDDDDDD.DD D.DDDDDDDD DDDDD....D DDDDDDDDDD DDDDDDDDDD .......... .......... .......... ..........
0300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0400 D.D.DDDD.D DDDDDDD.DD D.DDDDDDDD DDDDD....D DDDDDDDDDD DDDDDDDDDD .......... .......... .......... ..........
0500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0600 D.D.DDDD.D DDDDDDD.DD D.DDDDDDDD DDDDD....D DDDDDDDDDD DDDDDDDDDD .......... .......... .......... ..........
0700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1000 DDDDDDDDDD DDDDDD.... .......... .......... .......... .......... D......... .......... .......... ..........
1100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
5000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
5100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
...
*** SAIA PCD RESOURCE TABLE V1.7 *** MODULE: SMIRKS.PCD ( 8-24-87 2:26p) PRODUCED: 9-17-87 11:08a PAGE 10
HOORAY HENRY AND CO. LTD, LAUGHABLE LANE, GIGGLESVILLE, BRITISH EMPIRE
TYPE NUMBER ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
0000000000 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 7777777777 8888888888 9999999999
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
0000 .......... DDDDD.DDD. .DDDD.DDDD .......... .......... .......... D......... .......... .......... ..........
0100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0200 .......... DDDDD.DDD. .DDDD.DDDD .......... .......... .......... D......... .......... .......... ..........
0300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0400 .......... DDDDD.DDD. .DDDD.DDDD .......... .......... .......... D......... .......... .......... ..........
0500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0600 .......... DDDDD.DDD. .DDDD.DDDD .......... .......... .......... D......... .......... .......... ..........
0700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1000 DDD....... DDDDDDDDD. D......... .......... .......... .......... D......... .......... .......... ..........
1100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
1900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
2900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
3900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4000 .......... .......... .......... .......... .......... .......... .......... .......... .......... ......
*** SAIA PCD RESOURCE TABLE V1.7 *** MODULE: SMIRKS.PCD ( 8-24-87 2:26p) PRODUCED: 9-17-87 11:08a PAGE 16
HOORAY HENRY AND CO. LTD, LAUGHABLE LANE, GIGGLESVILLE, BRITISH EMPIRE
TYPE NUMBER LEN ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
0000000000 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 7777777777 8888888888 9999999999
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
0000 DD........ XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... .......... .......... ..........
0100 .......... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD......
0200 XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... ..........
0300 .......... .......... .......... .......... XDDD...... XDDD...... XDDD...... .......... .......... ..........
0400 .......... .......... .......... .......... XDDD...... XDDD...... XDDD...... .......... .......... ..........
0500 .......... .......... .......... .......... XDDD...... XDDD...... XDDD...... .......... .......... ..........
0600 .......... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... ..........
0700 .......... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... ..........
0800 .......... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... XDDD...... ..........
0900 .......... .......... .......... .......... .......... .......... .......... .......... .......... .........D
*** SAIA PCD RESOURCE TABLE V1.7 *** MODULE: SMIRKS.PCD ( 8-24-87 2:26p) PRODUCED: 9-17-87 11:08a PAGE 22
HOORAY HENRY AND CO. LTD, LAUGHABLE LANE, GIGGLESVILLE, BRITISH EMPIRE
TYPE NUMBER ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
TYPE NUMBER START END LENGTH ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
COB 0 32 36 5
COB 1 1534 1538 5
COB 2 2940 2944 5
COB 3 4346 4350 5
0000000000 111111
0123456789 012345
XOB 16 0 31 32
TYPE NUMBER START END LENGTH ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
0000000000 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 7777777777 8888888888 9999999999
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
0000 .DDDD..... .DDDD..... .DDDD..... .DDDD..... .......... .......... .......... .......... .......... ..........
0100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
*** SAIA PCD RESOURCE TABLE V1.7 *** MODULE: SMIRKS.PCD ( 8-24-87 2:26p) PRODUCED: 9-17-87 11:08a PAGE 27
HOORAY HENRY AND CO. LTD, LAUGHABLE LANE, GIGGLESVILLE, BRITISH EMPIRE
TYPE NUMBER START END LENGTH ADDR MNEMONIC ADDR MNEMONIC ADDR MNEMONIC
0000000000 1111111111 2222222222 3333333333 4444444444 5555555555 6666666666 7777777777 8888888888 9999999999
0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789
0000 DDD....... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0100 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0200 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0300 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0400 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0500 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0600 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0700 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0800 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
0900 .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
*** SAIA PCD RESOURCE TABLE V1.7 *** MODULE: SMIRKS.PCD ( 8-24-87 2:26p) PRODUCED: 9-17-87 11:08a PAGE 50
HOORAY HENRY AND CO. LTD, LAUGHABLE LANE, GIGGLESVILLE, BRITISH EMPIRE
DEFTB 26 1
DEFVM 27 1000
DEFTC 25 100
DEFWPH 86 1234
REVISION HISTORY
05-Jan-98 V2.1
21-Jun-96 V2.0
24-Apr-95 V1.9
18-Mar-95 $18B
1) Changed the command key for "coNnect" (N) to "cOnnect" (O)
to match SBUG's "cOnnect" command.
09-Jun-93 V1.7
1) New "Print to File" and "Print to Printer" commands. The
displayed code or structure can now be written to a file.
New section 5, "PRINT COMMAND".
2) Now has S-BUS and modem support.
- New "CoNnect" commands: "coNnect Cpu", "coNnect Sbus-
station".
- The title line now shows the connected S-BUS station if
connected to an S-BUS network.
3) "View structure" command changed to "sTructure".
4) Error messages re-numbered and several new errors added
(for S-BUS communications etc).
5) Supports the new TFR and CPBI instructions.
6) Add ERROR 50: PCD NOT CONNECTED TO COMx OR POWERED OFF
06-Dec-91 $154
1) Now has F1=Help.
2) Add errors 7 and 8.
3) "View structure" display now shows where nesting level errors
occurred with "=>".
03-Sep-91 $152
1) Add "cpU" command to select CPU 0 or 1 on a PCD4.
New section 6.4 and error messages 30, 31 and 32.
2) If PCD memory and .PCD file do not match, SVIEW is not
forced off line anymore, but ERROR 19 occurs when a block
is displayed (the block can still be displayed).
05-Nov-90 V1.4
1) Update PUT and GET instructions for X and DB types.
22-Nov-89 V1.3
1) More than one '.' allowed in a file name during entry (SWMR 7).
Add ERROR 9 to detect this.
2) SBs now displayed (SWMR 69).
Added "Sb" command to main menu.
"Structure" command changed to "View structure".
3) Now works in colour as defined in PCDCOLOR.DAT.
4) PG1 format instructions removed from code display.
5) Code display now shows Registers in decimal, hex and floating
point units on one screen, the "Units" command has been
removed.
6) Now correctly displays the refreshed value for operands
which do not have an MC.
7) Now doesn't interpret ST/TR parameter lists as Inputs and
Outputs (bug, V1.2 displayed a refreshed value for these!).
8) Now supports COM1, COM2, COM3 and COM4.
9) New help screens.
10) Code display now has a header line.
11) Better scrolling of refreshed elements if up/down arrow keys
used.
05-Dec-88 V1.2
1) Refreshed value of indexed element is now shown in brackets.
27-Jun-88 V1.1
1) Add Fatal Error 6 (6.1).
23-Mar-88 V1.0
Initial edit.
TABLE OF CONTENTS
=================
Page
1. INTRODUCTION . . . . . . . . . . . . . . . 1
1.1 Invocation from DOS . . . . . . . . . . 1
3. PROGRAM DISPLAY . . . . . . . . . . . . . 4
5. PRINT COMMAND . . . . . . . . . . . . . . 7
6. LIMITATIONS . . . . . . . . . . . . . . . 8
1. INTRODUCTION
================
* Displays a list of all COBs, XOBs, PBs, FBs and SBs used in
the program.
* Displays the code of any COB, XOB, PB, FB or SB along with the
refreshed values of any Inputs, Outputs, Flags, Registers,
Timers and Counters referenced by the instructions.
SVIEW filename[.ext]
The file name (including the drive and path) is optional, and should
be the name of a valid PCD absolute object file. If the file name is
not supplied, the file is invalid or it can't be found, the user is
prompted to enter a file name by SVIEW. The default file name
extension is ".PCD".
SVIEW can also be invoked from the PCD Programming Utilities main
menu with "View program".
To use SVIEW on line, the CPU must be connected when SVIEW is first
run, SVIEW only checks that a PCD is connected when it starts up.
If a PCD is not connected, SVIEW remains off line even if a PCD is
subsequently connected. To go on line, exit SVIEW and restart it.
SVIEW - Page 2
If a file name was not supplied on the command line, the user is first
prompted for the name of the file to be viewed. If the file was not
found, the entered file name is displayed and can be edited, or a new
file name can be entered.
When the cursor is in the filename entry field, pressing function key
F5 displays a window containing a list of all the ".PCD" files,
allowing a file name to be chosen. A mask may be entered into the
field before pressing F5, e.g. "*.UPL".
│ │
│ Program to view (.PCD or .UPL): __________________________________________ │
= =
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Enter name of file to view (F5=dir), press ENTER to execute, ESC to abort. │
└────────────────────────────────────────────────────────────────────────────────┘
If the file name has been entered and is a valid PCD absolute object
file, it is processed, and a list of all COBs, XOBs, PBs, FBs and SBs
is displayed. This forms the top level menu.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD PROGRAM VIEWER V2.1 Stn: 12 CPU: 0 Status: RUN Program: DEMO │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│╓─CYCLIC ORGANISATION BLOCKS (Cob)─────────────────────────────────────────────┐│
│║ 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 ││
│╚══════════════════════════════════════════════════════════════════════════════╛│
│╓─EXCEPTION ORGANISATION BLOCKS (Xob)──────────────────────────────────────────┐│
│║ 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 ││
│║ 019 020 021 022 023 024 025 026 027 028 029 030 031 ││
│╚══════════════════════════════════════════════════════════════════════════════╛│
│╓─PROGRAM BLOCKS (Pb)──────────────────────────────────────────────────────────┐│
│║ 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 ││
│║ 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 ││
│║ 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 ││
│║ 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 ││
│║ 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 ││
│║ 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 ││
│║ 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 ││
│║ 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 ││
│║ 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 ││
│║ 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 ││
│║ 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 ││
│║ 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 v│
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Cob Xob Pb Fb Sb sTructure cOnnect Quit │
│ F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
SVIEW - Page 3
The top line indicates the program name. If connected to a CPU, the
top line also indicates the CPU number, CPU status and S-BUS station
if connected to an S-BUS network. If not connected, the top line shows
the CPU status as "OFF LINE", and the CPU number is not present.
If the CPU is connected, a check is made that the program in the CPU
and the program to be viewed are the same. If they are not, an error
message is displayed.
If the block list is larger than one screen full, this is indicated
by a bright and blinking down arrow at the bottom right of the screen.
The PGDN, PGUP, UP ARROW, DOWN ARROW, HOME or END keys can be used to
view the complete block list.
Cob }
Xob } These commands selects a code block to be displayed
Pb } as source code, with refreshed operand values.
Fb }
Sb }
The first (capital) letter of the option is the command letter. Press
this letter to select the option.
If the entered block number is valid, and the block exists, the code
is disassembled, and the code of the selected is displayed, see
section 3.
3. PROGRAM DISPLAY
===================
This displays the disassembled source code of the selected code block.
If the code in memory does not match the code read from the .PCD file,
an error message is displayed, and the refreshed values will probably
be meaningless.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD PROGRAM VIEWER V2.1 Stn: 12 CPU: 0 Status: RUN Program: DEMO │
├────────────────────────────────────────────────────────────────────────────────┤
│ ADDS MNEMO MC OPERAND DECIMAL HEX FLOATING POINT │
├────────────────────────────────────────────────────────────────────────────────┤
│ 5119 PB 8 │
│ 5120 STH F 515 0 │
│ 5121 ORH F 516 1 │
│ 5122 ORH F 517 1 │
│ 5123 JR L 3 │
│ 5124 SET F 518 1 │
│ 5125 JR 59 │
│ 5126 RES F 518 1 │
│ 5127 SUB R 510 2000 000007D0H │
│ 5128 R 500 0 00000000H 0.000000E+00 │
│ 5129 R 511 67138320 04007310H │
│ 5130 MOV R 511 67138320 04007310H │
│ 5131 L 0 │
│ 5132 R 516 32768 00008000H │
│ 5133 L 0 │
│ 5134 IFP R 516 32768 00008000H │
│ 5135 0 │
│ 5136 FMUL R 516 32768 00008000H │
│ 5137 R 520 -527451838 E08FB942H 3.508772E+00 │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Print Quit │
│ Use PGUP, PGDN, ARROW, HOME or END to view. F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
If the code is larger than one screen full, the PGUP, PGDN, HOME,
END and ARROW keys can be used to scroll the display.
SVIEW - Page 5
For indexed operands, the refreshed value shown is the value of the
base element only, and is shown in brackets.
The code for the block can be printed by pressing 'P' for "Print",
see section 5. It is printed WITHOUT the refreshed element values.
These can be printed using the DOS "print screen" function, by
pressing Shift+PrtSc.
'H' for "Help" displays the Program Display help screen, 'Q' for
"Quit" (or ESCape) returns to the top level screen.
SVIEW - Page 6
This shows the calling sequence of PBs, FBs and SBs. Blocks which are
called conditionally are indicated by the ¤ character, which looks
like a switch.
┌────────────────────────────────────────────────────────────────────────────────┐
│ SAIA PCD PROGRAM VIEWER V2.1 Stn: 12 CPU: 0 Status: RUN Program: DEMO │
├────────────────────────────────────────────────────────────────────────────────┤
│ │
│ COB001─┬¤PB017─┬─FB200 │
│ │ └─PB018─┬─FB200 │
│ │ └─PB019─┬─FB200 │
│ │ └─PB020─┬─FB200 │
│ │ └─PB021─┬─FB200 │
│ │ └─PB022─┬─FB200 │
│ │ └─PB023=> │ <-- Nesting
│ └¤PB025─┬¤PB026─┬¤PB027─┬¤PB028─┬¤PB029─┬¤PB030─┬¤PB031 │ error
│ │ │ │ │ │ └¤PB041 │
│ │ │ │ │ └¤PB040─┬¤PB031 │
│ │ │ │ │ └¤PB041 │
│ │ │ │ └¤PB039─┬¤PB030─┬¤PB031 │
│ │ │ │ │ └¤PB041 │
│ │ │ │ └¤PB040─┬¤PB031 │
│ │ │ │ └¤PB041 │
│ │ │ └¤PB038─┬¤PB029─┬¤PB030─┬¤PB031 │
│ │ │ │ │ └¤PB041 │
│ │ │ │ └¤PB040─┬¤PB031 │
│ │ │ │ └¤PB041 │
│ │ │ └¤PB039─┬¤PB030─┬¤PB031 │
│ │
├────────────────────────────────────────────────────────────────────────────────┤
│ Print Quit │
│ Use PGUP, PGDN, ARROW, HOME or END to view. F1=Help │
└────────────────────────────────────────────────────────────────────────────────┘
The structure can be printed using the "Print" command, as for the
Program display, see section 5.
If the structure is larger than one screen full, the PGUP, PGDN,
HOME, END and ARROW keys can be used to scroll the display.
'H' for "Help" displays the Bloctec Structure Help screen, 'Q' for
"Quit" (or ESCape) returns to the top level screen.
SVIEW - Page 7
5. PRINT COMMAND
=================
"Print to Printer"
"Print to File"
6. LIMITATIONS
===============
General:
Program Display:
* If the code in the PCD does not match the code read from the
file, an error message is displayed, and the refreshed values
may be meaningless.
All error messages are displayed left justified on line 23, in bold
video. All are accompanied by a long "beep". Error messages are
cleared from the screen on the next key depression.
The input file is not a valid PCD absolute object file. SVIEW
must be exited, and invoked again with a valid file.
There is not enough memory remaining to run SVIEW. Try using the
/X switch when invoking the main PCD menus ("PCD /X"), so that
extended or expanded memory can be used. Or remove any memory
resident programs such as SHELP or RAM disks, and try again.
There are more than 32767 block call instructions (CPB, CFB etc)
in the program. SVIEW cannot handle so many. This should never
occur!
More than one file name was present on the command line.
SVIEW does not use any switches. The file name must be
re-entered.
The input file does not exist. Correct the file name.
The block whose number has just been entered does not exist
in the loaded program. Re-enter the number of a block that
does exist.
These errors are detected when processing the file. Each error lists
the user program line number "n" of the error and the block where it
occurred. These errors are recoverable, the program or bloctec
structure can be displayed, even if errors are detected, but it may
not be correct.
If more than one error occurs, the messages are scrolled up the screen.
Once all errors have been detected, a prompt "Press any key to
continue"
is displayed. The depression of any key clears the error messages and
displays the program or bloctec structure.
<block> is the block type and number. Eg. "FB 12", "PB 123".
<statement> is a block call or end of block instruction. Eg. "CFB 0",
"ECOB".
The end of block instruction does not match the block opening
instruction. For example: FB 0 .. ECOB.
The program line number is not given with the next two errors because
it is not used by the recursive algorithm which generates the bloctec
structure, and is not available.
A block has been called which does not exit in the program.