1. SDS 940 simulator usage¶
- Date:
2014-04-20
- Revision:
$Format:%H$
- Copyright:
See LICENSE.txt for terms of use.
This memorandum documents the SDS 940 simulator.
1.1. Simulator files¶
sim/
scp.h
sim_console.h
sim_defs.h
sim_fio.h
sim_rev.h
sim_sock.h
sim_tape.h
sim_timer.h
sim_tmxr.h
scp.c
sim_console.c
sim_fio.c
sim_sock.c
sim_tape.c
sim_timer.c
sim_tmxr.c
sim/sds/
sds_defs.h
sds_cpu.c
sds_drm.c
sds_dsk.c
sds_io.c
sds_lp.c
sds_mt.c
sds_mux.c
sds_rad.c
sds_stddev.c
sds_sys.c
1.2. SDS 940 features¶
The SDS-940 simulator is configured as follows:
Device name(s) |
Simulates |
---|---|
SDS-940 CPU with 16KW to 64KW of memory |
|
I/O channels |
|
Paper tape reader |
|
Paper tape punch |
|
Console input |
|
Console output |
|
Line printer |
|
Real-time clock |
|
Terminal multiplexor |
|
Project Genie drum |
|
Fixed head disk |
|
9164/9165 rapid access (moving head) disk |
|
Magnetic tape |
Most devices can be disabled or enabled with the SET <dev> DISABLED
and SET <dev> ENABLED
commands,
respectively.
The LOAD
command is used to load a line printer carriage-control tape.
The DUMP
command is not implemented.
1.2.1. CPU
¶
The CPU options set the size of main memory and the configuration of peripherals.
SET CPU 16K Set memory size = 16KW
SET CPU 32K Set memory size = 32KW
SET CPU 48K Set memory size = 48KW
SET CPU 64K Set memory size = 64KW
SET CPU GENIE Enable DRM, set terminal mux to GENIE mode
SET CPU SDS Disable DRM, set terminal mux to SDS mode
If memory size is being reduced, and the memory being truncated contains non-zero data, the simulator asks for confirmation. Data in the truncated portion of memory is lost. Initial memory size is 64KW.
CPU registers include the visible state of the processor as well as the control registers for the interrupt system.
Name |
Size |
Comments |
---|---|---|
|
14 |
Program counter |
|
24 |
Accumulator A |
|
24 |
Accumulator B |
|
24 |
Index register |
|
1 |
Overflow indicator |
|
3 |
Memory extension, quadrant 2 |
|
3 |
Memory extension, quadrant 3 |
|
24 |
User relocation register 1 |
|
24 |
User relocation register 2 |
|
12 |
Kernel relocation register |
|
1 |
Normal mode flag |
|
1 |
User mode flag |
|
1 |
Monitor-to-user trap enable |
|
1 |
Interrupt enable |
|
1 |
Interrupt defer |
|
32 |
Interrupt request flags |
|
5 |
Highest active API level |
|
5 |
Highest requesting API level |
|
32 |
Device transfer request flags |
|
4 |
Breakpoint switches |
|
6 |
Outstanding alert number |
|
1 |
Stop on invalid instruction |
|
1 |
Stop on invalid device number |
|
1 |
Stop on invalid I/O operation |
|
8 |
Maximum indirect nesting depth |
|
8 |
Maximum execute nesting depth |
|
14 |
P prior to last branch or interrupt; most recent P change first |
|
8 |
Interrupt character |
The CPU can maintain a history of the most recently executed instructions.
This is controlled by the SET CPU HISTORY
and SHOW CPU HISTORY
commands:
SET CPU HISTORY Clear history buffer
SET CPU HISTORY=0 Disable history
SET CPU HISTORY=n Enable history, length = n
SHOW CPU HISTORY Print CPU history
SHOW CPU HISTORY=n Print first n entries of CPU history
The maximum length for the history is 65536 entries,
the minimum length is 64 entries.
This history records the CPU mode when the instruction was executed (normal, monitor or user).
The SET CPU HISTORY
command accepts one switch value to optionally suppress recording of instructions in a particular CPU mode:
SET -n CPU HISTORY=n Don't record if in normal mode
SET -m CPU HISTORY=n Don't record if in monitor mode
SET -u CPU HISTORY=n Don't record if in user mode
The SDS 940 simulator implements four types of execution breakpoints, controlled by command-line switches:
|
Break if |
|
Break if |
|
Break if |
|
Break if |
Breakpoint commands default to -e
behavior if no switch is specified.
1.2.1.1. Next command¶
The Next command is supported to step over a BRM
, POP
, or SYSPOP
instruction by installing temporary breakpoints at P
+1 and P
+2
(and P
+3 in the case of a BRM
)
and then executing the Go command.
The temporary breakpoints are removed should execution be interrupted for any other reason.
For other instructions,
Next is converted to a Step command.
Like the Step command, the Next command accepts a repeat count as an argument. Given this code sequence:
1532: BRM 1220 <-- P
1533: LDA 4663
1534: POP 3214
1535: BRU 4436 <-- non-skip return from POP
1536: BRM 3260 <-- skip return from POP
1537: ZRO 3455 <-- argument to subroutine
1540: BRU 1600 <-- error return
1541: STA 4652 <-- normal return
The following behavior would be observed for various Next commands executed when P
=1532:
Step |
Advance to location 1220 |
Next |
Advance to location 1533 |
Next 2 |
Advance to location 1534 |
Next 3 |
Advance to location 1535 or 1536,
depending on whether |
With P
=1536,
the behavior is thus:
Step |
Advance to location 3260 |
Next |
Advance to location 1540 or 1541 |
Unlike the Step command, a side-effect of using temporary breakpoints is that diversions into interrupt or trap code become invisible. With a Step command, execution dutifully follows into the interrupt or trap routine.
Next command accepts two mutually exclusive switches to modify its behavior.
The -f
switch (“forward”) instructs the Next command to set temporary breakpoint(s) following the current location,
regardless of instruction type.
This is useful at the bottom of loops or to avoid going off into unrelated code should an interrupt or memory paging trap occur.
In this example:
1532 BRX 1220 <-- P
1533 LDA 4663
a normal Next would advance to either location 1220 or 1533 depending upon the value in the X
register
(it is converted to a Step).
However, Next -f
would only advance to location 1533,
allowing the loop code at 1220 to be executed as many times as specified by X
.
Note that if the loop code branches elsewhere,
rather than make the BRX
test,
control will be lost unless caught by another breakpoint.
The -a
switch (“atomic”) alters Next behavior to be more like a Step command,
but using temporary breakpoints.
That is,
it will plant a breakpoint at the effective address of a BRM
or BRX
instruction to catch any transfer there.
Its primary use is to step through code ignoring interrupts and traps.
The behavior of various alternative forms of Next are illustrated in this table for different opcodes,
showing where temporary breakpoints are placed.
“Step” means Next is converted to a Step command.
“LDA, etc.” means all non-skipping,
non-branching opcodes,
including I/O instructions.
“SKx” means all Skip instructions.
The behavior of Next with an EXU
(execute) instruction is dependent on the instruction that is eventually executed.
Opcode |
Next |
Next |
Next |
---|---|---|---|
Bad op |
Step |
Step |
Step |
|
Step |
|
Step |
|
|
|
|
|
Step |
|
Step |
|
Step |
|
Step |
|
Step |
|
|
|
? |
? |
? |
|
Step |
Step |
Step |
|
Step |
|
|
|
Step |
|
|
|
|
100+ |
|
|
|
100+ |
|
Note that these temporary breakpoints are CPU-mode insensitive, so there is the potential for conflict if execution in a different CPU mode should encounter an instruction address numerically equal to any of these temporary breakpoints.
1.2.2. Channels (CHAN
)¶
The SDS 940 has up to eight I/O channels,
designated W, Y, C, D, E, F, G, and H.
W, Y, C, and D are time-multiplexed communications channels (TMCC
);
E, F, G, and H are direct access communications channels (DACC
).
Unlike real SDS 940 channels,
the simulated channels handle 6b, 12b, and 24b transfers simultaneously.
The association between a device and a channel is displayed by the SHOW <dev> CHAN
command:
SHOW LPT CHAN
channel=W
The user can change the association with the SET <dev> CHAN=<chan>
command,
where <chan>
is a channel letter:
SET LPT CHAN=E
SHOW LPT CHAN
channel=E
Each channel has nine registers. The registers are arrays, with entry [0] for channel W, entry [1] for channel Y, etc.
Name |
Size |
Comments |
---|---|---|
|
6 |
Unit address register |
|
15 |
Word count register |
|
16 |
Memory address register |
|
6 |
Data chaining register |
|
24 |
Word assembly register |
|
2 |
Characters per word |
|
3 |
Character count |
|
12 |
Channel mode (from |
|
9 |
Channel flags |
The user can display all the registers in a channel with the command:
SHOW CHAN channel-letter
1.2.3. Console input (TTI
)¶
The console input (TTI
) polls the console keyboard for input.
It implements these registers:
Name |
Size |
Comments |
---|---|---|
|
6 |
Data buffer |
|
1 |
Transfer ready flag |
|
32 |
Number of characters input |
|
24 |
Polling interval |
By default, the console input is assigned to channel W.
1.2.4. Console output (TTO
)¶
The console output (TTO
) writes to the simulator console window.
It implements these registers:
Name |
Size |
Comments |
---|---|---|
|
6 |
Data buffer |
|
1 |
Transfer ready flag |
|
32 |
Number of characters output |
|
24 |
Time from I/O initiation to interrupt |
By default, the console output is assigned to channel W.
1.2.5. Paper tape reader (PTR
)¶
The paper tape reader (PTR
) reads data from a disk file.
The POS
register specifies the number of the next data item to be read.
Thus, by changing POS
,
the user can backspace or advance the reader.
The paper tape reader implements these registers:
Name |
Size |
Comments |
---|---|---|
|
6 |
Data buffer |
|
1 |
Transfer ready flag |
|
1 |
Start of record flag |
|
4 |
Active channel |
|
32 |
Position in the input file |
|
24 |
Time from I/O initiation to interrupt |
|
1 |
Stop on I/O error |
The paper-tape reader supports the BOOT
command.
BOOT PTR
simulates the standard console fill sequence.
Error handling is as follows:
Error |
|
Processed as |
---|---|---|
Not attached |
1 |
Report error and stop |
0 |
Out of tape |
|
End of file |
1 |
Report error and stop |
0 |
Out of tape |
|
OS I/O error |
x |
Report error and stop |
By default, the paper tape reader is assigned to channel W.
1.2.6. Paper tape punch (PTP
)¶
The paper tape punch (PTP
) writes data to a disk file.
The POS
register specifies the number of the next data item to be written.
Thus, by changing POS
,
the user can backspace or advance the punch.
The paper tape punch implements these registers:
Name |
Size |
Comments |
---|---|---|
|
6 |
Data buffer |
|
1 |
Transfer ready flag |
|
1 |
Punch leader flag |
|
4 |
Active channel |
|
32 |
Position in the output file |
|
24 |
Time from I/O initiation to interrupt |
|
1 |
Stop on I/O error |
Error handling is as follows:
Error |
|
Processed as |
---|---|---|
Not attached |
1 |
Report error and stop |
0 |
Out of tape |
|
OS I/O error |
x |
Report error and stop |
By default, the paper tape punch is assigned to channel W.
1.2.7. Line printer (LPT
)¶
The line printer (LPT
) writes data to a disk file.
The POS
register specifies the number of the next data item to be written.
Thus, by changing POS
,
the user can backspace or advance the printer.
The line printer implements these registers:
Name |
Size |
Comments |
---|---|---|
|
8 |
Data buffer |
|
8 |
Buffer pointer |
|
1 |
Transfer ready flag |
|
1 |
Error flag |
|
4 |
Active channel |
|
8 |
Carriage control tape |
|
8 |
Pointer into carriage control tape |
|
8 |
Length of carriage control tape |
|
24 |
Spacing instruction |
|
32 |
Position in the output file |
|
24 |
Inter-character time |
|
24 |
Print time |
|
24 |
Space time |
|
1 |
Stop on I/O error |
Error handling is as follows:
Error |
|
Processed as |
---|---|---|
Not attached |
1 |
Report error and stop |
0 |
Out of paper |
|
OS I/O error |
x |
Report error and stop |
By default, the line printer is assigned to channel W.
1.2.8. Real-time clock (RTC
)¶
The real-time clock (RTC
) frequency can be adjusted as follows:
SET RTC 60HZ Set frequency to 60Hz
SET RTC 50HZ Set frequency to 50Hz
The default is 60Hz.
The clock implements these registers:
Name |
Size |
Comments |
---|---|---|
|
1 |
Interrupt enable |
|
24 |
Tick interval |
The real-time clock autocalibrates; the clock interval is adjusted up or down so that the clock tracks actual elapsed time.
1.2.9. Terminal multiplexer (MUX
)¶
The terminal multiplexer provides 32 asynchronous interfaces.
In Genie mode,
the interfaces are hard-wired;
in SDS mode,
they implement modem control.
The multiplexer has two controllers:
MUX
for the scanner,
and MUXL
for the individual lines.
The terminal multiplexer performs input and output through Telnet sessions connected to a user-specified port.
The ATTACH
command specifies the port to be used:
ATTACH MUX <port> Set up listening port
where port
is a decimal number between 1 and 65535 that is not being used for other TCP/IP activities.
Each line (each unit of MUXL
) supports one option:
UC
,
when set,
causes lowercase input characters to be automatically converted to uppercase.
In addition,
each line supports output logging.
The SET MUXLn LOG
command enables logging on a line:
SET MUXLn filename Log output of line n to filename
The SET MUXLn NOLOG
command disables logging and closes the open log file, if any.
Once MUX
is attached and the simulator is running,
the multiplexor listens for connections on the specified port.
It assumes that the incoming connections are Telnet connections.
The connections remain open until disconnected,
either by the Telnet client,
a SET MUX DISCONNECT
command,
or a DETACH MUX
command.
Other special multiplexer commands:
SHOW MUX CONNECTIONS Show current connections
SHOW MUX STATISTICS Show statistics for active connections
SET MUXLn DISCONNECT Disconnect the specified line
The controller (MUX
) implements these registers:
Name |
Size |
Comments |
---|---|---|
|
6 |
Status, lines 0 to 31 |
|
8 |
Receive buffer, lines 0 to 31 |
|
8 |
Transmit buffer, lines 0 to 31 |
|
1 |
Line flags, 0 to 3 for line 0, 4 to 7 for line 1, etc |
|
7 |
Scanner current flag number |
|
1 |
Scanner locked flag |
|
8 |
Character polls per second |
The lines (MUXL
) implements these registers:
Name |
Size |
Comments |
---|---|---|
|
24 |
Transmit time, lines 0 to 31 |
The terminal multiplexor does not support save and restore.
All open connections are lost when the simulator shuts down or MUX
is detached.
1.2.10. Project Genie drum (DRM
)¶
The Project Genie drum (DRM
) implements these registers:
Name |
Size |
Comments |
---|---|---|
|
19 |
Drum address |
|
16 |
Core address |
|
14 |
Word count |
|
12 |
Cumulative sector parity |
|
1 |
Read/write flag |
|
1 |
Error flag |
|
2 |
Drum state |
|
24 |
Channel program fetch time |
|
24 |
Interword transfer time |
|
1 |
Stop on I/O error |
Error handling is as follows:
Error |
|
Processed as |
---|---|---|
Not attached |
1 |
Report error and stop |
0 |
Drum not ready |
Drum data files are buffered in memory; therefore, end-of-file and OS I/O errors cannot occur. Unlike conventional SDS 940 devices, the Project Genie drum does not use a channel.
1.2.11. Rapid access (fixed-head) disk (RAD
)¶
The rapid access disk (RAD
) implements these registers:
Name |
Size |
Comments |
---|---|---|
|
15 |
Disk address |
|
6 |
Sector word address |
|
1 |
Sector byte pointer |
|
1 |
Data transfer flag |
|
1 |
Inhibit increment across track |
|
1 |
Error flag |
|
4 |
Active channel |
|
8 |
Write protect switches |
|
24 |
Interval between half-word transfers |
|
1 |
Stop on I/O error |
Error handling is as follows:
Error |
|
Processed as |
---|---|---|
Not attached |
1 |
Report error and stop |
0 |
Disk not ready |
The rapid access disk is buffered in memory; end-of-file and OS I/O errors cannot occur. If it is assigned to channel W, bootstrap fill from the device is permitted. By default, the rapid access disk is assigned to channel E and bootstrapping is not permitted.
1.2.12. Moving head disk (DSK
)¶
DSK
options include the ability to make the drive write-enabled or write-locked:
SET RAD LOCKED Set write-locked
SET RAD WRITEENABLED Set write-enabled
The moving head disk implements these registers:
Name |
Size |
Comments |
---|---|---|
|
8 |
Transfer buffer |
|
9 |
Buffer pointer |
|
9 |
Buffer length |
|
21 |
Disk address |
|
24 |
Disk instruction |
|
1 |
Data transfer flag |
|
1 |
Error flag |
|
4 |
Active channel |
|
24 |
Interval between character transfers |
|
24 |
Seek interval |
|
1 |
Stop on I/O error |
Error handling is as follows:
Error |
|
Processed as |
---|---|---|
Not attached |
1 |
Report error and stop |
0 |
Disk not ready |
|
End of file |
x |
Assume rest of disk is zero |
OS I/O error |
x |
Report error and stop |
By default, the moving head disk is assigned to channel F.
1.2.13. Magnetic tape (MT
)¶
MT
options include the ability to make units write-enabled or write-locked.
SET MTn LOCKED Set unit n write-locked
SET MTn WRITEENABLED Set unit n write-enabled
Magnetic tape units can be set to a specific reel capacity in MB, or to unlimited capacity:
SET MTn CAPAC=m Set unit n capacity to m MB (0 = unlimited)
SHOW MTn CAPAC Show unit n capacity in MB
Units can also be set ENABLED
or DISABLED
.
The magnetic tape controller supports the BOOT
command.
BOOT MTn
simulates the standard console fill sequence for unit n.
The magnetic tape implements these registers:
Name |
Size |
Comments |
---|---|---|
|
8 |
Transfer buffer |
|
18 |
Buffer pointer |
|
18 |
Buffer length |
|
1 |
Data transfer flag |
|
4 |
Active channel |
|
24 |
Magtape instruction |
|
1 |
End-of-file flag |
|
1 |
Inter-record gap flag |
|
1 |
Skip data flag |
|
24 |
Interval between character transfers |
|
24 |
Gap interval |
|
32 |
Position, drives 0 to 7 |
|
1 |
Stop on I/O error |
Error handling is as follows:
Error |
Processed as |
---|---|
Not attached |
Tape not ready; if |
End of file |
End of tape |
OS I/O error |
End of tape; if |
By default, the magnetic tape is assigned to channel W.
1.3. Symbolic display and input¶
The SDS 940 simulator implements symbolic display and input. Display is controlled by command-line switches:
|
Display as three SDS internal ASCII characters |
|
Display as four packed SDS 6b characters |
|
Display instruction mnemonics |
Input parsing is controlled by the first character typed in or by command-line switches:
|
Three packed SDS internal ASCII characters |
|
Four packed SDS 6b characters |
Alphabetic |
Instruction mnemonic |
Numeric |
Octal number |
Instruction input uses (more or less) standard SDS 940 assembler syntax. There are ten instruction classes:
Class |
Operands |
Examples |
Comments |
---|---|---|---|
No operand |
None |
|
|
|
|
|
|
I/O |
|
|
|
Mem reference |
|
LDA 400,2 STA* 300 |
Indirect addr |
Reg change |
|
|
Opcodes OR |
Shift |
|
|
|
Operand ignored |
Any |
|
|
Chan command |
|
|
|
Chan test |
|
|
|
|
|
BRS 42 SBRM 500 CIN* 400,2 |
All numbers are octal. Channel designators can be alphabetic (W, Y, C, D, E, F, G, H) or numeric (0-7). Tags must be 0-7, with 2 indicating indexing.
In addition, all display and input commands may specify how the address is mapped to main memory via a command-line switch:
|
Normal, address is an absolute physical address |
|
Monitor, map address through the monitor memory map |
|
User, map address through the user memory map |
|
Current, map address through the monitor or user map depending upon current machine mode |
Memory mapping defaults to -n
behavior if no switch is specified.