Code copied from 2.0.2 DMG Sources folder

This commit is contained in:
Derek Knight (mac) 2018-05-26 15:52:10 +12:00
parent 3c08889b94
commit 43ec68068e
340 changed files with 64392 additions and 0 deletions

83
ASR33/ASR33.h Normal file
View File

@ -0,0 +1,83 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33.h - ASR 33 Teletype for the PDP-8/E Simulator
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define KBB_CHANGED_NOTIFICATION @"asr33KeyboardBufferChangedNotification"
#define TTO_CHANGED_NOTIFICATION @"asr33TeletypeOutputChangedNotification"
#define TTY_ONLINE_CHANGED_NOTIFICATION @"asr33TTYOnlineChangedNotification"
@class NSCondition, PaperTapeController, ASR33TextView, ASR33WindowController, TypeaheadBuffer;
@interface ASR33 : PDP8Plugin <NSCoding, InputConsumer>
{
@public
/* The attributes are public, so the C functions implementing the PDP-8 instructions can
access them directly. No other Cocoa code should use them directly. To ensure this,
the register names are mapped to dummy names with the #defines below. In the source
codes files with the instruction C functions, #define USE_ASR33_REGISTERS_DIRECTLY
to make the registers available. */
unsigned short KBB;
unsigned long inflag;
unsigned long outflag;
unsigned short output;
@private
unsigned short TTO; // private: not accessed by IOTs
short int input; // int: can be EOF == -1
unsigned short inAddress;
unsigned short outAddress;
unsigned short punchMask;
IBOutlet PaperTapeController *reader;
IBOutlet PaperTapeController *punch;
IBOutlet ASR33TextView *textview;
IBOutlet ASR33WindowController *windowController;
IBOutlet TypeaheadBuffer *typeaheadBuffer;
BOOL online;
NSConditionLock *inputLock;
NSConditionLock *outputLock;
NSCondition *outputOnline;
BOOL runWithRealtimeSpeed;
BOOL playSound;
float soundVolume;
BOOL isConsoleTTY;
}
- (unsigned short) getKBB;
- (void) setKBB:(unsigned short)kbb;
- (unsigned short) getTTO;
- (void) setTTO:(unsigned short)tto;
- (BOOL) getOnline;
- (void) setOnline:(BOOL)onlineOffline;
- (void) canContinueOutput;
@end
#if ! USE_ASR33_REGISTERS_DIRECTLY
#define KBB __dont_use_KBB__
#define inflag __dont_use_inflag__
#define outflag __dont_use_outflag__
#define input __dont_use_input__
#define output __dont_use_output__
#endif

484
ASR33/ASR33.m Normal file
View File

@ -0,0 +1,484 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33.m - ASR 33 Teletype for the PDP-8/E Simulator
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "PluginFramework/PluginAPI.h"
#import "PluginFramework/PDP8.h"
#import "PluginFramework/Utilities.h"
#import "PluginFramework/FileDropControlTargetProtocol.h"
#import "PluginFramework/PaperTapeController.h"
#import "PluginFramework/InputConsumerProtocol.h"
#import "PluginFramework/NSThread+MainThread.h"
#define USE_ASR33_REGISTERS_DIRECTLY 1
#import "ASR33.h"
#import "ASR33TextView.h"
#import "ASR33WindowController.h"
#import "ASR33iot.h"
#import "ASR33Preferences.h"
#import "TypeaheadBuffer.h"
#define ASR33_CONTTY_PLUGIN_NAME NSLocalizedStringFromTableInBundle( \
@"ASR 33 Console Teletype.pdp8Plugin", nil, [self bundle], @"")
#define ASR33_AUXTTY_IO_INFO_FILENAME @"auxtty-io-info"
#define CODER_KEY_KBB @"kbb"
#define CODER_KEY_TTO @"tto"
#define CODER_KEY_INFLAG @"inflag"
#define CODER_KEY_INMASK @"inmask"
#define CODER_KEY_OUTFLAG @"outflag"
#define CODER_KEY_OUTMASK @"outmask"
#define CODER_KEY_ONLINE @"online"
#define NO_OUTPUT 0
#define OUTPUT 1
#define NO_INPUT 0
#define INPUT 1
#define TELETYPE_DELAY 100000 // 100.000 microseconds = 0.1 second
#define SOUND_BACKSPACE @"tty-backspace"
#define SOUND_BELL @"tty-bell"
#define SOUND_CARRIAGE_RETURN @"tty-carriage-return"
#define SOUND_KEYSTROKE1 @"tty-keystroke1"
#define SOUND_KEYSTROKE2 @"tty-keystroke2"
#define SOUND_KEYSTROKE3 @"tty-keystroke3"
#define SOUND_KEYSTROKE4 @"tty-keystroke4"
#define SOUND_SPACE @"tty-space"
#define SOUND_TYPE @"mp3"
@interface NSSound (SetVolume)
- (void) setVolume:(float)volume; // this is a Leopard method, not available with Tiger
@end
@implementation ASR33
API_VERSION
#pragma mark Plugin Methods
- (NSString *) ioInformationPlistName
{
isConsoleTTY = [[self pluginName] isEqualToString:ASR33_CONTTY_PLUGIN_NAME];
return isConsoleTTY ? [super ioInformationPlistName] : ASR33_AUXTTY_IO_INFO_FILENAME;
}
- (NSArray *) iotsForAddress:(int)ioAddress
{
if (inAddress == 0) {
inAddress = ioAddress;
return [NSArray arrayWithObjects:
[NSValue valueWithPointer:i6030],
[NSValue valueWithPointer:i6031],
[NSValue valueWithPointer:i6032],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:i6034],
[NSValue valueWithPointer:i6035],
[NSValue valueWithPointer:i6036],
[NSValue valueWithPointer:nil],
nil];
} else {
outAddress = ioAddress;
return [NSArray arrayWithObjects:
[NSValue valueWithPointer:i6040],
[NSValue valueWithPointer:i6041],
[NSValue valueWithPointer:i6042],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:i6044],
[NSValue valueWithPointer:i6045],
[NSValue valueWithPointer:i6046],
[NSValue valueWithPointer:nil],
nil];
}
}
- (NSArray *) skiptestsForAddress:(int)ioAddress
{
return ioAddress == inAddress ?
[NSArray arrayWithObjects:
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:s6031],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
nil] :
[NSArray arrayWithObjects:
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:s6041],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:s6045],
[NSValue valueWithPointer:nil],
[NSValue valueWithPointer:nil],
nil];
}
- (void) setIOFlag:(unsigned long)flag forIOFlagName:(NSString *)name;
{
if (inflag)
outflag = flag;
else
inflag = flag;
}
- (void) CAF:(int)ioAddress
{
if (ioAddress == inAddress) { // CAF is called twice, ignore second call
KBB = 0;
TTO = 0;
[pdp8 setInterruptMaskBits:inflag | outflag];
[pdp8 clearIOFlagBits:inflag | outflag];
}
}
- (void) clearAllFlags:(int)ioAddress
{
/* Don't modify the online state - software can't turn the TTY power knob.
Don't modify the on/off state of the reader/punch (else the user cannot
load BIN tapes as described in the Small Computer Systems Handbook,
where he must operate CLEAR/CONT *after* turning on the reader). */
if (ioAddress == inAddress) { // CAF is called twice, ignore second call
[self setKBB:0];
[self setTTO:0];
[pdp8 setInterruptMaskBits:inflag | outflag];
[pdp8 clearIOFlagBits:inflag | outflag];
}
}
- (void) resetDevice
{
[typeaheadBuffer flush:self];
[self setKBB:0];
[self setTTO:0];
[pdp8 setInterruptMaskBits:inflag | outflag];
[pdp8 clearIOFlagBits:inflag | outflag];
[self setOnline:YES];
}
#pragma mark Thread Handling
- (void) playSound:(unsigned short)key
{
NSString *soundname;
NSAssertRunningOnMainThread ();
key &= 0177;
if (playSound || key == '\a') {
if (isblank(key))
soundname = SOUND_SPACE;
else if (key == '\b')
soundname = SOUND_BACKSPACE;
else if (key == '\a')
soundname = SOUND_BELL;
else if (key == '\r')
soundname = SOUND_CARRIAGE_RETURN;
else if (isupper(key))
soundname = SOUND_KEYSTROKE1;
else if (islower(key))
soundname = SOUND_KEYSTROKE2;
else if (isdigit(key))
soundname = SOUND_KEYSTROKE3;
else
soundname = SOUND_KEYSTROKE4;
NSSound *sound = [[NSSound alloc] initWithContentsOfFile:
[[self bundle] pathForResource:soundname ofType:SOUND_TYPE] byReference:YES];
[sound autorelease];
if ([sound respondsToSelector:@selector(setVolume:)])
[sound setVolume:soundVolume];
[sound play];
}
}
- (void) canContinueInput
{
if ([inputLock tryLockWhenCondition:NO_INPUT])
[inputLock unlockWithCondition:INPUT];
/* else
User typed so fast that input would be lost, but the typeahead buffer keeps this input. */
}
- (void) canContinueOutput
{
if ([outputLock tryLockWhenCondition:NO_OUTPUT])
[outputLock unlockWithCondition:OUTPUT];
#if ! defined(NS_BLOCK_ASSERTIONS)
else
NSLog (@"PDP-8 software bug: TPC or TLS executed before preceding TTY output finished");
#endif
}
- (void) setTeletypeOutputFlag
{
NSAssertRunningOnMainThread ();
[pdp8 setIOFlagBits:outflag];
}
- (void) processInput
{
NSAssertRunningOnMainThread ();
input &= 0377; // strip off Unicode characters etc.
if (online) {
[self setKBB:input];
[pdp8 setIOFlagBits:inflag];
} else {
[self playSound:input];
[punch putChar:input & punchMask handleBackspace:YES];
[textview putChar:input & 0177];
}
}
- (void) processOutput
{
NSAssertRunningOnMainThread ();
[self playSound:output];
[self setTTO:output];
[punch putChar:output & punchMask handleBackspace:NO];
[textview putChar:output & 0177];
}
- (void) getReaderChar
{
NSAssertRunningOnMainThread ();
input = [reader getChar];
}
- (uint64_t) realtimeDelay:(uint64_t)maTime
{
if (runWithRealtimeSpeed) {
uint64_t us = absolute2nanoseconds(mach_absolute_time() - maTime) / 1000;
if (us < TELETYPE_DELAY)
usleep (TELETYPE_DELAY - us);
maTime = mach_absolute_time();
}
return maTime;
}
- (void) asr33InputThread:(id)object
{
[[NSAutoreleasePool alloc] init];
for (;;) {
[inputLock lockWhenCondition:INPUT];
uint64_t maTime = mach_absolute_time();
while ((! online || [pdp8 getIOFlagBits:inflag] == 0) &&
([self performSelectorOnMainThread:@selector(getReaderChar)
withObject:nil waitUntilDone:YES], input != EOF)) {
maTime = [self realtimeDelay:maTime];
[self performSelectorOnMainThread:@selector(processInput)
withObject:nil waitUntilDone:YES];
}
while ([typeaheadBuffer hasCharacters] &&
(! online || [pdp8 isStopped] || [pdp8 getIOFlagBits:inflag] == 0)) {
input = [typeaheadBuffer getNextChar] | 0200;
maTime = [self realtimeDelay:maTime];
[self performSelectorOnMainThread:@selector(processInput)
withObject:nil waitUntilDone:YES];
}
[inputLock unlockWithCondition:NO_INPUT];
}
}
- (void) asr33OutputThread:(id)object
{
[[NSAutoreleasePool alloc] init];
[outputOnline lock];
for (;;) {
if (! online)
[outputOnline wait];
[outputLock lockWhenCondition:OUTPUT];
uint64_t maTime = mach_absolute_time();
[self performSelectorOnMainThread:@selector(processOutput)
withObject:nil waitUntilDone:YES];
[self realtimeDelay:maTime];
[outputLock unlockWithCondition:NO_OUTPUT];
[self performSelectorOnMainThread:@selector(setTeletypeOutputFlag)
withObject:nil waitUntilDone:YES];
}
}
#pragma mark Register Access
- (unsigned short) getKBB
{
return KBB;
}
- (void) setKBB:(unsigned short)kbb
{
NSAssert1 ((kbb & ~0377) == 0, @"Bad KBB: 0%o", kbb);
KBB = kbb;
[[NSNotificationCenter defaultCenter] postNotificationName:KBB_CHANGED_NOTIFICATION object:self];
}
- (unsigned short) getTTO
{
return TTO;
}
- (void) setTTO:(unsigned short)tto
{
NSAssert1 ((tto & ~0377) == 0, @"Bad TTO: 0%o", tto);
TTO = tto;
[[NSNotificationCenter defaultCenter] postNotificationName:TTO_CHANGED_NOTIFICATION object:self];
}
- (BOOL) getOnline
{
return online;
}
- (void) setOnline:(BOOL)onlineOffline
{
online = onlineOffline;
[outputOnline signal];
if (! online)
[self canContinueInput];
[[NSNotificationCenter defaultCenter]
postNotificationName:TTY_ONLINE_CHANGED_NOTIFICATION object:self];
}
#pragma mark Initialization
- (id) initWithCoder:(NSCoder *)coder
{
self = [super init];
[self setKBB:[coder decodeIntForKey:CODER_KEY_KBB]];
[self setTTO:[coder decodeIntForKey:CODER_KEY_TTO]];
[coder decodeBoolForKey:CODER_KEY_INFLAG] ?
[pdp8 setIOFlagBits:inflag] : [pdp8 clearIOFlagBits:inflag];
[coder decodeBoolForKey:CODER_KEY_INMASK] ?
[pdp8 setInterruptMaskBits:inflag] : [pdp8 clearInterruptMaskBits:inflag];
[coder decodeBoolForKey:CODER_KEY_OUTFLAG] ?
[pdp8 setIOFlagBits:outflag] : [pdp8 clearIOFlagBits:outflag];
[coder decodeBoolForKey:CODER_KEY_OUTMASK] ?
[pdp8 setInterruptMaskBits:outflag] : [pdp8 clearInterruptMaskBits:outflag];
[self setOnline:[coder decodeBoolForKey:CODER_KEY_ONLINE]];
return self;
}
- (void) encodeWithCoder:(NSCoder *)coder
{
[coder encodeInt:[self getKBB] forKey:CODER_KEY_KBB];
[coder encodeInt:[self getTTO] forKey:CODER_KEY_TTO];
[coder encodeBool:[pdp8 getIOFlagBits:inflag] ? YES : NO forKey:CODER_KEY_INFLAG];
[coder encodeBool:[pdp8 getInterruptMaskBits:inflag] ? YES : NO forKey:CODER_KEY_INMASK];
[coder encodeBool:[pdp8 getIOFlagBits:outflag] ? YES : NO forKey:CODER_KEY_OUTFLAG];
[coder encodeBool:[pdp8 getInterruptMaskBits:outflag] ? YES : NO forKey:CODER_KEY_OUTMASK];
[coder encodeBool:[self getOnline] forKey:CODER_KEY_ONLINE];
}
- (void) notifyApplicationWillTerminate:(NSNotification *)notification
{
// NSLog (@"ASR33 notifyApplicationWillTerminate");
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSUserDefaultsDidChangeNotification
object:nil];
NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[self encodeWithCoder:archiver];
[archiver finishEncoding];
[archiver release];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:[self pluginName]];
}
- (void) notifyPreferencesChanged:(NSNotification *)notification
{
// NSLog (@"ASR33 notifyPreferencesChanged");
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
runWithRealtimeSpeed = [defaults integerForKey:ASR33_PREFS_SPEED_KEY];
playSound = runWithRealtimeSpeed && [defaults boolForKey:ASR33_PREFS_PLAY_SOUND];
soundVolume = [defaults objectForKey:ASR33_PREFS_SOUND_VOLUME] ?
[defaults floatForKey:ASR33_PREFS_SOUND_VOLUME] : 0.5f;
punchMask = [defaults boolForKey:ASR33_PREFS_MASK_HIGHBIT_KEY] ? 0177 : 0377;
}
- (void) pluginDidLoad
{
NSData *data = [[NSUserDefaults standardUserDefaults] dataForKey:[self pluginName]];
if (data) {
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
self = [self initWithCoder:unarchiver];
[unarchiver finishDecoding];
[unarchiver release];
} else
[self setOnline:YES];
inputLock = [[NSConditionLock alloc] initWithCondition:NO_INPUT];
outputLock = [[NSConditionLock alloc] initWithCondition:NO_OUTPUT];
outputOnline = [[NSCondition alloc] init];
[NSThread detachNewThreadSelector:@selector(asr33InputThread:) toTarget:self withObject:nil];
[NSThread detachNewThreadSelector:@selector(asr33OutputThread:) toTarget:self withObject:nil];
[windowController setWindowTitle:[[self pluginName] stringByDeletingPathExtension]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(notifyApplicationWillTerminate:)
name:NSApplicationWillTerminateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(notifyPreferencesChanged:)
name:NSUserDefaultsDidChangeNotification object:nil];
[self notifyPreferencesChanged:nil];
}
@end

35
ASR33/ASR33TextView.h Normal file
View File

@ -0,0 +1,35 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33TextView.h - NSTextView for the ASR 33 Teletype
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class TypeaheadBuffer;
@interface ASR33TextView : NSTextView {
@private
IBOutlet TypeaheadBuffer *typeaheadBuffer;
}
- (void) putChar:(unichar)c;
@end

161
ASR33/ASR33TextView.m Normal file
View File

@ -0,0 +1,161 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33TextView.m - NSTextView for the ASR 33 Teletype
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "ASR33TextView.h"
#import "TypeaheadBuffer.h"
@implementation ASR33TextView
- (BOOL) validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem >)item
{
SEL action = [item action];
return (action == @selector(copy:) ||
action == @selector(paste:) ||
action == @selector(selectAll:) ||
action == @selector(_learnSpellingFromMenu:) ||
action == @selector(spotlight:) ||
action == @selector(_searchWithGoogleFromMenu:) ||
action == @selector(_lookUpIndefiniteRangeInDictionaryFromMenu:) ||
action == @selector(startSpeaking:) ||
action == @selector(stopSpeaking:)) ?
[super validateUserInterfaceItem:item] : FALSE;
}
- (void) doCommandBySelector:(SEL)selector
{
NSString *selectorName = NSStringFromSelector(selector);
// NSLog (@"doCommandByselector %@", selectorName);
if (selector == @selector(insertNewline:))
[typeaheadBuffer typeahead:@"\r"];
else if (selector == @selector(deleteBackward:))
[typeaheadBuffer typeahead:@"\b"];
else if (selector == @selector(deleteForward:))
[typeaheadBuffer typeahead:@"\177"]; // Rubout
else if (selector == @selector(cancelOperation:))
[typeaheadBuffer typeahead:@"\033"]; // Escape
else if (selector == @selector(centerSelectionInVisibleArea:))
[typeaheadBuffer typeahead:@"\f"]; // Ctrl-L
else if (selector == @selector(pageDown:))
[typeaheadBuffer typeahead:@"\026"]; // Ctrl-V
else if (selector == @selector(noop:)) {
NSEvent *currentEvent = [NSApp currentEvent];
unsigned modifierFlags = [currentEvent modifierFlags];
unsigned c = [[currentEvent charactersIgnoringModifiers] characterAtIndex:0];
if (modifierFlags & NSControlKeyMask) {
switch (c) {
case 'c' :
case 'C' :
[typeaheadBuffer typeahead:@"\003"]; // Ctrl-C
break;
case 'z' :
case 'Z' :
[typeaheadBuffer typeahead:@"\032"]; // Ctrl-Z
break;
default :
NSLog (@"character %c (%o) ignored", c, c);
break;
}
} else if (modifierFlags & NSFunctionKeyMask) {
if (c == 0xf739) // fn-6 = forward delete on notebook keyboards
[typeaheadBuffer typeahead:@"\177"]; // Rubout
}
} else if (selector != @selector(complete:) &&
! [selectorName hasPrefix:@"delete"]) // ignore all delete* selectors
[super doCommandBySelector:selector];
}
- (BOOL) readSelectionFromPasteboard:(NSPasteboard *)pasteboard type:(NSString *)type
{
[pasteboard types]; // required before accessing the pasteboards data
if ([type isEqualToString:NSStringPboardType]) {
[typeaheadBuffer typeahead:[pasteboard stringForType:type]];
return YES;
}
return NO;
}
- (void) insertText:(NSString *)string
{
[typeaheadBuffer typeahead:string];
}
- (void) putChar:(unichar)c
{
NSTextStorage *storage = [self textStorage];
int length = [storage length];
NSRange endOfText = NSMakeRange(length, 0);
[self scrollRangeToVisible:endOfText];
[self setSelectedRange:endOfText];
switch (c) {
case '\a' :
// NSBeep (); // handled by the ASR33 method playSound:
break;
case '\b' :
if (length && [[storage string] characterAtIndex:length - 1] != '\n')
[super deleteBackward:self];
break;
default :
[super insertText:[NSString stringWithCharacters:&c length:1]];
break;
}
}
- (void) awakeFromNib
{
// set size of container - to make horizontal scroller appear
NSTextContainer *container = [self textContainer];
NSSize size = [container containerSize];
size.width = UINT_MAX;
[container setContainerSize:size];
[container setWidthTracksTextView:NO];
// set default font
NSFont *font = [NSFont userFixedPitchFontOfSize:11];
[self setFont:font];
// set tabstop every 8 character
NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
[style setTabStops:[NSArray array]];
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil];
NSAttributedString *str =
[[[NSAttributedString alloc] initWithString:@" " attributes:attrs] autorelease];
[style setDefaultTabInterval:8 * [str size].width /* == 7 */];
[self setTypingAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
style, NSParagraphStyleAttributeName, font, NSFontAttributeName, nil]];
if ([self respondsToSelector:@selector(setAutomaticTextReplacementEnabled:)])
[self performSelector:@selector(setAutomaticTextReplacementEnabled:)
withObject:(NSObject *) NO];
}
@end

View File

@ -0,0 +1,46 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33WindowController.h - ASR 33 Teletype Window Controller
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class ASR33, PaperTapeController, ASR33TextView, RegisterFormCell, KeepInMenuWindow;
@interface ASR33WindowController : NSObject
{
@private
IBOutlet ASR33 *asr33;
IBOutlet KeepInMenuWindow *window;
IBOutlet NSView *ttyToolbarView;
IBOutlet NSView *readerToolbarView;
IBOutlet NSView *punchToolbarView;
IBOutlet NSSegmentedControl *localOnline;
IBOutlet RegisterFormCell *kbb;
IBOutlet RegisterFormCell *tto;
IBOutlet PaperTapeController *readerController;
IBOutlet PaperTapeController *punchController;
}
- (IBAction) localOnlineClicked:(id)sender;
- (void) setWindowTitle:(NSString *)title;
@end

View File

@ -0,0 +1,242 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33WindowController.h - ASR 33 Teletype Window Controller
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "PluginFramework/PluginAPI.h"
#import "PluginFramework/KeepInMenuWindow.h"
#import "PluginFramework/Utilities.h"
#import "PluginFramework/InputConsumerProtocol.h"
#import "PluginFramework/RegisterFormCell.h"
#import "ASR33WindowController.h"
#import "ASR33.h"
@implementation ASR33WindowController
#define TTY_TOOLBAR_ITEM_IDENTIFIER @"ttyTBItemIdentifier"
#define READER_TOOLBAR_ITEM_IDENTIFIER @"readerTBItemIdentifier"
#define PUNCH_TOOLBAR_ITEM_IDENTIFIER @"punchTBItemIdentifier"
#pragma mark Toolbar
- (void) setupToolbar
{
NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier:@"ASR33WindowToolbar"] autorelease];
[toolbar setAllowsUserCustomization:NO];
[toolbar setAutosavesConfiguration:YES];
[toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel];
[toolbar setSizeMode:NSToolbarSizeModeDefault];
[toolbar setDelegate:self];
[window setToolbar:toolbar];
[window setShowsToolbarButton:YES];
adjustToolbarControlForTiger ([kbb controlView]);
adjustToolbarControlForTiger ([tto controlView]);
}
- (NSToolbarItem *) toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdent
willBeInsertedIntoToolbar:(BOOL)willBeInserted
{
NSRect rect;
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdent] autorelease];
if ([itemIdent isEqual:TTY_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedStringFromTableInBundle(
@"ASR 33 Teletype", nil, bundle, @"")];
[toolbarItem setPaletteLabel:NSLocalizedStringFromTableInBundle(
@"ASR 33 Teletype", nil, bundle, @"")];
[toolbarItem setToolTip:NSLocalizedStringFromTableInBundle(
@"This area contains the registers and switches of the ASR 33 teletype",
nil, bundle, @"")];
[toolbarItem setView:ttyToolbarView];
rect = [ttyToolbarView frame];
[toolbarItem setMinSize:NSMakeSize(NSWidth(rect), NSHeight(rect))];
[toolbarItem setMaxSize:NSMakeSize(NSWidth(rect), NSHeight(rect))];
} else if ([itemIdent isEqual:READER_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedStringFromTableInBundle(
@"Low Speed Paper Tape Reader", nil, bundle, @"")];
[toolbarItem setPaletteLabel:NSLocalizedStringFromTableInBundle(
@"Low Speed Paper Tape Reader", nil, bundle, @"")];
[toolbarItem setToolTip:NSLocalizedStringFromTableInBundle(
@"This area displays the state of the low speed paper tape reader",
nil, bundle, @"")];
[toolbarItem setView:readerToolbarView];
rect = [readerToolbarView frame];
[toolbarItem setMinSize:NSMakeSize(NSWidth(rect), NSHeight(rect))];
[toolbarItem setMaxSize:NSMakeSize(NSWidth(rect), NSHeight(rect))];
} else if ([itemIdent isEqual:PUNCH_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedStringFromTableInBundle(
@"Low Speed Paper Tape Punch", nil, bundle, @"")];
[toolbarItem setPaletteLabel:NSLocalizedStringFromTableInBundle(
@"Low Speed Paper Tape Punch", nil, bundle, @"")];
[toolbarItem setToolTip:NSLocalizedStringFromTableInBundle(
@"This area displays the state of the low speed paper tape punch",
nil, bundle, @"")];
[toolbarItem setView:punchToolbarView];
rect = [punchToolbarView frame];
[toolbarItem setMinSize:NSMakeSize(NSWidth(rect), NSHeight(rect))];
[toolbarItem setMaxSize:NSMakeSize(NSWidth(rect), NSHeight(rect))];
} else
toolbarItem = nil;
return toolbarItem;
}
- (NSArray *) toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObjects:
TTY_TOOLBAR_ITEM_IDENTIFIER, NSToolbarSeparatorItemIdentifier,
READER_TOOLBAR_ITEM_IDENTIFIER, NSToolbarSeparatorItemIdentifier,
PUNCH_TOOLBAR_ITEM_IDENTIFIER,
nil];
}
- (NSArray *) toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObjects:
TTY_TOOLBAR_ITEM_IDENTIFIER, READER_TOOLBAR_ITEM_IDENTIFIER,
PUNCH_TOOLBAR_ITEM_IDENTIFIER, NSToolbarSeparatorItemIdentifier,
nil];
}
- (void) windowDidBecomeMain:(NSNotification *)notification
{
if (runningOnLionOrNewer()) {
[kbb setEnabled:YES];
[tto setEnabled:YES];
[readerController setEnabled:YES];
[punchController setEnabled:YES];
}
}
- (void) windowDidResignMain:(NSNotification *)notification
{
if (runningOnLionOrNewer()) {
[kbb setEnabled:NO];
[tto setEnabled:NO];
[readerController setEnabled:NO];
[punchController setEnabled:NO];
}
}
#pragma mark Notifications
- (void) windowWillBeginSheet:(NSNotification *)notification
{
[localOnline setEnabled:NO];
[kbb setEnabled:NO];
[tto setEnabled:NO];
[readerController setEnabled:NO];
[punchController setEnabled:NO];
}
- (void) windowDidEndSheet:(NSNotification *)notification;
{
[localOnline setEnabled:YES];
[kbb setEnabled:YES];
[tto setEnabled:YES];
[readerController setEnabled:YES];
[punchController setEnabled:YES];
}
- (void) notifyPluginsLoaded:(NSNotification *)notification
{
[self windowDidResignMain:notification];
[window orderBackFromDefaults:self];
}
- (void) setupNotifications
{
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self
selector:@selector(notifyOnlineChanged:) name:TTY_ONLINE_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyPluginsLoaded:)
name:PLUGINS_LOADED_NOTIFICATION object:nil];
}
#pragma mark Controls
- (IBAction) localOnlineClicked:(id)sender
{
[asr33 setOnline:[sender selectedSegment]];
}
- (void) notifyOnlineChanged:(NSNotification *)notification
{
[localOnline setSelectedSegment:[asr33 getOnline]];
}
#pragma mark Initialization
- (void) setWindowTitle:(NSString *)title
{
BOOL isAuxTTY = ! [[window title] isEqualToString:title];
NSRect oldFrame = [window frame];
[window setTitle:title];
[window setFrameAutosaveName:title];
/* this is a hack to move the AuxTTY window away from the exact position of the ConTTY when the
simulator starts for the first time without existing preferences file */
if (isAuxTTY && NSEqualRects(oldFrame, [window frame]))
[window setFrameOrigin:NSMakePoint(oldFrame.origin.x + 20, oldFrame.origin.y - 20)];
}
- (void) setupRegisters
{
[kbb setupRegisterFor:asr33 getRegisterValue:@selector(getKBB) setRegisterValue:@selector(setKBB:)
changedNotificationName:KBB_CHANGED_NOTIFICATION mask:0377 base:8];
[tto setupRegisterFor:asr33 getRegisterValue:@selector(getTTO) setRegisterValue:@selector(setTTO:)
changedNotificationName:TTO_CHANGED_NOTIFICATION mask:0377 base:8];
}
- (void) awakeFromNib
{
[self setupToolbar];
[self setupNotifications];
[self setupRegisters];
}
@end

151
ASR33/ASR33iot.c Normal file
View File

@ -0,0 +1,151 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33iot.c - ASR 33 Teletype IOTs
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#define USE_ASR33_REGISTERS_DIRECTLY 1
#define USE_PDP8_REGISTERS_DIRECTLY 1
#import "PluginFramework/PluginAPI.h"
#import "PluginFramework/PDP8.h"
#import "PluginFramework/InputConsumerProtocol.h"
#import "ASR33iot.h"
#import "ASR33.h"
void i6030 (void) /* KCF 6030 */
{
pdp8->IOFLAGS &= ~PLUGIN_POINTER(ASR33)->inflag;
EXECUTION_TIME (12);
}
void i6031 (void) /* KSF 6031 */
{
if (pdp8->IOFLAGS & PLUGIN_POINTER(ASR33)->inflag)
pdp8->PC++;
EXECUTION_TIME (12);
}
unsigned s6031 (void) /* KSF 6031 stiptest */
{
return pdp8->IOFLAGS & PLUGIN_POINTER(ASR33)->inflag;
}
void i6032 (void) /* KCC 6032 */
{
pdp8->IOFLAGS &= ~PLUGIN_POINTER(ASR33)->inflag;
pdp8->AC &= 010000;
[PLUGIN_POINTER(ASR33) canContinueInput];
EXECUTION_TIME (12);
}
void i6034 (void) /* KRS 6034 */
{
pdp8->AC |= PLUGIN_POINTER(ASR33)->KBB;
EXECUTION_TIME (12);
}
void i6035 (void) /* KIE 6035 */
{
if (pdp8->AC & 1)
pdp8->IMASK |= PLUGIN_POINTER(ASR33)->inflag | PLUGIN_POINTER(ASR33)->outflag;
else
pdp8->IMASK &= ~(PLUGIN_POINTER(ASR33)->inflag | PLUGIN_POINTER(ASR33)->outflag);
EXECUTION_TIME (12);
}
void i6036 (void) /* KRB 6036 */
{
pdp8->AC = (pdp8->AC & 010000) | PLUGIN_POINTER(ASR33)->KBB;
pdp8->IOFLAGS &= ~PLUGIN_POINTER(ASR33)->inflag;
[PLUGIN_POINTER(ASR33) canContinueInput];
EXECUTION_TIME (12);
}
void i6040 (void) /* TFL 6040 */
{
pdp8->IOFLAGS |= PLUGIN_POINTER(ASR33)->outflag;
EXECUTION_TIME (12);
}
void i6041 (void) /* TSF 6041 */
{
if (pdp8->IOFLAGS & PLUGIN_POINTER(ASR33)->outflag)
pdp8->PC++;
EXECUTION_TIME (12);
}
unsigned s6041 (void) /* TSF 6041 skiptest */
{
return pdp8->IOFLAGS & PLUGIN_POINTER(ASR33)->outflag;
}
void i6042 (void) /* TCF 6042 */
{
pdp8->IOFLAGS &= ~PLUGIN_POINTER(ASR33)->outflag;
EXECUTION_TIME (12);
}
void i6044 (void) /* TPC 6044 */
{
PLUGIN_POINTER(ASR33)->output = (pdp8->AC & 0377);
[PLUGIN_POINTER(ASR33) canContinueOutput];
EXECUTION_TIME (12);
}
void i6045 (void) /* TSK 6045 */
{
if (pdp8->IOFLAGS & pdp8->IMASK & (PLUGIN_POINTER(ASR33)->inflag | PLUGIN_POINTER(ASR33)->outflag))
pdp8->PC++;
EXECUTION_TIME (12);
}
unsigned s6045 (void) /* TSK 6045 skiptest */
{
return pdp8->IOFLAGS & pdp8->IMASK & (PLUGIN_POINTER(ASR33)->inflag | PLUGIN_POINTER(ASR33)->outflag);
}
void i6046 (void) /* TLS 6046 */
{
PLUGIN_POINTER(ASR33)->output = (pdp8->AC & 0377);
pdp8->IOFLAGS &= ~PLUGIN_POINTER(ASR33)->outflag;
[PLUGIN_POINTER(ASR33) canContinueOutput];
EXECUTION_TIME (12);
}

39
ASR33/ASR33iot.h Normal file
View File

@ -0,0 +1,39 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33iot.h - ASR 33 Teletype IOTs
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
extern void i6030 (void); /* KCF 6030 */
extern void i6031 (void); /* KSF 6031 */
extern unsigned s6031 (void); /* KSF (skip test) */
extern void i6032 (void); /* KCC 6032 */
extern void i6034 (void); /* KRS 6034 */
extern void i6035 (void); /* KIE 6035 */
extern void i6036 (void); /* KRB 6036 */
extern void i6040 (void); /* TFL 6040 */
extern void i6041 (void); /* TSF 6041 */
extern unsigned s6041 (void); /* TSF (skip test) */
extern void i6042 (void); /* TCF 6042 */
extern void i6044 (void); /* TPC 6044 */
extern void i6045 (void); /* TSK 6045 */
extern unsigned s6045 (void); /* TSK (skip test) */
extern void i6046 (void); /* TLS 6046 */

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,307 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* index.html - Online help for the ASR 33 Teletype
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>ASR 33 Teletype Help</title>
<meta name="description"
content="Describes the functioning and PDP-8 IOTs of the ASR 33 Teletype">
<meta name="AppleTitle" content="ASR 33 Teletype Help">
<meta name="AppleIcon" content="pdp8e.png">
<link href="styles.css" rel="stylesheet" media="all">
</head>
<body>
<h1>ASR 33 Teletype Help</h1>
<p>
The ASR 33 Teletype can operate under program control or independent of the PDP-8 unter manual
control. When operated in manual mode, characters typed at the keyboard are printed by the type
writer of the teletype. When additionally the paper tape punch is turned on, the typed
characters are punched on the papter tape, too. When a paper tape is loaded into the reader and
the reader is turned on, the teletype ignores the keyboard input and reads characters to print
or punch from the reader paper tape.
</p>
<p>
When the teletype is used in online mode, characters typed at the keyboard or read from the reader paper
tape are not printed or punched, but their ASCII value is transferred into the keyboard buffer register
KBB, from where the PDP-8 can read it into the accumulator AC. The PDP-8 then can use teletype output
IOTs to write the character to the teletype output buffer register TTO to initiate the printing or
punching of the character.
</p>
<p>
The teletypes of the PDP-8/E Simulator have the following improvements compared to hardware ASR 33
Teletypes:
<p>
<ul>
<li>
Backspace handling: When the teletype is operated in local mode, typing the backspace key causes the
last character to be removed from the output display and &mdash; when the punch is turned on &mdash;
from the punch paper tape. The Macintosh clear key (at the top left of the numeric key pad or fn-6 on
notebook keyboards) has the function of the ASR 33 rubout key.
</li>
<li>
Tabulator handling: The teletype handles the output of tabulator characters with tabulator stops at every
8th column. (Tab characters are punched to paper tapes unaltered.)
</li>
<li>
Speed: The simulated teletype can run with the speed of a hardware ASR 33 teletype (about ten characters
per second) or as fast as possible. Use the ASR 33 preference pane to change the speed of the teletype.
</li>
<li>
High bit masking for the punch: When this feature is enabled (in the ASR 33 preference pane), the paper
tape punch masks the most significant bit of the punched characters. This is useful when you run PDP-8
software that use the 8th bit as a checksum and save the output to a paper tape. When the MSB is
masked out, you can open and read the paper tape file with any Mac text editor. (When punching BIN or
RIM format paper tapes, you normally won't have to disable the MSB masking because these formats use
the 8th bit only for punching leaders or trailers, which are not needed with paper tapes stored in
files. One exception: BIN format with field settings uses values 3x0 (x=0,&hellip;,7) to signal that
the following code is to be loaded to memory field x.)
</li>
<li>
&ldquo;Copy &amp; Paste&rdquo; and &ldquo;Drag &amp; Drop&rdquo; is supported for the teletype:
When you paste text into the teletype window, the text is inserted into a typeahead buffer
from where the teletype reads it sccessively as if the characters were typed at the keyboard.
New keyboard input is appended at the end of the typeahead buffer. While the typeahead buffer is not
empty, a button &ldquo;Flush Typeahead Buffer&rdquo; appears in the toolbar of the ASR 33 window that
you can use to clear the buffer prematurely.
</li>
</ul>
<h2>Console Teletype</h2>
<p>
The console teletype uses I/O address 03 for the keyboard and reader and 04 for the printer
and punch and supports the following IOTs:
</p>
<table>
<tr>
<th>Mnemonic<br>Symbol</th>
<th>Octal<br>Code</th>
<th class="left"><br>Description</th>
</tr>
<tr>
<td>KCF</td>
<td>6030</td>
<td class="left">
Clear the keyboard/reader I/O flag (&ldquo;Console TTY In&rdquo; in the CPU window).
Do not start the reader to read the next tape character.
</td>
</tr>
<tr>
<td>KSF</td>
<td>6031</td>
<td class="left">
Skip the next instruction when the keyboard/reader I/O flag is raised, i. e. a new
character is loaded into the keyboard buffer register KBB.
</td>
</tr>
<tr>
<td>KCC</td>
<td>6032</td>
<td class="left">
Clear AC and the keyboard/reader I/O flag. When the paper tape reader is turned on,
start to read the next character from the tape. When a new value is loaded into KBB
(from the tape or &mdash; when the reader is turned off &mdash; because the user
typed a key), the flag is raised again.
</td>
</tr>
<tr>
<td>KRS</td>
<td>6034</td>
<td class="left">
Transfer KBB into AC(4&ndash;11) by performing a logical OR (&ldquo;static&rdquo; read).
</td>
</tr>
<tr>
<td>KIE</td>
<td>6035</td>
<td class="left">
Load the keyboard/reader and printer/punch interrupt enable flag from AC(11) to enable
or disable teletype interrupts.
</td>
</tr>
<tr>
<td>KRB</td>
<td>6036</td>
<td class="left">
Clear AC and the keyboard/reader I/O flag, then read KBB into AC(4&ndash;11).
Microprogrammed combination of KCC and KRS.
</td>
</tr>
<tr>
<td>TFL</td>
<td>6040</td>
<td class="left">
Set the printer/punch I/O flag (&ldquo;Console TTY Out&rdquo; in the CPU window).
</td>
</tr>
<tr>
<td>TSF</td>
<td>6041</td>
<td class="left">
Skip the next instruction when the printer/punch I/O flag is set.
</td>
</tr>
<tr>
<td>TCF</td>
<td>6042</td>
<td class="left">
Clear the printer/punch I/O flag.
</td>
</tr>
<tr>
<td>TPC</td>
<td>6044</td>
<td class="left">
Load the teletype output buffer register TTO with the contents of AC(4&ndash;11) and
start to print and, when the punch is turned on, to punch the character from TTO.
When the output is completed, the printer/punch I/O flag is raised.
</td>
</tr>
<tr>
<td>TSK</td>
<td>6045</td>
<td class="left">
Skip the next instruction when an interrupt was caused by the teletype, i. e. when
the interrupt mask flag for input or output and the corresponding I/O flag are both set.
</td>
</tr>
<tr>
<td>TLS</td>
<td>6046</td>
<td class="left">
Clear the printer/punch I/O flag, load TTO from AC(4&ndash;11) and start the output.
When the output is completed, the printer/punch I/O flag is raised again.
Microprogrammed combination of TCF and TPC.
</td>
</tr>
</table>
<h3>Remark</h3>
<p>
Earlier PDP-8 models (PDP-8, -8/S, -8/I, -8/L) do not support the IOTs KCF (6030), KIE (6035),
TFL (6040), and TSK (6045).
</p>
<h2>Auxiliary Teletype</h2>
<p>
The PDP-8/E Simulator includes an Auxiliary Teletype that you can activate in the Finder information
window for the PDP-8/E Simulator application in the area &ldquo;Plug-ins&rdquo;. (With Mac OS X 10.6
&ldquo;Snow Leopard&rdquo;, Apple has removed the Plug-ins section from the Finder information window,
and you must open the application package manually and move the Auxiliary Teletype from the folder
&ldquo;Contents/PlugIns Disabled&rdquo; to &ldquo;Contents/PlugIns&rdquo;.)
</p>
<p>
In the CPU window,
the flags for the Auxiliary Teletype are called &ldquo;Auxiliary TTY In&rdquo; and
&ldquo;Auxiliary TTY Out&rdquo;. It uses the I/O addressed 40 for input and 41 for output and
supports the following IOTs:
</p>
<table>
<tr>
<th>Mnemonic<br>Symbol</th>
<th>Octal<br>Code</th>
<th class="left">Corresponding<br>Console Teletype IOT</th>
</tr>
<tr>
<td>AKCF</td>
<td>6400</td>
<td class="left">KCF (6030)</td>
</tr>
<tr>
<td>AKSF</td>
<td>6401</td>
<td class="left">KSF (6031)</td>
</tr>
<tr>
<td>AKCC</td>
<td>6402</td>
<td class="left">KCC (6032)</td>
</tr>
<tr>
<td>AKRS</td>
<td>6404</td>
<td class="left">KRS (6034)</td>
</tr>
<tr>
<td>AKIE</td>
<td>6405</td>
<td class="left">KIE (6035)</td>
</tr>
<tr>
<td>AKRB</td>
<td>6406</td>
<td class="left">KRB (6036)</td>
</tr>
<tr>
<td>ATFL</td>
<td>6410</td>
<td class="left">TFL (6040)</td>
</tr>
<tr>
<td>ATSF</td>
<td>6411</td>
<td class="left">TSF (6041)</td>
</tr>
<tr>
<td>ATCF</td>
<td>6412</td>
<td class="left">TCF (6042)</td>
</tr>
<tr>
<td>ATPC</td>
<td>6414</td>
<td class="left">TPC (6044)</td>
</tr>
<tr>
<td>ATSK</td>
<td>6415</td>
<td class="left">TSK (6045)</td>
</tr>
<tr>
<td>ATLS</td>
<td>6416</td>
<td class="left">TLS (6046)</td>
</tr>
</table>
<h2>Additional Teletypes</h2>
<p>
When you need additional teletypes, you can duplicate the Console or Auxiliary Teletype plugin and
then modify the property list that describes the I/O addresses and IOTs for the plugin. You find
this property list inside the plugin package at Contents/Resources/English.lproj/auxtty-io-info.plist.
</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,239 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* styles.css - Online help - Style sheet
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
p {
font-size: 9pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
text-decoration: none
}
p.small {
font-size: 8pt;
}
a {
font-family: "Lucida Grande", Arial, "Sans Serif";
text-decoration: none
}
a:hover {
text-decoration: underline
}
ul {
margin-left: 1.25em; padding-left: 0em;
}
li {
font-size: 9pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
text-decoration: none
}
#mainbox {
background-color: #fff;
margin-top: 30px;
margin-right: 26px;
margin-left: 18px;
position: absolute;
top: 10px
}
#taskbox {
background-color: #eee;
list-style-type: decimal;
list-style-position: outside;
margin-top: 12px;
margin-bottom: 12px;
border: solid 1px #444
}
h1 {
font-size: 12pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 6pt;
}
h2 {
font-size: 12pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 8pt;
}
h3 {
font-size: 10pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 5pt;
}
h4 {
font-size: 9pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 4pt;
}
/* index.html */
table.index {
padding-top: 20px;
width: 100%;
}
td.banner {
padding: 20px;
}
td.toc {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
padding-right:20px;
border-left: 1px solid darkgray;
}
p.toc {
line-height: 40px;
}
/* other pages */
table {
border-collapse: separate;
border-spacing: 0px;
}
th {
font-family: "Lucida Grande", Arial, "Sans Serif";
font-size: 9pt;
font-style: bold;
border-bottom: 1px solid gray;
padding-left: 10px;
padding-right: 10px;
}
th.left {
text-align: left;
}
td {
text-align: center;
vertical-align: top;
font-family: "Lucida Grande", Arial, "Sans Serif";
font-size: 9pt;
padding-left: 10px;
padding-right: 10px;
}
td.left {
text-align: left;
}
td.right {
text-align: right;
}
td.br {
border-right: 1px solid gray;
}
td.bb {
border-bottom: 1px solid lightgray;
}
td.bb_left {
text-align: left;
border-bottom: 1px solid lightgray;
}
td.bbr {
border-bottom: 1px solid lightgray;
border-right: 1px solid gray;
}
td.opcode {
vertical-align: middle;
width: 40px;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_right {
text-align: right;
vertical-align: middle;
width: 40px;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_left {
text-align: left;
vertical-align: middle;
width: 40px;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tb {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border-top: 1px solid black;
border-bottom: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tlb {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border-top: 1px solid black;
border-left: 1px solid black;
border-bottom: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tbr {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border-top: 1px solid black;
border-bottom: 1px solid black;
border-right: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tlbr {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}

View File

@ -0,0 +1,28 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* InfoPlist.strings - Localized strings for Info.plist
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
CFBundleName = "ASR 33 Teletype";
CFBundleGetInfoString = "ASR 33 Teletype 2.0.2, Copyright © 1994-2015 Bernhard Baehr";
NSHumanReadableCopyright = "Copyright © 1994-2015 Bernhard Baehr";
CFBundleHelpBookName = "ASR 33 Teletype Help";

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
* PDP-8/E Simulator
*
* Copyright © 1994-2014 Bernhard Baehr
*
* auxtty-io-info.plist - ASR 33 Auxiliary Teletype I/O info property list
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<dict>
<key>ioflags</key>
<array>
<string>Auxiliary TTY In</string>
<string>Auxiliary TTY Out</string>
</array>
<key>ioaddresses</key>
<array>
<string>40</string>
<string>41</string>
</array>
<key>iots</key>
<array>
<!-- 603x reader -->
<string>AKCF</string>
<string>AKSF</string>
<string>AKCC</string>
<string></string>
<string>AKRS</string>
<string>AKIE</string>
<string>AKRB</string>
<string></string>
<!-- 604x - punch -->
<string>ATFL</string>
<string>ATSF</string>
<string>ATCF</string>
<string></string>
<string>ATPC</string>
<string>ATSK</string>
<string>ATLS</string>
<string></string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
* PDP-8/E Simulator
*
* Copyright © 1994-2014 Bernhard Baehr
*
* io-info.plist - ASR 33 Teletype I/O info property list
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<dict>
<key>ioflags</key>
<array>
<string>Console TTY In</string>
<string>Console TTY Out</string>
</array>
<key>ioaddresses</key>
<array>
<string>3</string>
<string>4</string>
</array>
<key>iots</key>
<array>
<!-- 603x reader -->
<string>KCF</string>
<string>KSF</string>
<string>KCC</string>
<string></string>
<string>KRS</string>
<string>KIE</string>
<string>KRB</string>
<string></string>
<!-- 604x - punch -->
<string>TFL</string>
<string>TSF</string>
<string>TCF</string>
<string></string>
<string>TPC</string>
<string>TSK</string>
<string>TLS</string>
<string></string>
</array>
</dict>
</plist>

32
ASR33/Info.plist Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleHelpBookFolder</key>
<string>ASR33OnlineHelp</string>
<key>CFBundleHelpBookName</key>
<string>ASR 33 Teletype Help</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>de.bernhard-baehr.pdp8e.ASR33</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.2</string>
<key>NSPrincipalClass</key>
<string>ASR33</string>
</dict>
</plist>

BIN
ASR33/SpeakerLoud.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
ASR33/SpeakerQuiet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

41
ASR33/TypeaheadBuffer.h Normal file
View File

@ -0,0 +1,41 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* TypeaheadBuffer.h - Typeahead buffer for a keyboard input device
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@protocol InputConsumer;
@interface TypeaheadBuffer : NSObject {
@private
IBOutlet id <InputConsumer> inputConsumer;
IBOutlet NSButton *flushTypeaheadBufferButton;
NSMutableString *typeaheadBuffer;
}
- (IBAction) flush:(id)sender;
- (BOOL) hasCharacters;
- (signed short) getNextChar;
- (void) typeahead:(NSString *)string;
@end

91
ASR33/TypeaheadBuffer.m Normal file
View File

@ -0,0 +1,91 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* TypeaheadBuffer.m - Typeahead buffer for a keyboard input device
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "PluginFramework/Utilities.h"
#import "PluginFramework/InputConsumerProtocol.h"
#import "TypeaheadBuffer.h"
@implementation TypeaheadBuffer
#define MIN_LENGTH_TO_SHOW_FLUSH_TYPEAHEAD_BUTTON 5
- (IBAction) flush:(id)sender
{
[typeaheadBuffer deleteCharactersInRange:NSMakeRange(0, [typeaheadBuffer length])];
[flushTypeaheadBufferButton setHidden:YES];
}
- (BOOL) hasCharacters
{
return [typeaheadBuffer length] > 0;
}
- (signed short) getNextChar
{
signed short c = 0;
int length = [typeaheadBuffer length];
if (length < MIN_LENGTH_TO_SHOW_FLUSH_TYPEAHEAD_BUTTON)
[flushTypeaheadBufferButton setHidden:YES];
if (length > 0) {
c = [typeaheadBuffer characterAtIndex:0];
[typeaheadBuffer deleteCharactersInRange:NSMakeRange(0, 1)];
}
return c;
}
- (void) typeahead:(NSString *)string
{
int length = [typeaheadBuffer length];
[typeaheadBuffer appendString:string];
if ([typeaheadBuffer length] >= MIN_LENGTH_TO_SHOW_FLUSH_TYPEAHEAD_BUTTON)
[flushTypeaheadBufferButton setHidden:NO];
if (length == 0)
[inputConsumer canContinueInput];
}
- (void) awakeFromNib
{
if (runningOnTiger()) {
NSPoint p = [flushTypeaheadBufferButton frame].origin;
p.x += 2; p.y += 1;
[flushTypeaheadBufferButton setFrameOrigin:p];
[flushTypeaheadBufferButton setBezelStyle:NSRoundRectBezelStyle];
[flushTypeaheadBufferButton setShowsBorderOnlyWhileMouseInside:NO];
[[flushTypeaheadBufferButton cell] setImagePosition:NSNoImage];
}
typeaheadBuffer = [[NSMutableString stringWithCapacity:128] retain];
}
@end

BIN
ASR33/tty-backspace.mp3 Normal file

Binary file not shown.

BIN
ASR33/tty-bell.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
ASR33/tty-keystroke1.mp3 Normal file

Binary file not shown.

BIN
ASR33/tty-keystroke2.mp3 Normal file

Binary file not shown.

BIN
ASR33/tty-keystroke3.mp3 Normal file

Binary file not shown.

BIN
ASR33/tty-keystroke4.mp3 Normal file

Binary file not shown.

BIN
ASR33/tty-space.mp3 Normal file

Binary file not shown.

View File

@ -0,0 +1,28 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33Preferences.h - ASR 33 Teletype Preferences Pane
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define ASR33_PREFS_SPEED_KEY @"ASR33RunWith10CharsPerSecond"
#define ASR33_PREFS_MASK_HIGHBIT_KEY @"ASR33MaskPunchedHighBit"
#define ASR33_PREFS_PLAY_SOUND @"ASR33PlaySound"
#define ASR33_PREFS_SOUND_VOLUME @"ASR33SoundVolume"

View File

@ -0,0 +1,41 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ASR33Preferences.m - ASR 33 Teletype Preferences Pane
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <PreferencePanes/PreferencePanes.h>
#import "ASR33Preferences.h"
@interface ASR33Preferences : NSPreferencePane
{
}
@end
@implementation ASR33Preferences
// empty class, otherwise the preference pane bundle has no loadable code and does not load
@end

View File

@ -0,0 +1,884 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10D573</string>
<string key="IBDocument.InterfaceBuilderVersion">740</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">740</string>
</object>
<array class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<integer value="46"/>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="393284157">
<object class="NSCustomObject" id="906329595">
<string key="NSClassName">ASR33Preferences</string>
</object>
<object class="NSCustomObject" id="272243113">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="178357386">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="73717780">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{123, 459}, {500, 135}}</string>
<int key="NSWTFlags">1886912512</int>
<string key="NSWindowTitle">ASR33Preferences</string>
<object class="NSMutableString" key="NSWindowClass">
<characters key="NS.bytes">NSWindow</characters>
</object>
<object class="NSMutableString" key="NSViewClass">
<characters key="NS.bytes">View</characters>
</object>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{213, 107}</string>
<object class="NSView" key="NSWindowView" id="53624335">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSCustomView" id="406651496">
<reference key="NSNextResponder" ref="53624335"/>
<int key="NSvFlags">261</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSImageView" id="998910824">
<reference key="NSNextResponder" ref="406651496"/>
<int key="NSvFlags">268</int>
<set class="NSMutableSet" key="NSDragTypes">
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple PNG pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</set>
<string key="NSFrame">{{436, 25}, {24, 24}}</string>
<reference key="NSSuperview" ref="406651496"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="336402003">
<int key="NSCellFlags">130560</int>
<int key="NSCellFlags2">33554432</int>
<object class="NSCustomResource" key="NSContents">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">SpeakerLoud</string>
</object>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSEditable">YES</bool>
</object>
<object class="NSImageView" id="396547556">
<reference key="NSNextResponder" ref="406651496"/>
<int key="NSvFlags">268</int>
<set class="NSMutableSet" key="NSDragTypes">
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple PNG pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</set>
<string key="NSFrame">{{169, 25}, {24, 24}}</string>
<reference key="NSSuperview" ref="406651496"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="444378913">
<int key="NSCellFlags">130560</int>
<int key="NSCellFlags2">33554432</int>
<object class="NSCustomResource" key="NSContents">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">SpeakerQuiet</string>
</object>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSEditable">YES</bool>
</object>
<object class="NSSlider" id="668135433">
<reference key="NSNextResponder" ref="406651496"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{201, 26}, {227, 21}}</string>
<reference key="NSSuperview" ref="406651496"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSliderCell" key="NSCell" id="652841544">
<int key="NSCellFlags">-2079981824</int>
<int key="NSCellFlags2">131072</int>
<string key="NSContents"/>
<reference key="NSControlView" ref="668135433"/>
<double key="NSMaxValue">1</double>
<double key="NSMinValue">0.0</double>
<double key="NSValue">0.5</double>
<double key="NSAltIncValue">0.0</double>
<int key="NSNumberOfTickMarks">0</int>
<int key="NSTickMarkPosition">0</int>
<bool key="NSAllowsTickMarkValuesOnly">NO</bool>
<bool key="NSVertical">NO</bool>
</object>
</object>
<object class="NSButton" id="210496674">
<reference key="NSNextResponder" ref="406651496"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 28}, {145, 18}}</string>
<reference key="NSSuperview" ref="406651496"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="349881374">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Play teletype sound</string>
<object class="NSFont" key="NSSupport" id="265885934">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="210496674"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage" id="762906464">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
<object class="NSButtonImageSource" key="NSAlternateImage" id="551255965">
<string key="NSImageName">NSSwitch</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
<object class="NSMatrix" id="243166556">
<reference key="NSNextResponder" ref="406651496"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 57}, {251, 38}}</string>
<reference key="NSSuperview" ref="406651496"/>
<bool key="NSEnabled">YES</bool>
<int key="NSNumRows">2</int>
<int key="NSNumCols">1</int>
<array class="NSMutableArray" key="NSCells">
<object class="NSButtonCell" id="283695082">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Run as fast as possible</string>
<reference key="NSSupport" ref="265885934"/>
<reference key="NSControlView" ref="243166556"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">0</int>
<object class="NSButtonImageSource" key="NSAlternateImage" id="27417614">
<string key="NSImageName">NSRadioButton</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<object class="NSButtonCell" id="915918085">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Run with 10 characters per second</string>
<reference key="NSSupport" ref="265885934"/>
<reference key="NSControlView" ref="243166556"/>
<int key="NSTag">1</int>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">549453824</int>
<string key="NSSize">{18, 18}</string>
<array class="NSMutableArray" key="NSReps">
<array>
<integer value="0"/>
<object class="NSBitmapImageRep">
<object class="NSData" key="NSTIFFRepresentation">
<bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB
AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAwYAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAMGGFw
cGwCAAAAbW50clJHQiBYWVogB9YABAADABMALAASYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAPbWAAEAAAAA0y1hcHBsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAOclhZWgAAASwAAAAUZ1hZWgAAAUAAAAAUYlhZWgAAAVQAAAAUd3RwdAAAAWgAAAAUY2hhZAAA
AXwAAAAsclRSQwAAAagAAAAOZ1RSQwAAAbgAAAAOYlRSQwAAAcgAAAAOdmNndAAAAdgAAAMSbmRpbgAA
BOwAAAY+ZGVzYwAACywAAABkZHNjbQAAC5AAAAAubW1vZAAAC8AAAAAoY3BydAAAC+gAAAAtWFlaIAAA
AAAAAF1KAAA0kQAACCVYWVogAAAAAAAAdCAAALRgAAAjPVhZWiAAAAAAAAAlbAAAFyoAAKfDWFlaIAAA
AAAAAPNSAAEAAAABFs9zZjMyAAAAAAABDEIAAAXe///zJgAAB5IAAP2R///7ov///aMAAAPcAADAbGN1
cnYAAAAAAAAAAQHNAABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAAD
AQAAAQACBAUGBwkKCw0ODxASExQWFxgaGxweHyAiIyQmJygpKywtLzAxMjM1Njc4OTs8PT5AQUJDREZH
SElKS0xOT1BRUlNUVVZXWFlaW1xdXl9hYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SF
hoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnZ6foKGio6SlpqanqKmqq6ytra6vsLGysrO0tba3uLi5uru8
vL2+v8DBwcLDxMXGxsfIycrKy8zNzs7P0NHS0tPU1dbW19jZ2drb3Nzd3t/g4eLi4+Tl5ufo6enq6+zt
7u/w8fHy8/T19vf4+fr7/P3+/v8AAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR8gISIjJCUnKCkq
Ky0uLzAxMzQ1Njc4OTo7PD0/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaWltcXV5fYGFiY2RlZmdo
aWprbG1ub3BxcnN0dXZ3d3h5ent8fH1+f4CBgoKDhIWGh4iIiYqLjI2Oj5CRkpOUlJWWl5iZmpucnZ2e
n6ChoqOkpaamp6ipqqusra6vsLCxsrO0tba3uLm5uru8vb6/wMHCw8TFx8jJysvMzc7P0NDR0tPU1dbX
2Nna29ze3+Dh4uPk5ebn6err7O3u7/Hy8/T19vf5+vv8/f7/AAIDAwQFBgcICQoKCwwNDg8QERITFBUW
FxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODg5Ojs8PT4+P0BBQkNDREVGR0hJSUpLTE1O
Tk9QUVJSU1RVVVZXWFhZWltbXF1eXl9gYWFiY2RkZWZnZ2hpaWprbGxtbm5vcHFxcnNzdHV1dnd4eHl6
ent8fH1+fn+AgYGCg4SEhYaHiImJiouMjY6Oj5CRkpOTlJWWl5iZmZqbnJ2en6ChoqOkpaanqKmqq6yt
rq+xsrO0tba3uLq7vL2+wMHDxMbHycrMzs/R0tTW19nb3d7g4uTm6Ors7vDy9Pb4+vz+/wAAbmRpbgAA
AAAAAAY2AACXGgAAVjoAAFPKAACJ3gAAJ8IAABaoAABQDQAAVDkAAiuFAAIZmQABeFEAAwEAAAIAAAAA
AAEABgANABcAIwAxAEAAUgBlAHsAkwCrAMUA4gD/AR8BPwFhAYUBqgHQAfgCIAJLAncCpQLSAwIDMwNl
A5gDzgQFBD0EdQSvBOsFKQVnBacF6AYqBm4GtQb8B0UHkgfkCDkIkAjnCT4JmAn0ClAKrQsLC2sLygwq
DIwM8Q1XDcAOKA6SDv4PbA/bEE0QxBE7EbQSMRKwEzITuRREFNAVYBXxFocXHhfAGGIZBBmsGlQa+RuU
HC4czh1yHhQeux9jIA0gvCFoIhkizyOJJEEk+SW6JnknOygFKMspkypiKzIsASzXLawuhy9gMD4xGzH8
MtszvzSgNYY2cjdcOEw5OTorOxs8CD0EPfU+6z/nQOFB2ELUQ9VE00XcRttH5EjxSgBLCUwdTTFOUE9v
UI9Rt1LdVAVVNlZsV6VY4FohW21ct135X09goGH0Y0tkqGYFZ19oxGova5ptCG54b/BxbnLsdG119Xd/
eQh6knwqfcV/W4D4gpSEO4Xih4CJKorYjIqOOY/jkZuTWJUOlsyYiZpSnB6d4Z+soX+jWqUvpxOo+6rj
rMuuwLC4sra0rra0uL+60LzfvwDBHcLdxLXGhchYyi7MCs3lz7rRmtOA1WPXR9kq2xPc/97s4M/iveSn
5o3obupT7ELuLPAM8fLz0PW396H5f/tZ/T3//wAAAAEAAwALABYAJQA3AE0AZQCBAJ8AwQDlAQsBNQFh
AZABwQH1AisCZAKfAtwDHANfA6MD6gQ0BH8EzQT1BR0FcAXEBhsGdAbPBy0HXAeMB+4IUgi4CSAJVAmK
CfYKZArVC0cLgQu8DDIMqw0mDaIOIQ6hDyQPqRAvELgQ/RFDEc8SXRLuE4AUFRSrFUMV3RZ5FxcXthhY
GPwZoRpIGvEbnBxJHPgdqB5bHw8fxSB9ITch8iKwJDAk8yW3Jn4nRigQKNwpqSp5K0osHCzxLccuoC95
MFUxMzISMvMz1TS5NaA2hzdxOFw5STo4Oyg8Gj4DPvs/9EDuQepD6ETpRexG8Uf3SP9LFEwhTTBOQE9S
UGZSklOrVMVV4Vb/WB5ZP1phW4Vcq13SXvthUmJ/Y69k4GYSZ0dofGm0au1tZG6ib+FxInJlc6l073Y2
d396FXtjfLJ+A39VgKmB/4NWhK+GCYjCiiGLgYzjjkePrJESknuT5Ja8mCuZm5sMnH+d9J9qoOGiWqPV
pVGmz6eOqE6pzqtRrNSuWq/gsWmy8rR+tgu5Kbq6vE294b93wQ7Cp8RBxd3He8kZyrrLisxbzf/Po9FK
0vHUm9ZF1/HZn9tO3Cbc/96x4GTiGePQ5YjnQegf6Pzquex27jbv9/G583z0X/VC9wj40Pqa/GX+Mf//
AAAAAQADAAsAJQA3AE0AZQCBAJ8AwQELATUBYQGQAcEB9QIrAmQCnwLcAxwDXwOjA+oENAR/BM0FHQVw
BcQGGwZ0Bs8HLQeMB+4IUgi4CSAJign2CmQK1QtHC7wMMgyrDSYNog4hDqEPJA+pEC8QuBFDEl0S7hOA
FBUUqxVDFnkXFxe2GFgY/BpIGvEbnBxJHPgdqB8PH8UgfSE3IfIjbyQwJPMltydGKBAo3Cp5K0osHC3H
LqAveTEzMhIy8zS5NaA2hzhcOUk6ODwaPQ4+Az/0QO5C6EPoROlG8Uf3SglLFEwhTkBPUlF7UpJUxVXh
Vv9ZP1phXKtd0mAlYVJjr2TgZhJofGm0au1tZG6ib+FxInJldO92Nnd/eMl6FXyyfgN/VYCpgf+Er4YJ
h2WIwoohi4GOR4+skRKSe5PklVCWvJgrmZubDJx/nfSfaqDholqj1aVRps+oTqnOq1Gs1K2Xrlqv4LFp
svK0frYLt5m5Kbnxurq8Tb3hv3fBDsHawqfEQcUPxd3He8hKyRnKusuKzFvN/87Rz6PQdtFK0vHTxtSb
1kXXG9fx2MjZn9tO3Cbc/93Y3rHfiuBk4hni9ePQ5KzliOZk50HoH+j86drqueuX7HbtVu427xbv9/DX
8bnymvN89F/1QvYl9wj37PjQ+bX6mvt//GX9S/4x//8AAGRlc2MAAAAAAAAACkNvbG9yIExDRAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABIAAAAcAEMAbwBsAG8AcgAgAEwAQwBE
AABtbW9kAAAAAAAABhAAAJxOAAAAAL5zkQAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQg
QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA</bytes>
</object>
</object>
</array>
</array>
<object class="NSColor" key="NSColor" id="192824974">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
</object>
<reference key="NSAlternateImage" ref="27417614"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</array>
<string key="NSCellSize">{251, 18}</string>
<string key="NSIntercellSpacing">{4, 2}</string>
<int key="NSMatrixFlags">1151868928</int>
<string key="NSCellClass">NSActionCell</string>
<object class="NSButtonCell" key="NSProtoCell" id="459311738">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Radio</string>
<reference key="NSSupport" ref="265885934"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">549453824</int>
<string key="NSSize">{18, 18}</string>
<array class="NSMutableArray" key="NSReps">
<array>
<integer value="0"/>
<object class="NSBitmapImageRep">
<object class="NSData" key="NSTIFFRepresentation">
<bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
</array>
</array>
<reference key="NSColor" ref="192824974"/>
</object>
<reference key="NSAlternateImage" ref="27417614"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
<reference key="NSSelectedCell" ref="283695082"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSCellBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<reference key="NSFont" ref="265885934"/>
</object>
<object class="NSButton" id="106797704">
<reference key="NSNextResponder" ref="406651496"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{0, -1}, {253, 18}}</string>
<reference key="NSSuperview" ref="406651496"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="585207994">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">0</int>
<string key="NSContents">Mask high bit of punched characters</string>
<reference key="NSSupport" ref="265885934"/>
<reference key="NSControlView" ref="106797704"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
<reference key="NSNormalImage" ref="762906464"/>
<reference key="NSAlternateImage" ref="551255965"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
</array>
<string key="NSFrame">{{20, 20}, {460, 95}}</string>
<reference key="NSSuperview" ref="53624335"/>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSResponder</string>
</object>
</array>
<string key="NSFrameSize">{500, 135}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{213, 129}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSUserDefaultsController" id="957247940">
<bool key="NSSharedInstance">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_window</string>
<reference key="source" ref="906329595"/>
<reference key="destination" ref="73717780"/>
</object>
<int key="connectionID">8</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: values.ASR33MaskPunchedHighBit</string>
<reference key="source" ref="106797704"/>
<reference key="destination" ref="957247940"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="106797704"/>
<reference key="NSDestination" ref="957247940"/>
<string key="NSLabel">value: values.ASR33MaskPunchedHighBit</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">values.ASR33MaskPunchedHighBit</string>
<dictionary key="NSOptions">
<boolean value="NO" key="NSAllowsEditingMultipleValuesSelection"/>
<boolean value="NO" key="NSConditionallySetsEnabled"/>
<integer value="0" key="NSNullPlaceholder"/>
<boolean value="NO" key="NSRaisesForNotApplicableKeys"/>
</dictionary>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">164</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">selectedIndex: values.ASR33RunWith10CharsPerSecond</string>
<reference key="source" ref="243166556"/>
<reference key="destination" ref="957247940"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="243166556"/>
<reference key="NSDestination" ref="957247940"/>
<string key="NSLabel">selectedIndex: values.ASR33RunWith10CharsPerSecond</string>
<string key="NSBinding">selectedIndex</string>
<string key="NSKeyPath">values.ASR33RunWith10CharsPerSecond</string>
<dictionary key="NSOptions">
<boolean value="NO" key="NSAllowsEditingMultipleValuesSelection"/>
<boolean value="NO" key="NSAlwaysPresentsApplicationModalAlerts"/>
<boolean value="NO" key="NSConditionallySetsEnabled"/>
<boolean value="NO" key="NSConditionallySetsHidden"/>
<object class="NSNull" key="NSMultipleValuesPlaceholder" id="4"/>
<reference key="NSNoSelectionPlaceholder" ref="4"/>
<reference key="NSNotApplicablePlaceholder" ref="4"/>
<real value="0.0" key="NSNullPlaceholder"/>
<boolean value="NO" key="NSRaisesForNotApplicableKeys"/>
<boolean value="NO" key="NSValidatesImmediately"/>
</dictionary>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">181</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="106797704"/>
<reference key="destination" ref="243166556"/>
</object>
<int key="connectionID">186</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_firstKeyView</string>
<reference key="source" ref="906329595"/>
<reference key="destination" ref="243166556"/>
</object>
<int key="connectionID">190</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_lastKeyView</string>
<reference key="source" ref="906329595"/>
<reference key="destination" ref="106797704"/>
</object>
<int key="connectionID">191</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_initialKeyView</string>
<reference key="source" ref="906329595"/>
<reference key="destination" ref="243166556"/>
</object>
<int key="connectionID">192</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="243166556"/>
<reference key="destination" ref="210496674"/>
</object>
<int key="connectionID">207</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="210496674"/>
<reference key="destination" ref="668135433"/>
</object>
<int key="connectionID">208</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="668135433"/>
<reference key="destination" ref="106797704"/>
</object>
<int key="connectionID">209</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: values.ASR33PlaySound</string>
<reference key="source" ref="210496674"/>
<reference key="destination" ref="957247940"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="210496674"/>
<reference key="NSDestination" ref="957247940"/>
<string key="NSLabel">value: values.ASR33PlaySound</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">values.ASR33PlaySound</string>
<dictionary key="NSOptions">
<boolean value="NO" key="NSAllowsEditingMultipleValuesSelection"/>
<boolean value="NO" key="NSConditionallySetsEnabled"/>
<boolean value="NO" key="NSRaisesForNotApplicableKeys"/>
</dictionary>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">231</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">enabled: values.ASR33RunWith10CharsPerSecond</string>
<reference key="source" ref="210496674"/>
<reference key="destination" ref="957247940"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="210496674"/>
<reference key="NSDestination" ref="957247940"/>
<string key="NSLabel">enabled: values.ASR33RunWith10CharsPerSecond</string>
<string key="NSBinding">enabled</string>
<string key="NSKeyPath">values.ASR33RunWith10CharsPerSecond</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">235</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">enabled: values.ASR33RunWith10CharsPerSecond</string>
<reference key="source" ref="668135433"/>
<reference key="destination" ref="957247940"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="668135433"/>
<reference key="NSDestination" ref="957247940"/>
<string key="NSLabel">enabled: values.ASR33RunWith10CharsPerSecond</string>
<string key="NSBinding">enabled</string>
<string key="NSKeyPath">values.ASR33RunWith10CharsPerSecond</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">238</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: values.ASR33SoundVolume</string>
<reference key="source" ref="668135433"/>
<reference key="destination" ref="957247940"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="668135433"/>
<reference key="NSDestination" ref="957247940"/>
<string key="NSLabel">value: values.ASR33SoundVolume</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">values.ASR33SoundVolume</string>
<dictionary key="NSOptions">
<boolean value="NO" key="NSAllowsEditingMultipleValuesSelection"/>
<string key="NSNullPlaceholder">0.5</string>
<boolean value="NO" key="NSRaisesForNotApplicableKeys"/>
</dictionary>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">239</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="393284157"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="906329595"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="272243113"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="178357386"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="73717780"/>
<array class="NSMutableArray" key="children">
<reference ref="53624335"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">ASR33Preferences</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="53624335"/>
<array class="NSMutableArray" key="children">
<reference ref="406651496"/>
</array>
<reference key="parent" ref="73717780"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">46</int>
<reference key="object" ref="406651496"/>
<array class="NSMutableArray" key="children">
<reference ref="243166556"/>
<reference ref="210496674"/>
<reference ref="106797704"/>
<reference ref="668135433"/>
<reference ref="396547556"/>
<reference ref="998910824"/>
</array>
<reference key="parent" ref="53624335"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">124</int>
<reference key="object" ref="243166556"/>
<array class="NSMutableArray" key="children">
<reference ref="283695082"/>
<reference ref="915918085"/>
<reference ref="459311738"/>
</array>
<reference key="parent" ref="406651496"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">126</int>
<reference key="object" ref="283695082"/>
<reference key="parent" ref="243166556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">127</int>
<reference key="object" ref="915918085"/>
<reference key="parent" ref="243166556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">128</int>
<reference key="object" ref="106797704"/>
<array class="NSMutableArray" key="children">
<reference ref="585207994"/>
</array>
<reference key="parent" ref="406651496"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">144</int>
<reference key="object" ref="957247940"/>
<reference key="parent" ref="0"/>
<string key="objectName">Shared User Defaults Controller</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">195</int>
<reference key="object" ref="585207994"/>
<reference key="parent" ref="106797704"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">196</int>
<reference key="object" ref="459311738"/>
<reference key="parent" ref="243166556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">197</int>
<reference key="object" ref="210496674"/>
<array class="NSMutableArray" key="children">
<reference ref="349881374"/>
</array>
<reference key="parent" ref="406651496"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">198</int>
<reference key="object" ref="349881374"/>
<reference key="parent" ref="210496674"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">199</int>
<reference key="object" ref="668135433"/>
<array class="NSMutableArray" key="children">
<reference ref="652841544"/>
</array>
<reference key="parent" ref="406651496"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">200</int>
<reference key="object" ref="652841544"/>
<reference key="parent" ref="668135433"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">203</int>
<reference key="object" ref="396547556"/>
<array class="NSMutableArray" key="children">
<reference ref="444378913"/>
</array>
<reference key="parent" ref="406651496"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">204</int>
<reference key="object" ref="444378913"/>
<reference key="parent" ref="396547556"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">205</int>
<reference key="object" ref="998910824"/>
<array class="NSMutableArray" key="children">
<reference ref="336402003"/>
</array>
<reference key="parent" ref="406651496"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">206</int>
<reference key="object" ref="336402003"/>
<reference key="parent" ref="998910824"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="-3.ImportedFromIB2"/>
<string key="124.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="124.ImportedFromIB2"/>
<string key="126.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="126.ImportedFromIB2"/>
<string key="127.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="127.ImportedFromIB2"/>
<string key="128.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="128.ImportedFromIB2"/>
<string key="144.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="144.ImportedFromIB2"/>
<string key="195.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="196.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="197.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="198.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary" key="199.IBAttributePlaceholdersKey">
<string key="NS.key.0">ToolTip</string>
<object class="IBToolTipAttribute" key="NS.object.0">
<string key="name">ToolTip</string>
<reference key="object" ref="668135433"/>
<string key="toolTip">Setting the teletype volume individually does not work with Mac OS X 10.4. With “Tiger”, please use the system volume settings.</string>
</object>
</object>
<string key="199.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<dictionary class="NSMutableDictionary" key="200.IBAttributePlaceholdersKey"/>
<string key="200.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="203.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="204.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="205.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="206.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="46.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="46.ImportedFromIB2"/>
<string key="5.IBEditorWindowLastContentRect">{{74, 577}, {500, 135}}</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBWindowTemplateEditedContentRect">{{74, 577}, {500, 135}}</string>
<boolean value="YES" key="5.ImportedFromIB2"/>
<boolean value="YES" key="5.windowTemplate.hasMinSize"/>
<string key="5.windowTemplate.minSize">{213, 107}</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="6.ImportedFromIB2"/>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">239</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ASR33Preferences</string>
<string key="superclassName">NSPreferencePane</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">ASR33Preferences/ASR33Preferences.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">ASR33Preferences</string>
<string key="superclassName">NSPreferencePane</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FirstResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Categories/NSControl+FileDrop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSPreferencePane</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</array>
<array class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">PluginFramework.framework/Headers/NSControl+FileDrop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSPreferencePane</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="_firstKeyView">NSView</string>
<string key="_initialKeyView">NSView</string>
<string key="_lastKeyView">NSView</string>
<string key="_window">NSWindow</string>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">PreferencePanes.framework/Headers/NSPreferencePane.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1050" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1040" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../../pdp8e-simulator.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>

Binary file not shown.

View File

@ -0,0 +1,26 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* InfoPlist.strings - Localized strings for CPU preference pane Info.plist
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
NSPrefPaneIconLabel = "ASR 33";
PrefPaneWindowTitle = "ASR 33 Teletype Preferences";

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* Info.plist - ASR 33 Teletype preferences property list
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>de.bernhard-baehr.pdp8e.ASR33Preferences</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.2</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<key>NSMainNibFile</key>
<string>ASR33Preferences</string>
<key>NSPrefPaneIconFile</key>
<string>asr33PrefIcon.jpg</string>
<key>NSPrefPaneIconLabel</key>
<string>ASR 33</string>
<key>NSPrincipalClass</key>
<string>ASR33Preferences</string>
<key>OrderInPreferencesPanelToolbar</key>
<string>10</string>
<key>PrefPaneWindowTitle</key>
<string>ASR 33 Teletype Preferences</string>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,37 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* CPUPreferences.h - CPU Preferences Pane
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define CPU_PREFS_EAE_KEY @"KE8E"
#define CPU_PREFS_KM8E_KEY @"KM8E"
#define CPU_PREFS_TIMESHARING_KEY @"KM8ETimesharing"
#define CPU_PREFS_MEMORYSIZE_KEY @"MemorySize"
@interface CPUPreferences : NSPreferencePane
{
}
- (IBAction) km8eClick:(id)sender;
@end

View File

@ -0,0 +1,43 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* CPUPreferences.m - CPU Preferences Pane
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <PreferencePanes/PreferencePanes.h>
#import "CPUPreferences.h"
@implementation CPUPreferences
// the rest is done via bindings and NSUserDefaultsController
- (IBAction) km8eClick:(id)sender;
{
[[NSUserDefaults standardUserDefaults] setInteger:
([sender state] == NSOnState) ? 020000 : 010000 forKey:CPU_PREFS_MEMORYSIZE_KEY];
}
@end

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,34 @@
{
IBClasses = (
{
ACTIONS = {
eaeClick = id;
km8eClick = id;
memSizeClick = id;
timeSharingOptionClick = id;
};
CLASS = CPUPreferences;
LANGUAGE = ObjC;
OUTLETS = {
eaeCheckbox = NSButton;
km8eCheckbox = NSButton;
memSizeRadiobuttons = NSMatrix;
timeSharingOptionCheckbox = NSButton;
};
SUPERCLASS = NSPreferencePane;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = NSView;
"_initialKeyView" = NSView;
"_lastKeyView" = NSView;
"_window" = NSWindow;
};
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>135 64 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>443.0</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8I1119</string>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1,26 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* InfoPlist.strings - Localized strings for CPU preference pane Info.plist
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
NSPrefPaneIconLabel = "CPU";
PrefPaneWindowTitle = "PDP-8/E CPU Preferences";

34
CPUPreferences/Info.plist Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>de.bernhard-baehr.pdp8e.CPUPreferences</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.2</string>
<key>NSMainNibFile</key>
<string>CPUPreferences</string>
<key>NSPrefPaneIconFile</key>
<string>cpuPrefIcon.jpg</string>
<key>NSPrefPaneIconLabel</key>
<string>CPU</string>
<key>NSPrincipalClass</key>
<string>CPUPreferences</string>
<key>OrderInPreferencesPanelToolbar</key>
<string>02</string>
<key>PrefPaneWindowTitle</key>
<string>PDP-8/E CPU Preferences</string>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,44 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* CPUMemoryViewController.h - Controller for CPU window memory view
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class BreakpointArray, PDP8, CPUMemoryTableView;
@interface CPUMemoryViewController : NSObject
{
@private
IBOutlet CPUMemoryTableView *memoryView;
IBOutlet BreakpointArray *breakpoints;
IBOutlet BreakpointArray *breakopcodes;
IBOutlet PDP8 *pdp8;
BOOL ignoreUpdateMemoryNotification;
BOOL ignorePCChangedNotification;
NSRange visibleMemoryRange;
unsigned pcDefaultRow;
}
- (IBAction) handleContextMenu:(id)sender;
- (NSString *) operandInfoAtAddress:(int)addr; // private delegate method, declared here to avoid warning
@end

View File

@ -0,0 +1,654 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* CPUMemoryViewController.m - Controller for the CPU window memory view
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h> // for Help Manger functions
#import "CPUMemoryViewController.h"
#import "PDP8.h"
#import "Opcode.h"
#import "Breakpoint.h"
#import "BreakpointArray.h"
#import "NSTableView+Scrolling.h"
#import "NonWrappingTableView.h"
#import "OpcodeFormatter.h"
#import "Disassembler.h"
#import "Unicode.h"
#import "Utilities.h"
#define PC_ARROW_BLUE_IMAGE @"pcArrowBlue"
#define PC_ARROW_GRAPHITE_IMAGE @"pcArrowGraphite"
#define PC_ARROW_DRAG_TYPE @"pcArrowDragType"
#define UPDATE_MEMORY_NOTIFICATION @"UpdateMemoryNotification"
#define PC_DEFAULT_ROW_PREFS_KEY @"DefaultPCRow"
#define PC_DEFAULT_ROW 10
#define PC_COLUMN 0
#define PC_COLUMN_STR @"0"
#define BP_COLUMN 1
#define ADDR_COLUMN 2
#define WORD_COLUMN 3
#define OPCODE_COLUMN 4
#define CONTEXTMENU_SET_BREAKPOINT 0
#define CONTEXTMENU_SET_BREAKOPCODE 1
#define CONTEXTMENU_SET_SYSTEM_BREAKOPCODE 2
#define CONTEXTMENU_SET_USER_BREAKOPCODE 3
#define CONTEXTMENU_SET_PC 4
#define CONTEXTMENU_GO_AND_STOP_HERE 5
#define CONTEXTMENU_TRACE_AND_STOP_HERE 6
#define CONTEXTMENU_SCROLL_TO_PC 7
#define CONTEXTMENU_SET_DEFAULT_PC_ROW 8
@interface CPUMemoryTableView : NonWrappingTableView <OpcodeFormatterAddressGetter>
{
}
@end
@implementation CPUMemoryTableView
- (BOOL) canDragRowsWithIndexes:(NSIndexSet *)rows atPoint:(NSPoint)mouseDownPoint
{
// allow drag only for current PC row to avoid minor screen flicker with the clicked cell with Yosemite
return [rows count] == 1 && [[self delegate] tableView:self
objectValueForTableColumn:[self tableColumnWithIdentifier:PC_COLUMN_STR] row:[rows firstIndex]]
!= nil;
}
- (NSImage *) dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns
event:(NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset
{
return [NSImage imageNamed:[NSColor currentControlTint] == NSGraphiteControlTint ?
PC_ARROW_GRAPHITE_IMAGE : PC_ARROW_BLUE_IMAGE];
}
- (NSMenu *) menuForEvent:(NSEvent *)event
{
int row = [self rowAtPoint:[self convertPoint:[event locationInWindow] fromView:nil]];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
return [self menu];
}
- (void) mouseDown:(NSEvent *)event
{
CFStringRef tipContent;
NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
int row = [self rowAtPoint:point];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
// why does [super mouseDown:event] not select the clicked row immediately?
if (([event modifierFlags] & NSShiftKeyMask) && [self columnAtPoint:point] == OPCODE_COLUMN &&
(tipContent = (CFStringRef) [[self delegate] operandInfoAtAddress:row])) {
HMHelpContentRec tip;
tip.version = kMacHelpVersion;
NSRect rect = [self frameOfCellAtColumn:OPCODE_COLUMN row:row];
rect.origin = [[self window] convertBaseToScreen:
[self convertPoint:rect.origin toView:nil]];
float scale = [[self window] userSpaceScaleFactor];
tip.absHotRect.left = rect.origin.x / scale + 33;
tip.absHotRect.right = (rect.origin.x + rect.size.width) / scale;
tip.absHotRect.top =
([[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.origin.y) / scale;
tip.absHotRect.bottom = tip.absHotRect.top + rect.size.height / scale;
tip.tagSide = kHMOutsideBottomLeftAligned;
tip.content[0].contentType = tip.content[1].contentType = kHMCFStringContent;
tip.content[0].u.tagCFString = tip.content[1].u.tagCFString = tipContent;
HMDisplayTag (&tip);
}
[super mouseDown:event];
HMHideTag ();
}
- (void) selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend
{
if ((int) [indexes firstIndex] != [self selectedRow])
HMHideTag ();
[super selectRowIndexes:indexes byExtendingSelection:extend];
}
- (int) getCurrentAddress // OpcodeFormatterAddressGetter protocol
{
return [self selectedRow];
}
@end
@implementation CPUMemoryViewController
- (void) setYosemiteTitleKerning:(NSCell *)cell
{
// otherwise, the title of the PC and BP columns is clipped
// (capitals are longer with Helvetica Neue than with Lucida Grande
if (runningOnYosemiteOrNewer()) {
double kern = 0.4;
if (runningOnElCapitanOrNewer())
kern = -0.5;
[cell setTitle:[[[NSAttributedString alloc] initWithString:[cell title] attributes:
[NSDictionary dictionaryWithObject:[NSNumber numberWithDouble:kern] forKey:NSKernAttributeName]]
autorelease]];
}
}
- (void) awakeFromNib
{
NSSize size;
NSFont *font = [NSFont userFixedPitchFontOfSize:11];
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[self setYosemiteTitleKerning:[[[memoryView tableColumns] objectAtIndex:PC_COLUMN] headerCell]];
[self setYosemiteTitleKerning:[[[memoryView tableColumns] objectAtIndex:BP_COLUMN] headerCell]];
adjustTableHeaderForElCapitan (memoryView);
size.width = 1;
size.height = [memoryView rowHeight] + 2;
[[memoryView window] setResizeIncrements:size];
[[[[memoryView tableColumns] objectAtIndex:ADDR_COLUMN] dataCell] setFont:font];
[[[[memoryView tableColumns] objectAtIndex:WORD_COLUMN] dataCell] setFont:font];
[[[[memoryView tableColumns] objectAtIndex:OPCODE_COLUMN] dataCell] setFont:font];
[[[[memoryView tableColumns] objectAtIndex:OPCODE_COLUMN] dataCell] setFormatter:
[OpcodeFormatter formatterWithPDP8:pdp8 addressGetter:memoryView]];
[memoryView setTarget:self];
[memoryView setDoubleAction:@selector(memoryViewDoubleClick:)];
[memoryView registerForDraggedTypes:[NSArray arrayWithObject:PC_ARROW_DRAG_TYPE]];
pcDefaultRow = [[NSUserDefaults standardUserDefaults] integerForKey:PC_DEFAULT_ROW_PREFS_KEY];
if (pcDefaultRow == 0)
pcDefaultRow = PC_DEFAULT_ROW;
[memoryView scrollRowToTop:0200 + 1 - pcDefaultRow];
// frame changed notification seems not work for the tableview itself
[[memoryView superview] setPostsFrameChangedNotifications:YES];
// save the visible range now to be able to scroll to the correct location after "go"
visibleMemoryRange = [memoryView rowsInRect:[memoryView visibleRect]];
ignoreUpdateMemoryNotification = NO;
ignorePCChangedNotification = NO;
[defaultCenter addObserver:self selector:@selector(notifyMemoryViewSizeChanged:)
name:NSViewFrameDidChangeNotification object:[memoryView superview]];
[defaultCenter addObserver:self selector:@selector(notifyMemoryChanged:)
name:MEMORY_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMemoryChanged:)
name:EAE_MODE_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMemoryChanged:)
name:BREAKPOINTS_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMemoryChanged:)
name:PROGRAM_COUNTER_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMemoryChanged:)
name:DF_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyUpdateMemoryView:)
name:UPDATE_MEMORY_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyGoPDP8:)
name:PDP8_GO_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyStepPDP8:)
name:PDP8_STEP_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyStopPDP8:)
name:PDP8_STOP_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyPCChanged:)
name:PROGRAM_COUNTER_CHANGED_NOTIFICATION object:nil];
if (runningOnYosemiteOrNewer()) {
[defaultCenter addObserver:self selector:@selector(notifyMainOrKeyWindowChanged:)
name:NSWindowDidBecomeMainNotification object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMainOrKeyWindowChanged:)
name:NSWindowDidResignMainNotification object:nil];
} else {
[defaultCenter addObserver:self selector:@selector(notifyMainOrKeyWindowChanged:)
name:NSWindowDidBecomeKeyNotification object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMainOrKeyWindowChanged:)
name:NSWindowDidResignKeyNotification object:nil];
}
}
- (void) updateVisibleMemoryRange
{
// save the visible range now to be able to scroll to the correct location after "go"
// calculate number of rows manually because otherwise it is one to large when the view is not exactly aligned
// see also [MemoryInspectorController visibleRange] and [NSTableView(Scrolling) scrollRowToTop:]
NSRect rect = [memoryView visibleRect];
if (rect.size.height > 0) { // zero immediately after "Stop" when the window is not yet enlarged
if (runningOnElCapitanOrNewer())
rect.origin.y += [memoryView rectOfRow:0].size.height;
unsigned pixelPerRow = (unsigned) ([memoryView rowHeight] + [memoryView intercellSpacing].height);
visibleMemoryRange.location = [memoryView rowsInRect:rect].location;
visibleMemoryRange.length = rect.size.height / pixelPerRow;
}
}
- (BOOL) tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)column row:(int)row
{
return 0 <= row && row < [pdp8 memorySize];
}
- (BOOL) tableView:(NSTableView *)tableView shouldSelectRow:(int)row
{
return YES;
}
- (void) scrollToPC
{
[self updateVisibleMemoryRange];
[memoryView scrollRowToTop:max(0, min((int) (PDP8_MEMSIZE - visibleMemoryRange.length),
(int) ([pdp8 getProgramCounter] - pcDefaultRow + 1)))];
}
- (BOOL) tableView:(NSTableView *)tableView shouldSelectTableColumn:(NSTableColumn *)column
{
if ([[column identifier] intValue] == PC_COLUMN)
[self scrollToPC];
return NO;
}
- (BOOL) tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rows
toPasteboard:(NSPasteboard *)pboard
{
if ([rows count] != 1 || [rows firstIndex] != [pdp8 getProgramCounter])
return NO;
[pboard declareTypes:[NSArray arrayWithObject:PC_ARROW_DRAG_TYPE] owner:nil];
return YES;
}
- (NSDragOperation) tableView:(NSTableView *)tableView validateDrop:(id <NSDraggingInfo>)info
proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)operation
{
return operation == NSTableViewDropOn ? NSDragOperationPrivate : NSDragOperationNone;
}
- (BOOL) tableView:(NSTableView *)tableView acceptDrop:(id <NSDraggingInfo>)info
row:(int)row dropOperation:(NSTableViewDropOperation)operation
{
if ((row > 07777) & ! [pdp8 hasKM8E])
return NO;
[pdp8 setProgramCounter:row];
return YES;
}
- (int) numberOfRowsInTableView:(NSTableView *)tableView
{
return PDP8_MEMSIZE;
}
- (id) tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)column row:(int)row
{
switch ([[column identifier] intValue]) {
case PC_COLUMN :
if (row == [pdp8 getProgramCounter])
return [NSImage imageNamed:([NSColor currentControlTint] == NSBlueControlTint)
&& (runningOnYosemiteOrNewer() ?
[[tableView window] isMainWindow] : [[tableView window] isKeyWindow]) ?
PC_ARROW_BLUE_IMAGE : PC_ARROW_GRAPHITE_IMAGE];
break;
case BP_COLUMN :
if ([breakpoints valueForIdentifier:row])
return [NSImage imageNamed:@"breakpoint"];
switch ([breakopcodes valueForIdentifier:[pdp8 memoryAt:row]]) {
case BREAKOPCODE :
return [NSImage imageNamed:@"breakOpcode"];
case USERMODE_BREAKOPCODE :
return [NSImage imageNamed:@"breakOpcodeU"];
case SYSTEMMODE_BREAKOPCODE :
return [NSImage imageNamed:@"breakOpcodeS"];
}
break;
case ADDR_COLUMN :
if ((row & 007770) == 000010) { // autoincrement locations are underlined
NSMutableParagraphStyle *style =
[[[NSMutableParagraphStyle alloc] init] autorelease];
[style setAlignment:NSCenterTextAlignment];
return [[[NSAttributedString alloc]
initWithString:[NSString stringWithFormat:@"%5.5o", row]
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:NSSingleUnderlineStyle],
NSUnderlineStyleAttributeName,
style, NSParagraphStyleAttributeName,
nil]] autorelease];
}
return [NSString stringWithFormat:@"%5.5o", row];
case WORD_COLUMN :
return [NSString stringWithFormat:@"%4.4o", [pdp8 memoryAt:row]];
case OPCODE_COLUMN :
return [Opcode opcodeWithAddress:row value:[pdp8 memoryAt:row]];
}
return nil;
}
- (NSString *) tableView:(NSTableView *)tableView toolTipForCell:(NSCell *)cell
rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)column row:(int)row
mouseLocation:(NSPoint)mouseLocation
{
switch ([[column identifier] intValue]) {
case PC_COLUMN :
return NSLocalizedString(
@"In this column, an arrow indicates the PDP-8/E program counter.\n\n"
"Drag the arrow or double-click a location to modify the program counter.\n\n"
"Click the column header to scroll to the current program counter location.", @"");
case BP_COLUMN :
return NSLocalizedString(@"This column shows breakpoints with a red dot. "
"Break opcodes are indicated with a yellow dot. "
"A small " UNICODE_LEFT_DOUBLEQUOTE_UTF8 "s" UNICODE_RIGHT_DOUBLEQUOTE_UTF8 " or "
UNICODE_LEFT_DOUBLEQUOTE_UTF8 "u" UNICODE_RIGHT_DOUBLEQUOTE_UTF8 " in the dot "
"indicate system or user mode break opcodes.\n\n"
"Double-click sets or clears a breakpoint.\n\n"
"Option-double-click and command-option-double-click toogles break opcodes.", @"");
case ADDR_COLUMN :
return NSLocalizedString(@"This column displays the memory adresses. "
"Adresses of autoincrement memory locations are underlined.", @"");
case WORD_COLUMN :
return NSLocalizedString(@"This column displays the octal memory content.", @"");
case OPCODE_COLUMN :
return NSLocalizedString(@"This column displays the disassembled PDP-8 instruction.\n\n"
"Shift-click to view the operands of MRIs.", @"");
}
return nil;
}
- (void) tableView:(NSTableView *)tableView setObjectValue:(Opcode *)opcode
forTableColumn:(NSTableColumn *)column row:(int)row
{
// why do we get this setObjectValue message for read-only cells?
if (row < [pdp8 memorySize]) {
ignoreUpdateMemoryNotification = YES;
[pdp8 setMemoryAtAddress:row toValue:[opcode word0]];
if ([opcode word1] >= 0)
[pdp8 setMemoryAtNextAddress:row toValue:[opcode word1]];
}
}
- (BOOL) control:(NSControl *)control didFailToFormatString:(NSString *)string
errorDescription:(NSString *)error
{
NSRange range;
NSScanner *scanner = [NSScanner scannerWithString:error];
NSAlert *alert = [[NSAlert alloc] init];
[scanner scanInt:(signed *) &range.location];
range.length = [string length] - range.location;
[[control currentEditor] setSelectedRange:range];
[alert setMessageText:[error substringFromIndex:[scanner scanLocation] + 1]];
[alert beginSheetModalForWindow:[control window]
modalDelegate:nil didEndSelector:nil contextInfo:nil];
[alert release];
return NO;
}
- (BOOL) control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
if (command == @selector(cancelOperation:)) {
// ESC aborts editing of the current cell
[control abortEditing];
return YES;
}
return NO;
}
- (void) memoryViewDoubleClick:(id)sender
{
unsigned modifiers;
int row = [sender clickedRow];
if (row < 0 || [pdp8 isRunning])
return;
switch ([sender clickedColumn]) {
case PC_COLUMN :
if ([pdp8 hasKM8E] || row < 010000)
[pdp8 setProgramCounter:row];
break;
case BP_COLUMN :
case ADDR_COLUMN :
modifiers = [[NSApp currentEvent] modifierFlags];
if (modifiers & NSAlternateKeyMask) {
unsigned opcode = [pdp8 memoryAt:row];
unsigned value = [breakopcodes valueForIdentifier:opcode];
if (modifiers & NSCommandKeyMask)
value = (value + BREAKOPCODE) & BREAKOPCODE;
else
value = value ? 0 : BREAKOPCODE;
[breakopcodes setBreakpointWithIdentifier:opcode value:value];
} else
[breakpoints setBreakpointWithIdentifier:row
value:[breakpoints valueForIdentifier:row] ? 0 : BREAKPOINT];
[sender reloadData];
break;
case WORD_COLUMN :
break;
case OPCODE_COLUMN :
// with Leopard, this is required, don't know why: for editable cells, the
// double action should not be called, but the editing should start automatically
// (NSTableView documentation)
if (row < [pdp8 memorySize])
[sender editColumn:OPCODE_COLUMN row:row withEvent:nil select:YES];
break;
}
}
- (BOOL) validateMenuItem:(NSMenuItem *)menuItem
{
if ([pdp8 isRunning])
return FALSE;
int row = [memoryView selectedRow];
unsigned breakop = [breakopcodes valueForIdentifier:[pdp8 memoryAt:row]];
switch ([menuItem tag]) {
case CONTEXTMENU_SET_BREAKPOINT :
[menuItem setTitle:[breakpoints valueForIdentifier:row] ?
NSLocalizedString(@"Clear Breakpoint", @"") :
NSLocalizedString(@"Set Breakpoint", @"")];
return TRUE;
case CONTEXTMENU_SET_BREAKOPCODE :
[menuItem setTitle:breakop == BREAKOPCODE ?
NSLocalizedString(@"Clear Break Opcode", @"") :
NSLocalizedString(@"Set Break Opcode", @"")];
return breakop == BREAKOPCODE || breakop == 0;
case CONTEXTMENU_SET_SYSTEM_BREAKOPCODE :
[menuItem setTitle:(breakop & SYSTEMMODE_BREAKOPCODE) ?
NSLocalizedString(@"Clear System Mode Break Opcode", @"") :
NSLocalizedString(@"Set System Mode Break Opcode", @"")];
return TRUE;
case CONTEXTMENU_SET_USER_BREAKOPCODE :
[menuItem setTitle:(breakop & USERMODE_BREAKOPCODE) ?
NSLocalizedString(@"Clear User Mode Break Opcode", @"") :
NSLocalizedString(@"Set User Mode Break Opcode", @"")];
return TRUE;
case CONTEXTMENU_SET_PC :
case CONTEXTMENU_GO_AND_STOP_HERE :
case CONTEXTMENU_TRACE_AND_STOP_HERE :
return row < 010000 || [pdp8 hasKM8E];
case CONTEXTMENU_SCROLL_TO_PC :
case CONTEXTMENU_SET_DEFAULT_PC_ROW :
return TRUE;
}
return FALSE;
}
- (IBAction) handleContextMenu:(id)sender
{
int row = [memoryView selectedRow];
unsigned opcode = [pdp8 memoryAt:row];
unsigned breakop = [breakopcodes valueForIdentifier:opcode];
switch ([sender tag]) {
case CONTEXTMENU_SET_BREAKPOINT :
[breakpoints setBreakpointWithIdentifier:row
value:[breakpoints valueForIdentifier:row] ? 0 : BREAKPOINT];
break;
case CONTEXTMENU_SET_BREAKOPCODE :
[breakopcodes setBreakpointWithIdentifier:opcode value:breakop ? 0 : BREAKOPCODE];
break;
case CONTEXTMENU_SET_SYSTEM_BREAKOPCODE :
[breakopcodes setBreakpointWithIdentifier:opcode value:breakop ^ SYSTEMMODE_BREAKOPCODE];
break;
case CONTEXTMENU_SET_USER_BREAKOPCODE :
[breakopcodes setBreakpointWithIdentifier:opcode value:breakop ^ USERMODE_BREAKOPCODE];
break;
case CONTEXTMENU_SET_PC :
if ([pdp8 hasKM8E] || row < 010000)
[pdp8 setProgramCounter:row];
break;
case CONTEXTMENU_GO_AND_STOP_HERE :
[pdp8 go:row];
break;
case CONTEXTMENU_TRACE_AND_STOP_HERE :
[pdp8 trace:row];
break;
case CONTEXTMENU_SCROLL_TO_PC :
[self scrollToPC];
break;
case CONTEXTMENU_SET_DEFAULT_PC_ROW :
[self updateVisibleMemoryRange];
pcDefaultRow = row - visibleMemoryRange.location + 1;
[[NSUserDefaults standardUserDefaults] setInteger:pcDefaultRow
forKey:PC_DEFAULT_ROW_PREFS_KEY];
[self scrollToPC];
break;
}
}
- (NSString *) operandInfoAtAddress:(int)addr
{
return [[Disassembler sharedDisassembler] operandInfoForPDP8:pdp8 atAddress:addr];
}
#pragma mark Notifications
- (void) notifyMainOrKeyWindowChanged:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyMainOrKeyWindowChanged");
if ([[notification object] isEqual:[memoryView window]])
[memoryView setNeedsDisplayInRect:
[memoryView frameOfCellAtColumn:PC_COLUMN row:[pdp8 getProgramCounter]]];
}
- (void) notifyMemoryViewSizeChanged:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyMemoryViewSizeChanged");
[self updateVisibleMemoryRange];
if (visibleMemoryRange.length < pcDefaultRow) {
pcDefaultRow = PC_DEFAULT_ROW;
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PC_DEFAULT_ROW_PREFS_KEY];
}
}
- (void) notifyMemoryChanged:(NSNotification *)notification
{
/* coalesc the multiple MEMORY_CHANGED_NOTIFICATIONS (caused by the different register update
notifications) to one UPDATE_MEMORY_NOTIFICATION to avoid time consuming repeated memory
view updates */
// NSLog (@"CPUMemoryViewController notifyMemoryChanged");
[[NSNotificationQueue defaultQueue] enqueueNotification:
[NSNotification notificationWithName:UPDATE_MEMORY_NOTIFICATION object:self]
postingStyle:NSPostASAP coalesceMask:NSNotificationCoalescingOnName forModes:nil];
}
- (void) notifyUpdateMemoryView:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyUpdateMemoryView ign=%d", ignoreUpdateMemoryNotification);
if (ignoreUpdateMemoryNotification)
ignoreUpdateMemoryNotification = NO;
else
[memoryView reloadData];
}
- (void) notifyGoPDP8:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyGoPDP8");
[self updateVisibleMemoryRange];
}
- (void) notifyStepPDP8:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyStepPDP8");
[self updateVisibleMemoryRange];
unsigned pc = [pdp8 getProgramCounter];
if (visibleMemoryRange.location + visibleMemoryRange.length == pc)
[memoryView scrollRowToVisible:pc];
else if (pc < visibleMemoryRange.location || visibleMemoryRange.location + visibleMemoryRange.length <= pc)
[memoryView scrollRowToTop:
max(0, min((int) (PDP8_MEMSIZE - visibleMemoryRange.length), (int) (pc - pcDefaultRow + 1)))];
[memoryView reloadData];
ignoreUpdateMemoryNotification = YES;
ignorePCChangedNotification = YES;
}
- (void) notifyStopPDP8:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyStopPDP8");
[self updateVisibleMemoryRange];
unsigned pc = [pdp8 getProgramCounter];
if (pc < visibleMemoryRange.location || visibleMemoryRange.location + visibleMemoryRange.length <= pc)
[memoryView scrollRowToTop:
max(0, min((int) (PDP8_MEMSIZE - visibleMemoryRange.length), (int) (pc - pcDefaultRow + 1)))];
ignorePCChangedNotification = YES;
}
- (void) notifyPCChanged:(NSNotification *)notification
{
// NSLog (@"CPUMemoryViewController notifyPCChanged %d", ignorePCChangedNotification);
if (ignorePCChangedNotification) {
ignorePCChangedNotification = NO;
return;
}
[self updateVisibleMemoryRange];
unsigned pc = [pdp8 getProgramCounter];
if (pc < visibleMemoryRange.location || visibleMemoryRange.location + visibleMemoryRange.length <= pc)
[memoryView scrollRowToTop:
max(0, min((int) (PDP8_MEMSIZE - visibleMemoryRange.length), (int) (pc - pcDefaultRow + 1)))];
}
@end

View File

@ -0,0 +1,60 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* CPUWindowController.h - Controller for the CPU window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class RegisterFormCell, EnableDisableTextField, PDP8;
@interface CPUWindowController : NSObject
{
@private
IBOutlet NSWindow *window;
IBOutlet RegisterFormCell *sr;
IBOutlet RegisterFormCell *l;
IBOutlet RegisterFormCell *ac;
IBOutlet RegisterFormCell *pc;
IBOutlet RegisterFormCell *sc;
IBOutlet RegisterFormCell *gtf;
IBOutlet RegisterFormCell *mq;
IBOutlet EnableDisableTextField *mode;
IBOutlet NSButton *a;
IBOutlet NSButton *b;
IBOutlet RegisterFormCell *df;
IBOutlet RegisterFormCell *_if;
IBOutlet RegisterFormCell *ib;
IBOutlet RegisterFormCell *uf;
IBOutlet RegisterFormCell *ub;
IBOutlet RegisterFormCell *sf;
IBOutlet NSButton *enable;
IBOutlet NSButton *delay;
IBOutlet NSButton *inhibit;
IBOutlet PDP8 *pdp8;
float normalContentHeight;
}
- (IBAction) eaeModeButtonClick:(id)sender;
- (IBAction) enableCheckboxClicked:(id)sender;
- (IBAction) delayCheckboxClicked:(id)sender;
- (IBAction) inhibitCheckboxClicked:(id)sender;
@end

View File

@ -0,0 +1,461 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* CPUWindowController.m - Controller for the CPU window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "CPUWindowController.h"
#import "MainController.h"
#import "PDP8.h"
#import "RegisterFormCell.h"
#import "GeneralPreferences.h"
#import "Unicode.h"
@implementation CPUWindowController
#define STOP_TOOLBAR_ITEM_IDENTIFIER @"stopTBItemIdentifier"
#define GO_TOOLBAR_ITEM_IDENTIFIER @"goTBItemIdentifier"
#define TRACE_TOOLBAR_ITEM_IDENTIFIER @"traceTBItemIdentifier"
#define STEP_TOOLBAR_ITEM_IDENTIFIER @"stepTBItemIdentifier"
#define BREAKPOINT_TOOLBAR_ITEM_IDENTIFIER @"breakpointTBItemIdentifier"
#define BOOTSTRAP_TOOLBAR_ITEM_IDENTIFIER @"bootstrapTBItemIdentifier"
#define RESET_TOOLBAR_ITEM_IDENTIFIER @"resetTBItemIdentifier"
#define MEMORYINSPECTOR_TOOLBAR_ITEM_IDENTIFIER @"memoryInspectorTBItemIdentifier"
#define RESIZE_WINDOW_ON_PDP8STOP_NOTIFICATION @"cpuwindowResizeOnPDP8StopNotification"
#define RESIZE_WINDOW_ON_PDP8GO_NOTIFICATION @"cpuwindowResizeOnPDP8GoNotification"
#pragma mark Toolbar
- (void) setupToolbar
{
NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier:@"CPUWindowToolbar"] autorelease];
[toolbar setAllowsUserCustomization:YES];
[toolbar setAutosavesConfiguration:YES];
[toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];
[toolbar setSizeMode:NSToolbarSizeModeSmall];
[toolbar setDelegate:self];
[window setToolbar:toolbar];
[window setShowsToolbarButton:YES];
}
- (NSToolbarItem *) toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdent
willBeInsertedIntoToolbar:(BOOL) willBeInserted
{
NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc]
initWithItemIdentifier:itemIdent] autorelease];
if ([itemIdent isEqual:STOP_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Stop", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Stop", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Stops the running PDP-8/E", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"stopToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(stop:)];
} else if ([itemIdent isEqual:GO_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Go", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Go", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Starts the simulated PDP-8/E to run continuously", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"goToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(go:)];
} else if ([itemIdent isEqual:TRACE_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Trace", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Trace", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Starts the simulated PDP-8/E to run in trace mode", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"traceToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(trace:)];
} else if ([itemIdent isEqual:STEP_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Step", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Step", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Executes a single PDP-8/E instruction", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"stepToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(step:)];
} else if ([itemIdent isEqual:BREAKPOINT_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Breakpoints", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Breakpoints", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Shows or hides the Breakpoints & Break Opcodes Panel", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"breakpointsToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(showHideBreakpointPanel:)];
} else if ([itemIdent isEqual:BOOTSTRAP_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Bootstrap Loader", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Bootstrap Loader", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Shows or hides the Bootstrap Loader Panel", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"bootstrapToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(showHideBootstrapPanel:)];
} else if ([itemIdent isEqual:RESET_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Reset", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Reset", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Resets registers and memory of the PDP-8/E", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"resetToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(reset:)];
} else if ([itemIdent isEqual:MEMORYINSPECTOR_TOOLBAR_ITEM_IDENTIFIER]) {
[toolbarItem setLabel:NSLocalizedString(@"Memory Inspector", @"")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Memory Inspector", @"")];
[toolbarItem setToolTip:NSLocalizedString(
@"Shows or hides the memory inspector drawer", @"")];
[toolbarItem setImage:[NSImage imageNamed:@"memoryInspectorToolbarIcon"]];
[toolbarItem setTarget:[NSApp delegate]];
[toolbarItem setAction:@selector(toggleMemoryInspectorDrawer:)];
} else
toolbarItem = nil;
return toolbarItem;
}
- (NSArray *) toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObjects:
NSToolbarFlexibleSpaceItemIdentifier,
RESET_TOOLBAR_ITEM_IDENTIFIER,
NSToolbarSpaceItemIdentifier,
BREAKPOINT_TOOLBAR_ITEM_IDENTIFIER, BOOTSTRAP_TOOLBAR_ITEM_IDENTIFIER,
NSToolbarSpaceItemIdentifier,
STOP_TOOLBAR_ITEM_IDENTIFIER, STEP_TOOLBAR_ITEM_IDENTIFIER,
TRACE_TOOLBAR_ITEM_IDENTIFIER, GO_TOOLBAR_ITEM_IDENTIFIER,
NSToolbarSpaceItemIdentifier,
MEMORYINSPECTOR_TOOLBAR_ITEM_IDENTIFIER,
nil];
}
- (NSArray *) toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObjects:
STOP_TOOLBAR_ITEM_IDENTIFIER, STEP_TOOLBAR_ITEM_IDENTIFIER,
TRACE_TOOLBAR_ITEM_IDENTIFIER, GO_TOOLBAR_ITEM_IDENTIFIER,
BREAKPOINT_TOOLBAR_ITEM_IDENTIFIER, BOOTSTRAP_TOOLBAR_ITEM_IDENTIFIER,
MEMORYINSPECTOR_TOOLBAR_ITEM_IDENTIFIER, RESET_TOOLBAR_ITEM_IDENTIFIER,
NSToolbarCustomizeToolbarItemIdentifier, NSToolbarSeparatorItemIdentifier,
NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier,
nil];
}
#pragma mark Notifications
- (void) setupNotifications
{
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self
selector:@selector(notifyResizeWindowOnPDP8Stop:)
name:RESIZE_WINDOW_ON_PDP8STOP_NOTIFICATION object:nil];
[defaultCenter addObserver:self
selector:@selector(notifyResizeWindowOnPDP8Go:)
name:RESIZE_WINDOW_ON_PDP8GO_NOTIFICATION object:nil];
[defaultCenter addObserver:self
selector:@selector(notifyStopPDP8:) name:PDP8_STOP_NOTIFICATION object:nil];
[defaultCenter addObserver:self
selector:@selector(notifyTracePDP8:) name:PDP8_TRACE_NOTIFICATION object:nil];
[defaultCenter addObserver:self
selector:@selector(notifyGoPDP8:) name:PDP8_GO_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyEnableChanged:)
name:ENABLE_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyDelayChanged:)
name:DELAY_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyInhibitChanged:)
name:INHIBIT_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyEAEModeChanged:)
name:EAE_MODE_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyEAEMount:)
name:EAE_MOUNT_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyKM8EMount:)
name:KM8E_MOUNT_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyPreferencesChanged:)
name:NSUserDefaultsDidChangeNotification object:nil];
[defaultCenter addObserver:self selector:@selector(notifyApplicationWillTerminate:)
name:NSApplicationWillTerminateNotification object:nil];
}
- (void) notifyResizeWindowOnPDP8Stop:(NSNotification *)notification
{
// NSLog (@"CPUWindowController got a notifyResizeWindowOnPDP8Stop notification");
NSRect rect = [window frame];
rect.size.height += normalContentHeight;
rect.origin.y -= normalContentHeight;
normalContentHeight = 0;
[window setFrame:rect display:YES animate:YES];
[window setTitle:NSLocalizedString(@"PDP-8/E CPU", @"")];
[[window contentView] setAutoresizesSubviews:YES];
[[window toolbar] validateVisibleItems];
}
- (void) notifyStopPDP8:(NSNotification *)notification
{
// NSLog (@"CPUWindowController got a STOP PDP8 notification");
// delay the resizing until all GUI elements in the CPU window and other windows are updated
[[NSNotificationQueue defaultQueue] enqueueNotification:
[NSNotification notificationWithName:RESIZE_WINDOW_ON_PDP8STOP_NOTIFICATION object:self]
postingStyle:NSPostWhenIdle]; // don't use NSPostNow or NSPostASAP, that's too fast
}
- (void) setGoWindowTitle
{
NSString *title;
switch ([[NSUserDefaults standardUserDefaults] integerForKey:GENERAL_PREFS_GO_SPEED_KEY]) {
case GO_AS_FAST_AS_POSSIBLE :
title = NSLocalizedString(
@"PDP-8/E CPU " UNICODE_EM_DASH_UTF8 " running as fast as possible", @"");
break;
case GO_WITH_PDP8_SPEED :
title = NSLocalizedString(
@"PDP-8/E CPU " UNICODE_EM_DASH_UTF8 " running with real speed", @"");
break;
case GO_WITH_PDP8_SPEED_PRECISE :
title = NSLocalizedString(
@"PDP-8/E CPU " UNICODE_EM_DASH_UTF8 " running with precise timing", @"");
break;
default :
title = @"";
NSAssert (FALSE, @"Illegal go speed in the preferences");
break;
}
[window setTitle:title];
}
- (void) notifyPreferencesChanged:(NSNotification *)notification
{
if ([pdp8 isGoing])
[self setGoWindowTitle];
}
- (void) notifyResizeWindowOnPDP8Go:(NSNotification *)notification
{
// NSLog (@"CPUWindowController got a notifyResizeWindowOnPDP8Go notification");
NSRect rect = [window frame];
normalContentHeight = [[window contentView] frame].size.height;
rect.origin.y += normalContentHeight;
rect.size.height -= normalContentHeight;
[[window contentView] setAutoresizesSubviews:NO];
[window setFrame:rect display:YES animate:YES];
[self setGoWindowTitle];
[[window toolbar] validateVisibleItems];
}
- (void) notifyGoPDP8:(NSNotification *)notification
{
// NSLog (@"CPUWindowController got a GO PDP8 notification");
// delay the resizing until all GUI elements in the CPU window and other windows are in "Go" mode
// (the memory view needs the old size to remember the visible memory area)
[[NSNotificationQueue defaultQueue] enqueueNotification:
[NSNotification notificationWithName:RESIZE_WINDOW_ON_PDP8GO_NOTIFICATION object:self]
postingStyle:NSPostASAP];
// don't use NSPostNow, that's too fast; don't use NSPostWhenIdle, that's too slow
}
- (void) notifyTracePDP8:(NSNotification *)notification
{
// NSLog (@"CPUWindowController got a TRACE PDP8 notification");
[[window toolbar] validateVisibleItems];
}
- (void) notifyApplicationWillTerminate:(NSNotification *)notification
{
// NSLog (@"CPUWindowController notifyApplicationWillTerminate");
/* When the simulator quits while the PDP-8 is running, the CPU window is shrunk, and this size
is stored in the user defaults. On the next launch, it resizes to the default height at the top
of the screen and not to the last position/size. To avoid that, resize it before quitting. */
if (normalContentHeight) {
[window orderOut:self];
NSRect rect = [window frame];
rect.size.height += normalContentHeight;
rect.origin.y -= normalContentHeight;
normalContentHeight = 0;
[window setFrame:rect display:NO];
[window saveFrameUsingName:[window frameAutosaveName]];
}
}
#pragma mark Delegate Methods
- (NSSize) windowWillResize:(NSWindow *)sender toSize:(NSSize)newSize
{
return normalContentHeight ? [window frame].size : newSize;
}
- (BOOL) windowShouldZoom:(NSWindow *)sender toFrame:(NSRect)newFrame
{
return normalContentHeight ? NO : YES;
}
#pragma mark Registers
- (void) notifyEAEMount:(NSNotification *)notification
{
BOOL hasEAE = [pdp8 hasEAE];
[sc setEnabled:hasEAE];
[gtf setEnabled:hasEAE];
[mode setEnabled:hasEAE];
[a setEnabled:hasEAE];
[b setEnabled:hasEAE];
}
- (IBAction) eaeModeButtonClick:(id)sender
{
[pdp8 setEAEmode:EAE_MODE_A + [sender tag]];
}
- (void) notifyEAEModeChanged:(NSNotification *)notification
{
[a setIntValue:EAE_MODE_B - [pdp8 getEAEmode]];
[b setIntValue:[pdp8 getEAEmode] - EAE_MODE_A];
}
- (void) notifyKM8EMount:(NSNotification *)notification
{
BOOL hasKM8E = [pdp8 hasKM8E];
[df setEnabled:hasKM8E];
[_if setEnabled:hasKM8E];
[ib setEnabled:hasKM8E];
[uf setEnabled:hasKM8E];
[ub setEnabled:hasKM8E];
[sf setEnabled:hasKM8E];
[inhibit setEnabled:hasKM8E];
}
- (IBAction) enableCheckboxClicked:(id)sender
{
[pdp8 setEnable:[sender intValue]];
}
- (void) notifyEnableChanged:(NSNotification *)notification
{
[enable setIntValue:[pdp8 getEnable]];
}
- (IBAction) delayCheckboxClicked:(id)sender;
{
[pdp8 setDelay:[sender intValue]];
}
- (void) notifyDelayChanged:(NSNotification *)notification
{
[delay setIntValue:[pdp8 getDelay]];
}
- (IBAction) inhibitCheckboxClicked:(id)sender;
{
[pdp8 setInhibit:[sender intValue]];
}
- (void) notifyInhibitChanged:(NSNotification *)notification
{
[inhibit setIntValue:[pdp8 getInhibit]];
}
#pragma mark Initialization
- (void) setupRegisters
{
// KK8-E CPU
[sr setupRegisterFor:pdp8 getRegisterValue:@selector(getSR) setRegisterValue:@selector(setSR:)
changedNotificationName:SR_CHANGED_NOTIFICATION mask:07777 base:8];
[l setupRegisterFor:pdp8 getRegisterValue:@selector(getL) setRegisterValue:@selector(setL:)
changedNotificationName:ACCUMULATOR_CHANGED_NOTIFICATION mask:01 base:8];
[ac setupRegisterFor:pdp8 getRegisterValue:@selector(getAC) setRegisterValue:@selector(setAC:)
changedNotificationName:ACCUMULATOR_CHANGED_NOTIFICATION mask:07777 base:8];
[pc setupRegisterFor:pdp8 getRegisterValue:@selector(getPC) setRegisterValue:@selector(setPC:)
changedNotificationName:PROGRAM_COUNTER_CHANGED_NOTIFICATION mask:07777 base:8];
// KE8-E EAE
[sc setupRegisterFor:pdp8 getRegisterValue:@selector(getSC) setRegisterValue:@selector(setSC:)
changedNotificationName:SC_CHANGED_NOTIFICATION mask:037 base:8];
[gtf setupRegisterFor:pdp8 getRegisterValue:@selector(getGTF) setRegisterValue:@selector(setGTF:)
changedNotificationName:GTF_CHANGED_NOTIFICATION mask:01 base:8];
[mq setupRegisterFor:pdp8 getRegisterValue:@selector(getMQ) setRegisterValue:@selector(setMQ:)
changedNotificationName:MQ_CHANGED_NOTIFICATION mask:07777 base:8];
// KM8-E Memory Extension
[df setupRegisterFor:pdp8 getRegisterValue:@selector(getDF) setRegisterValue:@selector(setDF:)
changedNotificationName:DF_CHANGED_NOTIFICATION mask:07 base:8];
[_if setupRegisterFor:pdp8 getRegisterValue:@selector(getIF) setRegisterValue:@selector(setIF:)
changedNotificationName:PROGRAM_COUNTER_CHANGED_NOTIFICATION mask:07 base:8];
[ib setupRegisterFor:pdp8 getRegisterValue:@selector(getIB) setRegisterValue:@selector(setIB:)
changedNotificationName:PROGRAM_COUNTER_CHANGED_NOTIFICATION mask:07 base:8];
[uf setupRegisterFor:pdp8 getRegisterValue:@selector(getUF) setRegisterValue:@selector(setUF:)
changedNotificationName:UF_CHANGED_NOTIFICATION mask:01 base:8];
[ub setupRegisterFor:pdp8 getRegisterValue:@selector(getUB) setRegisterValue:@selector(setUB:)
changedNotificationName:UB_CHANGED_NOTIFICATION mask:01 base:8];
[sf setupRegisterFor:pdp8 getRegisterValue:@selector(getSF) setRegisterValue:@selector(setSF:)
changedNotificationName:SF_CHANGED_NOTIFICATION mask:0177 base:8];
}
- (void) awakeFromNib
{
[self setupToolbar];
[self setupNotifications];
[self setupRegisters];
/* set max width = min width of the panel: IB only allows max width one pixel more
than min width, so the user can resize the width for one pixel - bug in IB? */
NSSize size = [window minSize];
size.height = [window maxSize].height;
[window setMaxSize:size];
}
@end

View File

@ -0,0 +1,42 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* IOFlagController.h - Controller for the I/O flags table view in the CPU window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class PDP8;
@interface IOFlagController : NSObject
{
@private
IBOutlet NSTableView *ioFlagsView;
IBOutlet PDP8 *pdp8;
NSMutableArray *deviceNames;
unsigned long enabledFlags;
}
- (unsigned) numberOfAvailableFlags;
- (unsigned long) addIODevice:(NSString *)name; // returns the I/O mask for the new device or 0 on error
- (void) disableIODevice:(unsigned long)ioflag;
- (void) enableIODevice:(unsigned long)ioflag;
@end

View File

@ -0,0 +1,199 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* IOFlagController.m - Controller for the I/O flags table view in the CPU window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "IOFlagController.h"
#import "PDP8.h"
#define NAME_COLUMN 0
#define IENABLE_COLUMN 1
#define IOFLAG_COLUMN 2
#define USER_MODE_ROW 0
@implementation IOFlagController
- (void) awakeFromNib
{
adjustTableHeaderForElCapitan (ioFlagsView);
deviceNames = [[NSMutableArray alloc] init];
[self addIODevice:NSLocalizedString(@"User Mode", @"")];
[[[[ioFlagsView tableColumns] objectAtIndex:NAME_COLUMN] dataCell]
setFont:[NSFont userFontOfSize:11]];
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self selector:@selector(notifyIOFlagsChanged:)
name:IOFLAGS_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifyKM8EMount:)
name:KM8E_MOUNT_NOTIFICATION object:nil];
/* Under certain contitions, the checkboxes in the I/O column are not activated/deactivated
when the CPU window activates/deactivates. The notifyKeyWindowChanged notification is
a workaround. Maybe a Cocoa bug with 10.4 and 10.5 (it does not appear when the table
control has the 10.5 only hilight style "sourcelist"). */
[defaultCenter addObserver:self selector:@selector(notifyMainWindowChanged:)
name:NSWindowDidResignMainNotification object:nil];
[defaultCenter addObserver:self selector:@selector(notifyMainWindowChanged:)
name:NSWindowDidBecomeMainNotification object:nil];
}
- (void) notifyMainWindowChanged:(NSNotification *)notification
{
if ([[notification object] isEqualTo:[ioFlagsView window]])
[ioFlagsView reloadData];
}
- (void) notifyIOFlagsChanged:(NSNotification *)notification
{
[ioFlagsView reloadData];
}
- (void) notifyKM8EMount:(NSNotification *)notification
{
if ([pdp8 hasKM8E])
[self enableIODevice:userFLAG];
else
[self disableIODevice:userFLAG];
}
- (unsigned) numberOfAvailableFlags
{
return 8 * sizeof(enabledFlags) - [deviceNames count];
}
- (unsigned long) addIODevice:(NSString *)name
{
unsigned long ioflag;
if ([deviceNames count] == 8 * sizeof(enabledFlags))
return 0; // all flags already allocated
[deviceNames addObject:name];
[ioFlagsView noteNumberOfRowsChanged];
ioflag = 1 << ([deviceNames count] - 1);
enabledFlags |= ioflag;
return ioflag;
}
- (void) disableIODevice:(unsigned long)ioflag
{
NSAssert1 ((((1 << [deviceNames count]) - 1) & ioflag) == ioflag, @"Invalid IO flag: %o", ioflag);
enabledFlags &= ~ioflag;
[pdp8 clearInterruptMaskBits:ioflag];
[pdp8 clearIOFlagBits:ioflag];
[ioFlagsView reloadData];
}
- (void) enableIODevice:(unsigned long)ioflag
{
NSAssert1 ((((1 << [deviceNames count]) - 1) & ioflag) == ioflag, @"Invalid IO flag: %o", ioflag);
enabledFlags |= ioflag;
[ioFlagsView reloadData];
}
- (int) numberOfRowsInTableView:(NSTableView *)tableView
{
return [deviceNames count];
}
- (BOOL) tableView:(NSTableView *)tableView shouldSelectRow:(int)row
{
return ((1 << row) & enabledFlags) != 0;
}
- (id) tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)column row:(int)row
{
switch ([[column identifier] intValue]) {
case NAME_COLUMN :
if ((1 << row) & enabledFlags)
return [deviceNames objectAtIndex:row];
// disabled devices are gray
return [[[NSAttributedString alloc] initWithString:[deviceNames objectAtIndex:row]
attributes:[NSDictionary dictionaryWithObject:[NSColor grayColor]
forKey:NSForegroundColorAttributeName]] autorelease];
case IENABLE_COLUMN :
return [NSNumber numberWithBool:[pdp8 getInterruptMaskBits:1 << row] != 0];
case IOFLAG_COLUMN :
return [NSNumber numberWithBool:[pdp8 getIOFlagBits:1 << row] != 0];
}
return nil;
}
- (void) tableView:(NSTableView *)tableView setObjectValue:(id)val
forTableColumn:(NSTableColumn *)column row:(int)row
{
// when the currently selected row becomes deactivated, the user can still click the check boxes
if (((1 << row) & enabledFlags) == 0)
return;
switch ([[column identifier] intValue]) {
case IENABLE_COLUMN :
if (row == USER_MODE_ROW) // can't clear or set this flag manually,
break; // it's set iff the KM8-E is present
if ([val intValue])
[pdp8 setInterruptMaskBits:1 << row];
else
[pdp8 clearInterruptMaskBits:1 << row];
break;
case IOFLAG_COLUMN :
if ([val intValue])
[pdp8 setIOFlagBits:1 << row];
else
[pdp8 clearIOFlagBits:1 << row];
break;
}
}
- (NSString *) tableView:(NSTableView *)tableView toolTipForCell:(NSCell *)cell
rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)column row:(int)row
mouseLocation:(NSPoint)mouseLocation
{
switch ([[column identifier] intValue]) {
case NAME_COLUMN :
break;
case IENABLE_COLUMN :
return NSLocalizedString(@"When the Interrupt Enable Flag is set, the "
@"corresponding device can cause interrupts.", @"");
case IOFLAG_COLUMN :
return NSLocalizedString(@"A device raises its I/O Flag to signal to the CPU "
@"that it has completed an I/O operation.", @"");
}
return nil;
}
@end

View File

@ -0,0 +1,38 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* SkipController.h - Controller for the skip indicator in the CPU window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class TableCornerView, PDP8;
@interface SkipController : NSObject
{
@private
IBOutlet TableCornerView *view;
IBOutlet PDP8 *pdp8;
NSMutableDictionary *dictionary;
}
- (void) addSkiptest:(NSValue *)skiptest forInstruction:(NSValue *)instruction;
@end

174
CPUWindow/SkipController.m Normal file
View File

@ -0,0 +1,174 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* SkipController.h - Controller for the skip indicator in the CPU window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "SkipController.h"
#import "TableCornerView.h"
#import "PDP8.h"
#import "mri.h"
#import "eae.h"
#import "iot.h"
#import "opr.h"
#define UPDATE_SKIPINDICATOR_NOTIFICATION @"updateSkipIndicatorNotification"
#define SKIP_IMAGE_NAME @"skipArrow"
#define INTERRUPT_IMAGE_NAME @"interruptArrow"
// Key Value pair for the skiptest dictionary initialization
#define KV(i, s) [NSValue valueWithPointer:s], [NSValue valueWithPointer:i]
typedef unsigned (*PDP8SkiptestFunctionPointer)(void);
@implementation SkipController
- (void) awakeFromNib
{
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:MEMORY_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:PROGRAM_COUNTER_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:ACCUMULATOR_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:GTF_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:MQ_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:EAE_MODE_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:DF_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:UF_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:ENABLE_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:DELAY_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:INHIBIT_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:IOFLAGS_CHANGED_NOTIFICATION object:nil];
[defaultCenter addObserver:self selector:@selector(notifySkipIndicator:)
name:SF_CHANGED_NOTIFICATION object:nil]; // required for TSC8 ESME
[defaultCenter addObserver:self selector:@selector(notifyUpdateSkipIndicator:)
name:UPDATE_SKIPINDICATOR_NOTIFICATION object:nil];
/* PDP-8 notifications that probably can't change the skip/interrupt indicator:
SR_CHANGED_NOTIFICATION
SC_CHANGED_NOTIFICATION
UB_CHANGED_NOTIFICATION
SF_CHANGED_NOTIFICATION
*/
dictionary = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
/* MRI skip instructions */
KV(i2000, s2000), KV(i2200, s2200), KV(i2400, s2400), KV(i2410, s2410),
KV(i2600, s2600), KV(i2610, s2610),
/* EAE skip instructions */
KV(i7451, s7451),
/* IOT skip instructions */
KV(i6000, s6000), KV(i6003, s6003), KV(i6006, s6006), KV(i6254, s6254),
/* OPR skip instructions */
KV(i7410, s7410), KV(i7412, s7410), KV(i7414, s7410), KV(i7416, s7410),
KV(i7420, s7420), KV(i7422, s7420), KV(i7424, s7420), KV(i7426, s7420),
KV(i7430, s7430), KV(i7432, s7430), KV(i7434, s7430), KV(i7436, s7430),
KV(i7440, s7440), KV(i7442, s7440), KV(i7444, s7440), KV(i7446, s7440),
KV(i7450, s7450), KV(i7452, s7450), KV(i7454, s7450), KV(i7456, s7450),
KV(i7460, s7460), KV(i7462, s7460), KV(i7464, s7460), KV(i7466, s7460),
KV(i7470, s7470), KV(i7472, s7470), KV(i7474, s7470), KV(i7476, s7470),
KV(i7500, s7500), KV(i7502, s7500), KV(i7504, s7500), KV(i7506, s7500),
KV(i7510, s7510), KV(i7512, s7510), KV(i7514, s7510), KV(i7516, s7510),
KV(i7520, s7520), KV(i7522, s7520), KV(i7524, s7520), KV(i7526, s7520),
KV(i7530, s7530), KV(i7532, s7530), KV(i7534, s7530), KV(i7536, s7530),
KV(i7540, s7540), KV(i7542, s7540), KV(i7544, s7540), KV(i7546, s7540),
KV(i7550, s7550), KV(i7552, s7550), KV(i7554, s7550), KV(i7556, s7550),
KV(i7610, s7410), KV(i7612, s7410), KV(i7614, s7410), KV(i7616, s7410),
KV(i7620, s7420), KV(i7622, s7420), KV(i7624, s7420), KV(i7626, s7420),
KV(i7630, s7430), KV(i7632, s7430), KV(i7634, s7430), KV(i7636, s7430),
KV(i7640, s7440), KV(i7642, s7440), KV(i7644, s7440), KV(i7646, s7440),
KV(i7650, s7450), KV(i7652, s7450), KV(i7654, s7450), KV(i7656, s7450),
KV(i7660, s7460), KV(i7662, s7460), KV(i7664, s7460), KV(i7666, s7460),
KV(i7670, s7470), KV(i7672, s7470), KV(i7674, s7470), KV(i7676, s7470),
KV(i7700, s7500), KV(i7702, s7500), KV(i7704, s7500), KV(i7706, s7500),
KV(i7710, s7510), KV(i7712, s7510), KV(i7714, s7510), KV(i7716, s7510),
KV(i7720, s7520), KV(i7722, s7520), KV(i7724, s7520), KV(i7726, s7520),
KV(i7730, s7530), KV(i7732, s7530), KV(i7734, s7530), KV(i7736, s7530),
KV(i7740, s7540), KV(i7742, s7540), KV(i7744, s7540), KV(i7746, s7540),
KV(i7750, s7550), KV(i7752, s7550), KV(i7754, s7550), KV(i7756, s7550),
KV(i7760, s7560), KV(i7762, s7560), KV(i7764, s7560), KV(i7766, s7560),
KV(i7770, s7570), KV(i7772, s7570), KV(i7774, s7570), KV(i7776, s7570),
nil
];
}
- (void) notifySkipIndicator:(NSNotification *)notification
{
/* coalesc the multiple ..._CHANGED_NOTIFICATIONS to one UPDATE_SKIPINDICATOR_NOTIFICATION
to avoid time consuming repeated updates */
// NSLog (@"notifySkipIndicator");
[[NSNotificationQueue defaultQueue] enqueueNotification:
[NSNotification notificationWithName:UPDATE_SKIPINDICATOR_NOTIFICATION object:self]
postingStyle:NSPostASAP coalesceMask:NSNotificationCoalescingOnName forModes:nil];
}
- (void) notifyUpdateSkipIndicator:(NSNotification *)notification
{
// NSLog (@"SkipController notifyUpdateSkipIndicator");
NSAssert (! [pdp8 isGoing], @"PDP-8 is running");
if ([pdp8 getEnable] && ([pdp8 getIOFlagBits:~0] & [pdp8 getInterruptMaskBits:~0]) &&
! ([pdp8 getDelay] || [pdp8 getInhibit]))
[view setImageNamed:INTERRUPT_IMAGE_NAME toolTip:
NSLocalizedString(@"An interrupt is pending", @"")];
else {
NSValue *skipfunc = [dictionary objectForKey:
[NSValue valueWithPointer:[pdp8 getNextInstruction]]];
if (skipfunc) {
if (((PDP8SkiptestFunctionPointer)[skipfunc pointerValue])())
[view setImageNamed:SKIP_IMAGE_NAME toolTip:
NSLocalizedString(@"The next instruction will be skipped", @"")];
else
[view setImageNamed:nil toolTip:nil];
} else
[view setImageNamed:nil toolTip:nil];
}
}
- (void) addSkiptest:(NSValue *)skiptest forInstruction:(NSValue *)instruction
{
if (skiptest && [skiptest pointerValue] && instruction && [instruction pointerValue])
[dictionary setObject:skiptest forKey:instruction];
}
@end

View File

@ -0,0 +1,35 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* FileDropControlTargetProtocol.h - Protocol to support file drop controls
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* When a NSControl is registered as a file drop destination (via [FileDrop registerAsFileDropTarget:]),
the target of the control must implement the FileDragControlTarget protocol that is used to
communicate between the drag actions and the control target. */
@protocol FileDropControlTarget
- (BOOL) willAcceptFile:(NSString *)path; // check if file is allowed to be dropped
- (BOOL) acceptFile:(NSString *)path; // actually perform the drop action, return success status
@end

View File

@ -0,0 +1,30 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSControl+FileDrop.h - Category to support file drop for controls
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@interface NSControl (FileDrop)
- (void) registerAsFileDropTarget;
- (void) unregisterAsFileDropTarget;
@end

View File

@ -0,0 +1,71 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSControl+FileDrop.m - Category to support file drop for controls
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "NSControl+FileDrop.h"
#import "FileDropControlTargetProtocol.h"
#import "NSFileManager+Additions.h"
@implementation NSControl (FileDrop)
- (void) registerAsFileDropTarget
{
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
}
- (void) unregisterAsFileDropTarget
{
[self unregisterDraggedTypes];
}
- (NSDragOperation) draggingEntered:(id <NSDraggingInfo>)sender
{
NSAssert ([[self target] conformsToProtocol:@protocol(FileDropControlTarget)],
@"Control target does not conform to the DragDropControlTarget protocol");
if (! [self isEnabled])
return NSDragOperationNone;
if (([sender draggingSourceOperationMask] & NSDragOperationGeneric) != NSDragOperationGeneric)
return NSDragOperationNone;
NSArray *paths = [[sender draggingPasteboard] propertyListForType:NSFilenamesPboardType];
if ([paths count] != 1) // HIG: don't accept a drag with more than one allowed item
return NSDragOperationNone;
if (! [[self target] willAcceptFile:[paths objectAtIndex:0]])
return NSDragOperationNone;
return NSDragOperationCopy;
}
- (BOOL) performDragOperation:(id <NSDraggingInfo>)sender
{
return [[self target] acceptFile:[[NSFileManager defaultManager] resolveAliasPath:
[[[sender draggingPasteboard] propertyListForType:NSFilenamesPboardType] objectAtIndex:0]]];
}
@end

View File

@ -0,0 +1,32 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSFileManager+Additions.h - Additional functions for file management
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@interface NSFileManager (Additions)
- (BOOL) fsRef:(FSRef *)fsRef forPath:(NSString *)path;
- (NSString *) pathResolved:(NSString *)path; // resolved path, returns nil on failure
- (BOOL) isAliasPath:(NSString *)inPath;
- (NSString *) resolveAliasPath:(NSString *)path; // resolved path, returns original path on failure
@end

View File

@ -0,0 +1,150 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSFileManager+Additions.h - Additional functions for file management
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "utilities.h"
#import "NSFileManager+Additions.h"
/* declarations from Mac OS X 10.6 CFURL.h to dynamically load und call new APIs while building
with the Mac OS X 10.4 SDK */
#import <dlfcn.h>
typedef struct __CFError *CFErrorRef;
typedef CFOptionFlags CFURLBookmarkResolutionOptions;
enum {
kCFBookmarkResolutionWithoutUIMask = ( 1UL << 8 ),
// don't perform any UI during bookmark resolution
kCFBookmarkResolutionWithoutMountingMask = ( 1UL << 9 ),
// don't mount a volume during bookmark resolution
};
static CFDataRef (*CFURLCreateBookmarkDataFromFile) (CFAllocatorRef allocator,
CFURLRef fileURL, CFErrorRef *errorRef);
static CFURLRef (*CFURLCreateByResolvingBookmarkData) (CFAllocatorRef allocator,
CFDataRef bookmark, CFURLBookmarkResolutionOptions options, CFURLRef relativeToURL,
CFArrayRef resourcePropertiesToInclude, Boolean* isStale, CFErrorRef* error);
/*
NSFileManager: Resolve an alias
Original Source: <http://cocoa.karelia.com/Foundation_Categories/NSFileManager__Reso.m>
(See copyright notice at <http://cocoa.karelia.com>)
The old Alias Manager functions are depecated since Mac OS 10.8 and no longer work with OS X 10.10.
The CFURL Bookmark functions are available since Mac OS 10.6. Because we build against the
Mac OS X 10.4 SDK, we call them dynamically. For the new code, see
http://stackoverflow.com/questions/21244781
*/
@implementation NSFileManager (Additions)
- (BOOL) fsRef:(FSRef *)fsRef forPath:(NSString *)path
{
BOOL ok = NO;
CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef) path, kCFURLPOSIXPathStyle, NO);
if (url) {
ok = CFURLGetFSRef(url, fsRef);
CFRelease (url);
}
return ok;
}
- (NSString *) pathResolvedNew:(NSString *)path
// This code runs with Mac OS 10.6 and better; the dlsym() is only required until we build with newer SDKs
{
if (CFURLCreateBookmarkDataFromFile == NULL)
CFURLCreateBookmarkDataFromFile = dlsym(RTLD_NEXT, "CFURLCreateBookmarkDataFromFile");
if (CFURLCreateByResolvingBookmarkData == NULL)
CFURLCreateByResolvingBookmarkData = dlsym(RTLD_NEXT, "CFURLCreateByResolvingBookmarkData");
CFStringRef resolvedPath = nil;
CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef) path, kCFURLPOSIXPathStyle, NO);
if (url != NULL) {
CFErrorRef *err = nil;
CFDataRef bookmark = CFURLCreateBookmarkDataFromFile(NULL, url, err);
if (bookmark != NULL) {
CFURLRef resolvedurl = CFURLCreateByResolvingBookmarkData(NULL, bookmark,
kCFBookmarkResolutionWithoutUIMask, NULL, NULL, NO, err);
if (resolvedurl != NULL) {
resolvedPath = CFURLCopyFileSystemPath(resolvedurl, kCFURLPOSIXPathStyle);
CFRelease (resolvedurl);
}
}
CFRelease (url);
}
return [((NSString *) resolvedPath) autorelease];
}
- (NSString *) pathResolvedOld:(NSString *)path
// This code runs with Mac OS 10.4 to 10.9, it is deprecated since Mac OS 10.8, it doesn't work with Yosemite
{
CFStringRef resolvedPath = nil;
CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef) path, kCFURLPOSIXPathStyle, NO);
if (url != NULL) {
FSRef fsRef;
if (CFURLGetFSRef(url, &fsRef)) {
Boolean targetIsFolder, wasAliased;
if (FSResolveAliasFile(&fsRef, true, &targetIsFolder, &wasAliased) == noErr &&
wasAliased) {
CFURLRef resolvedurl = CFURLCreateFromFSRef(NULL, &fsRef);
if (resolvedurl != NULL) {
resolvedPath = CFURLCopyFileSystemPath(resolvedurl,
kCFURLPOSIXPathStyle);
CFRelease (resolvedurl);
}
}
}
CFRelease (url);
}
return [((NSString *) resolvedPath) autorelease];
}
- (NSString *) pathResolved:(NSString *)path
{
return runningOnSnowLeopardOrNewer() ? [self pathResolvedNew:path] : [self pathResolvedOld:path];
}
- (BOOL) isAliasPath:(NSString *)path
{
return [self pathResolved:path] != nil;
}
- (NSString *) resolveAliasPath:(NSString *)path
{
NSString *resolved = [self pathResolved:path];
return resolved ? resolved : path;
}
@end

View File

@ -0,0 +1,30 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSMutableArray+BinarySearch.h - Category for binary search
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@interface NSMutableArray (BinarySearch)
- (unsigned) addObject:(id)object toArraySortedBy:(SEL)compare replaceExistingObject:(BOOL)replace;
- (unsigned) indexOfObject:(id)object inArraySortedBy:(SEL)compare;
@end

View File

@ -0,0 +1,96 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSMutableArray+BinarySearch.m - Category for binary search
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "NSMutableArray+BinarySearch.h"
@implementation NSMutableArray (BinarySearch)
- (unsigned) addObject:(id)object toArraySortedBy:(SEL)compare replaceExistingObject:(BOOL)replace
{
int n = [self count];
if (n == 0) {
[self addObject:object];
return 0;
}
NSRange range = NSMakeRange(0, n);
while (range.length > 0) {
unsigned m = range.location + range.length / 2;
switch ((NSComparisonResult)
[[self objectAtIndex:m] performSelector:compare withObject:object]) {
case NSOrderedAscending:
n = range.location + range.length;
range.location = m + 1;
range.length = n - range.location;
break;
case NSOrderedDescending:
range.length = m - range.location;
break;
case NSOrderedSame:
if (replace)
[self replaceObjectAtIndex:m withObject:object];
return m;
default:
NSAssert (FALSE, @"Invalid comparison result");
break;
}
}
[self insertObject:object atIndex:range.location];
return range.location;
}
- (unsigned) indexOfObject:(id)object inArraySortedBy:(SEL)compare;
{
int n = [self count];
if (n == 0)
return NSNotFound;
NSRange range = NSMakeRange(0, n);
while (range.length > 0) {
unsigned m = range.location + range.length / 2;
switch ((NSComparisonResult)
[[self objectAtIndex:m] performSelector:compare withObject:object]) {
case NSOrderedAscending:
n = range.location + range.length;
range.location = m + 1;
range.length = n - range.location;
break;
case NSOrderedDescending:
range.length = m - range.location;
break;
case NSOrderedSame:
return m;
default:
NSAssert (FALSE, @"Invalid comparison result");
break;
}
}
return NSNotFound;
}
@end

View File

@ -0,0 +1,29 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSTableView+Scrolling.m - Category with additional scrolling methods
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@interface NSTableView (Scrolling)
- (void) scrollRowToTop:(int)row;
@end

View File

@ -0,0 +1,53 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSTableView+Scrolling.m - Category with additional scrolling methods
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "NSTableView+Scrolling.h"
#import "Utilities.h"
@implementation NSTableView (Scrolling)
- (void) scrollRowToTop:(int)row
{
NSClipView *clipView = (NSClipView *) [self superview];
if (clipView) {
NSRect rowRect = [self rectOfRow:row];
if (runningOnElCapitanOrNewer())
rowRect.origin.y -= rowRect.size.height;
NSPoint newOrigin = [self convertPoint:rowRect.origin toView:clipView];
[clipView scrollToPoint:newOrigin];
NSScrollView *scrollView = (NSScrollView *) [clipView superview];
if (scrollView)
[scrollView reflectScrolledClipView:clipView];
}
}
@end

View File

@ -0,0 +1,29 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSThread+MainThread.h - Category for [NSThread isMainThread], not available with the 10.4 SDK
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@interface NSThread (MainThread)
+ (BOOL) isMainThread;
@end

View File

@ -0,0 +1,39 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* NSThread+MainThread.m - Category for [NSThread isMainThread], not available with the 10.4 SDK
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "NSThread+MainThread.h"
@implementation NSThread (MainThread)
+ (BOOL) isMainThread
{
return (pthread_main_np() != 0);
}
@end

316
Emulation/PDP8.h Normal file
View File

@ -0,0 +1,316 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* PDP8.h - The PDP-8/E Emulator Class
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@class BreakpointArray;
#define MEMORY_CHANGED_NOTIFICATION @"pdp8MemoryChangedNotification"
#define PROGRAM_COUNTER_CHANGED_NOTIFICATION @"pdp8PCChangedNotification"
#define ACCUMULATOR_CHANGED_NOTIFICATION @"pdp8LACChangedNotification"
#define SR_CHANGED_NOTIFICATION @"pdp8SRChangedNotification"
#define SC_CHANGED_NOTIFICATION @"pdp8SCChangedNotification"
#define GTF_CHANGED_NOTIFICATION @"pdp8GTFChangedNotification"
#define MQ_CHANGED_NOTIFICATION @"pdp8MQChangedNotification"
#define EAE_MODE_CHANGED_NOTIFICATION @"pdp8EAEModeChangedNotification"
#define DF_CHANGED_NOTIFICATION @"pdp8DFChangedNotification"
#define UF_CHANGED_NOTIFICATION @"pdp8UFChangedNotification"
#define UB_CHANGED_NOTIFICATION @"pdp8UBChangedNotification"
#define SF_CHANGED_NOTIFICATION @"pdp8SFChangedNotification"
#define ENABLE_CHANGED_NOTIFICATION @"pdp8EnableChangedNotification"
#define DELAY_CHANGED_NOTIFICATION @"pdp8DelayChangedNotification"
#define INHIBIT_CHANGED_NOTIFICATION @"pdp8InhibitChangedNotification"
#define IOFLAGS_CHANGED_NOTIFICATION @"pdp8IOFlagsChangedNotification"
#define EAE_MOUNT_NOTIFICATION @"pdp8EAEMountNotification"
#define KM8E_MOUNT_NOTIFICATION @"pdp8KM8EMountNotification"
#define CLEAR_ALL_FLAGS_NOTIFICATION @"pdp8ClearAllFlagsNotification"
#define PDP8_STEP_NOTIFICATION @"pdp8StepNotification"
#define PDP8_TRACE_NOTIFICATION @"pdp8TraceNotification"
#define PDP8_GO_NOTIFICATION @"pdp8GoNotification"
#define PDP8_STOP_NOTIFICATION @"pdp8StopNotification"
#define PDP8_FIELDSIZE 0010000 /* size of a 4K PDP-8 memory field */
#define PDP8_MEMSIZE 0100000 /* maximal PDP-8 memory size is 32K */
#define PDP8_IOADDRS 0100 /* number of I/O addresses: 6xx? */
#define EAE_MODE_A 'A' /* values for pdp8->eaeMode */
#define EAE_MODE_B 'B'
#define userFLAG 1ul /* hard coded user mode flag (see IOFlagController) */
#define STOPPED 0 /* for state.running */
#define GOING 1
#define TRACING 2
#define RUNNING (GOING | TRACING)
#define GO_AS_FAST_AS_POSSIBLE 0 /* for state.goSpeed, setGoSpeed: and getGoSpeed */
#define GO_WITH_PDP8_SPEED 1
#define GO_WITH_PDP8_SPEED_PRECISE 2
#define NO_STOP_ADDRESS -1 /* for trace: and go: without stop address */
typedef unsigned long ulong;
typedef void (*PDP8InstructionFunctionPointer)(void);
/* Structure with information about the optional devices currently simulated */
typedef struct {
ushort memsize; /* memory size in 12-bit words - Data Break I/O devices must know
this value to avoid writing into non-existing PDP-8 memory */
BOOL hasEAE; /* the simulated hardware has an EAE */
BOOL hasKM8E; /* the simulated hardware has an KM8-E */
BOOL hasKM8Etimesharing; /* the time sharing jumper of the KM8-E is present */
} HW;
/* Registers of the TSC8-75 board are kept within the PDP-8 class */
typedef struct {
ulong flag; /* interrupt mask of the TSC8-75 (0 when TSC8-75 not present) */
ushort eriot; /* last instruction (IOT, JMP, JMS) that caused an user mode trap */
ushort ertb; /* address of last JMP or JMS that caused an user mode trap */
ushort ecdf; /* set when a CDF is executed in user mode, cleared by ECDF or ESME */
ushort esmeEnabled; /* TSC8-75 supports the ESME mode, i. e. the IOT 6365 */
} TSC8_75;
/* Structure with information about the internal state of the PDP-8/E emulation */
typedef struct {
ushort running; /* STOPPED, TRACING or GOING */
BOOL halted; /* YES iff the HALT or SINGSTEP key of the KC8-EA console is pressed */
ushort currInst; /* code of current PDP-8 instruction, the functions */
/* implementing the PDP-8 instructions can inspect this */
ulong executionTime; /* every PDP-8 instruction must add to this value the execution */
/* time (in 0.1 microseconds) of the instruction */
/* for IOTs of I/O devices implemented by plugins these are: */
/* 12 (1.2 microseconds) for IOTs of devices directly attached to */
/* the OMNIBUS; */
/* for devices attached via the KA8-E Positive I/O Bus Interface: */
/* 12 (1.2 microseconds) for IOTs ending in 0 */
/* 26 (2.6 microseconds) for IOTs ending in 1, 2 or 4 */
/* 36 (3.6 microseconds) for IOTs ending in 3, 5 or 6 */
/* 46 (4.6 microseconds) for IOTs ending in 7 */
/* use the macro EXECUTION_TIME() for this purpose */
uint64_t absoluteTime; /* Mach kernel absolut time corresponding to PDP-8 executionTime */
int goSpeed; /* GO_AS_FAST_AS_POSSIBLE, GO_WITH_PDP8_SPEED, GO_WITH_PDP8_SPEED_PRECISE */
ulong usecTraceDelay; /* delay (in microseconds) between two instructions in trace mode */
void *pluginPointer[PDP8_IOADDRS]; /* for each I/O address, a pointer pointing to the plugin */
} STATE;
@interface PDP8 : NSObject <NSCoding> {
@public
/* The attributes are public, so the C functions implementing the PDP-8 instructions can
access them directly. No other Cocoa code should use them directly. To ensure this,
the register names are mapped to dummy names with the #defines below. In the source
code files with the instruction C functions, #define USE_PDP8_REGISTERS_DIRECTLY
to make the registers available. */
/* Registers of the PDP-8/E CPU */
ushort SR;
ushort AC; /* including L flag */
ushort PC;
ushort SC;
ushort MQ;
ushort GTF;
ushort IF; /* W: for write access to nonexisting memory */
ushort IB, W_IB; /* W_IB == IB when memory exists, */
ushort DF, W_DF; /* W_IB == 0100000 when memory does not exist */
/* write accesses to current IF are only by JMS, */
/* but then IB is used, so no W_IF needed. */
/* dto. for DF, W_DF */
/* field registers are 0n0000 for field n (0 <= n <= 7) */
ushort UF;
ushort UB; /* UF, UB is 000000 or 010000 */
ushort SF;
ushort IENABLE;
ushort IINHIBIT;
ushort IDELAY;
ulong IMASK;
ulong IOFLAGS;
char eaeMode; /* 'A' - Mode A, 'B' - Mode B */
ushort mem[PDP8_MEMSIZE + PDP8_FIELDSIZE]; /* 9th field for non-existing core */
/* additional attributes */
TSC8_75 _tsc8;
HW _hw;
STATE _state;
@private
IBOutlet BreakpointArray *breakpoints;
IBOutlet BreakpointArray *breakopcodes;
char bp[PDP8_MEMSIZE];
NSMutableDictionary *saveopcodes;
}
- (void) mountEAE:(BOOL)mount; // mount or unmount
- (BOOL) hasEAE;
- (void) mountKM8E:(BOOL)mount memorySize:(unsigned)memsize timesharingEnabled:(BOOL)timesharing;
- (BOOL) hasKM8E;
- (BOOL) isTimesharingEnabled;
- (ushort) memorySize; // memory size in 12-bit words, e. g. 010000 for a 4K machine
- (BOOL) isIOAddressAvailable:(int)addr;
- (void) setIOT:(NSValue *)iot forOpcode:(int)opcode;
- (void) setPluginPointer:(void *)pointer forIOAddress:(int)addr; // see PLUGIN_POINTER macro below
- (NSString *) loadPaperTape:(NSString *)filename toField:(ushort)field;
// returns an error message; nil == everything ok
- (void) setTraceSpeed:(double)speed; // trace with frequency of 1/speed Hz
- (void) setGoSpeed:(int)goSpeed; // see state.goSpeed and the three GO_ macros
- (int) getGoSpeed; // may change with a NSUserDefaultsDidChangeNotification
- (void) step;
- (void) trace:(int)stopAddress; // stopAddress == -1 for no stop address
- (void) go:(int)stopAddress;
- (void) stop; // stop the running or tracing PDP-8
- (void) clearAllFlags;
- (void) loadExtendedAddress;
- (void) reset;
- (BOOL) isStopped;
- (BOOL) isTracing;
- (BOOL) isGoing;
- (BOOL) isRunning; // running in trace or go mode
- (BOOL) isHalted; // restart is inhibited (HALT or SINGSTEP console key is up)
- (void) setHalt:(BOOL)halt; // stop and inhibit restart (for the HALT or SINGSTEP console keys)
- (ushort) getPC;
- (void) setPC:(ushort)pc;
- (ushort) getProgramCounter; // returns IF | PC
- (void) setProgramCounter:(ushort)programCounter; // sets IB, IF and PC
- (ushort) getIF;
- (void) setIF:(ushort)_if;
- (ushort) getIB;
- (void) setIB:(ushort)ib;
- (ushort) getDF;
- (void) setDF:(ushort)df;
- (ushort) getUF;
- (void) setUF:(ushort)uf;
- (ushort) getUB;
- (void) setUB:(ushort)ub;
- (ushort) getSF;
- (void) setSF:(ushort)sf;
- (ushort) getSR;
- (void) setSR:(ushort)sr;
- (ushort) getL;
- (void) setL:(ushort)l;
- (ushort) getAC;
- (void) setAC:(ushort)ac;
- (ushort) getLAC;
- (void) setLAC:(ushort)lac;
- (ushort) getSC;
- (void) setSC:(ushort)sc;
- (ushort) getGTF;
- (void) setGTF:(ushort)gtf;
- (ushort) getMQ;
- (void) setMQ:(ushort)mq;
- (char) getEAEmode;
- (void) setEAEmode:(char)mode;
- (ushort) getEnable;
- (void) setEnable:(ushort)enable;
- (ushort) getDelay;
- (void) setDelay:(ushort)delay;
- (ushort) getInhibit;
- (void) setInhibit:(ushort)inhibit;
- (ulong) getInterruptMaskBits:(ulong)bitmask;
- (void) setInterruptMaskBits:(ulong)bitmask;
- (void) clearInterruptMaskBits:(ulong)bitmask;
- (ulong) getIOFlagBits:(ulong)bitmask;
- (void) setIOFlagBits:(ulong)bitmask;
- (void) clearIOFlagBits:(ulong)bitmask;
- (BOOL) interruptRequest;
- (ushort) memoryAt:(int)address;
- (ushort) memoryAtNext:(int)address;
- (ushort *) directMemoryAccess; // pointer to the PDP-8 memory, only for Data Break I/O devices
- (void) directMemoryWriteFinished; // call this method when the memory modifying Data Break is finished
- (void) setMemoryAtAddress:(int)address toValue:(int)value;
- (void) setMemoryAtNextAddress:(int)address toValue:(int)value;
- (void) setMemoryAtAddress:(int)address toValues:(NSArray *)values withMask:(BOOL)withMask;
- (void) clearMemory;
- (ushort) getCurrentOpcode;
- (PDP8InstructionFunctionPointer) getNextInstruction;
- (ushort) getTSC8ertb;
- (void) setTSC8ertb:(ushort)ertb;
- (ushort) getTSC8eriot;
- (void) setTSC8eriot:(ushort)eriot;
- (ushort) getTSC8ecdf;
- (void) setTSC8ecdf:(ushort)ecdf;
- (ulong) getTSC8flag;
- (void) setTSC8flag:(ulong)flag;
- (BOOL) getTSC8esmeEnabled;
- (void) setTSC8esmeEnabled:(BOOL)enabled;
#if ! defined(NS_BLOCK_ASSERTIONS)
- (id) pluginPointer:(Class)pluginClass; // with assertion; see PLUGIN_POINTER macro below
#endif
@end
#if USE_PDP8_REGISTERS_DIRECTLY
extern PDP8 *pdp8;
#define EXECUTION_TIME(time) (pdp8->_state.executionTime += (time))
#if defined(NS_BLOCK_ASSERTIONS)
#define PLUGIN_POINTER(plugin) ((plugin *) pdp8->_state.pluginPointer[(pdp8->_state.currInst >> 3) & 077])
#else
#define PLUGIN_POINTER(plugin) ((plugin *) [pdp8 pluginPointer:[plugin class]])
#endif
#else
#define SR __dont_use_SR__
#define AC __dont_use_AC__
#define PC __dont_use_PC__
#define SC __dont_use_SC__
#define MQ __dont_use_MQ__
#define GTF __dont_use_GTF__
#define IF __dont_use_IF__
#define IB __dont_use_IB__
#define W_IB __dont_use_W_IB__
#define DF __dont_use_DF__
#define W_DF __dont_use_W_DF__
#define UF __dont_use_UF__
#define UB __dont_use_UB__
#define SF __dont_use_SF__
#define IENABLE __dont_use_IENABLE__
#define IINHIBIT __dont_use_IINHIBIT__
#define IDELAY __dont_use_IDELAY__
#define IMASK __dont_use_IMASK__
#define IOFLAGS __dont_use_IOFLAGS__
#define eaeMode __dont_use_eaeMode__
#define mem __dont_use_mem__
#define _tsc8 __dont_use_tsc8__
#define _hw __dont_use_hw__
#define _state __dont_use_state__
#endif

1345
Emulation/PDP8.m Normal file

File diff suppressed because it is too large Load Diff

1255
Emulation/eae.c Normal file

File diff suppressed because it is too large Load Diff

171
Emulation/eae.h Normal file
View File

@ -0,0 +1,171 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* eae.h - Interface for the EAE instructions code for the PDP-8/E
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* EMUL-8: a pdp8e emulator.
*
* Author:
* Bill Haygood
* 41832 Ernest Road
* Loon Lake, WA 99148-9607
* Internet: billh@comtch.iea.com
* Voice/AnsMach/FAX \
* or 509-233-2555
* Cellular/Pager /
*
* Copyright 1992, 1993, 1994 by the author with all rights reserved.
*
* Include file for Operate microinstruction (OPR) module
* to handle EAE instructions.
*/
/* -------------------------------------------------------------------- */
extern void i7401 (void) ; /* NOP Grp III */
extern void i7403 (void) ;
extern void i7405 (void) ; /* MUY */
extern void i7407 (void) ; /* DVI */
extern void i7411 (void) ; /* NMI */
extern void i7413 (void) ; /* SHL */
extern void i7415 (void) ; /* ASR */
extern void i7417 (void) ; /* LSR */
extern void i7421 (void) ; /* MQL */
extern void i7423 (void) ; /* MQL SCL */
extern void i7425 (void) ; /* MQL MUY */
extern void i7427 (void) ; /* MQL DVI */
extern void i7431 (void) ; /* SWAB */
extern void i7433 (void) ; /* MQL SHL */
extern void i7435 (void) ; /* MQL ASR */
extern void i7437 (void) ; /* MQL LSR */
extern void i7441 (void) ; /* SCA */
extern void i7443 (void) ;
extern void i7445 (void) ;
extern void i7447 (void) ; /* SWBA */
extern void i7451 (void) ;
extern unsigned s7451 (void) ; /* (skip test) */
extern void i7453 (void) ;
extern void i7455 (void) ;
extern void i7457 (void) ;
extern void i7461 (void) ; /* MQL SCA */
extern void i7463 (void) ; /* A: MQL SCA SCL */
extern void i7465 (void) ; /* A: MQL SCA MUY */
extern void i7467 (void) ; /* MQL SWBA */
extern void i7471 (void) ; /* A: MQL SCA NMI */
extern void i7473 (void) ; /* A: MQL SCA SHL */
extern void i7475 (void) ; /* A: MQL SCA ASR */
extern void i7477 (void) ; /* A: MQL SCA LSR */
extern void i7501 (void) ; /* MQA */
extern void i7503 (void) ; /* A: MQA SCL */
extern void i7505 (void) ; /* MQA MUY */
extern void i7507 (void) ; /* MQA DVI */
extern void i7511 (void) ; /* MQA NMI */
extern void i7513 (void) ; /* MQA SHL */
extern void i7515 (void) ; /* MQA ASR */
extern void i7517 (void) ; /* MQA LSR */
extern void i7521 (void) ; /* SWP */
extern void i7523 (void) ; /* A: SWP SCL */
extern void i7525 (void) ; /* SWP MUY */
extern void i7527 (void) ; /* SWP DVI */
extern void i7531 (void) ; /* SWP NMI */
extern void i7533 (void) ; /* SWP SHL */
extern void i7535 (void) ; /* SWP ASR */
extern void i7537 (void) ; /* SWP LSR */
extern void i7541 (void) ; /* MQA SCA */
extern void i7543 (void) ; /* A: MQA SCA SCL */
extern void i7545 (void) ; /* A: MQA SCA MUY */
extern void i7547 (void) ; /* A: MQA SWBA */
extern void i7551 (void) ; /* A: MQA SCA NMI */
extern void i7553 (void) ; /* A: MQA SCA SHL */
extern void i7555 (void) ; /* A: MQA SCA ASR */
extern void i7557 (void) ; /* A: MQA SCA LSR */
extern void i7561 (void) ; /* SWP SCA */
extern void i7563 (void) ; /* A: SWP SCA SCL */
extern void i7565 (void) ; /* A: SWP SCA MUY */
extern void i7567 (void) ; /* SWP SWBA */
extern void i7571 (void) ; /* A: SWP SCA NMI */
extern void i7573 (void) ; /* A: SWP SCA SHL */
extern void i7575 (void) ;
extern void i7577 (void) ; /* A: SWP SCA LSR */
extern void i7601 (void) ; /* CLA Grp III */
extern void i7603 (void) ; /* CLA SCA */
extern void i7605 (void) ; /* CLA MUY */
extern void i7607 (void) ; /* CLA DVI */
extern void i7611 (void) ; /* CLA NMI */
extern void i7613 (void) ; /* CLA SHL */
extern void i7615 (void) ; /* CLA ASR */
extern void i7617 (void) ; /* CLA LSR */
extern void i7621 (void) ; /* CLA MQL */
extern void i7623 (void) ; /* CLA MQL SCL */
extern void i7625 (void) ; /* CLA MQL MUY */
extern void i7627 (void) ; /* CLA MQL DVI */
extern void i7631 (void) ; /* CLA MQL NMI */
extern void i7633 (void) ; /* CLA MQL SHL */
extern void i7635 (void) ; /* CLA MQL ASR */
extern void i7637 (void) ; /* CLA MQL LSR */
extern void i7641 (void) ; /* CLA SCA */
extern void i7643 (void) ; /* A: CLA SCA SCL */
extern void i7645 (void) ; /* A: CLA SCA MUY */
extern void i7647 (void) ; /* CLA SWBA */
extern void i7651 (void) ; /* A: CLA SCA NMI */
extern void i7653 (void) ; /* A: CLA SCA SHL */
extern void i7655 (void) ; /* A: CLA SCA ASR */
extern void i7657 (void) ; /* A: CLA SCA LSR */
extern void i7661 (void) ; /* CLA MQL SCA */
extern void i7663 (void) ; /* A: CLA MQL SCA SCL */
extern void i7665 (void) ; /* A: CLA MQL SCA MUY */
extern void i7667 (void) ; /* CLA MQL SWBA */
extern void i7671 (void) ; /* A: CLA MQL SCA NMI */
extern void i7673 (void) ; /* A: CLA MQL SCA SHL */
extern void i7675 (void) ; /* A: CLA MQL SCA ASR */
extern void i7677 (void) ; /* A: CLA MQL SCA LSR */
extern void i7701 (void) ; /* CLA MQA */
extern void i7703 (void) ; /* CLA MQA SCL */
extern void i7705 (void) ; /* CLA MQA MUY */
extern void i7707 (void) ; /* CLA MQA DVI */
extern void i7711 (void) ; /* CLA MQA NMI */
extern void i7713 (void) ; /* CLA MQA SHL */
extern void i7715 (void) ; /* CLA MQA ASR */
extern void i7717 (void) ; /* CLA MQA LSR */
extern void i7721 (void) ; /* CLA SWP */
extern void i7723 (void) ; /* CLA SWP SCL */
extern void i7725 (void) ; /* CLA SWP MUY */
extern void i7727 (void) ; /* CLA SWP DVI */
extern void i7731 (void) ; /* CLA SWP NMI */
extern void i7733 (void) ; /* CLA SWP SHL */
extern void i7735 (void) ; /* CLA SWP ASR */
extern void i7737 (void) ; /* CLA SWP LSR */
extern void i7741 (void) ; /* CLA MQA SCA */
extern void i7743 (void) ; /* A: CLA MQA SCA SCL */
extern void i7745 (void) ; /* A: CLA MQA SCA MUY */
extern void i7747 (void) ; /* A: CLA MQA SWBA */
extern void i7751 (void) ; /* A: CLA MQA SCA NMI */
extern void i7753 (void) ; /* A: CLA MQA SCA SHL */
extern void i7755 (void) ; /* A: CLA MQA SCA ASR */
extern void i7757 (void) ; /* A: CLA MQA SCA LSR */
extern void i7761 (void) ; /* CLA SWP SCA */
extern void i7763 (void) ; /* A: CLA SWP SCA SCL */
extern void i7765 (void) ; /* A: CLA SWP SCA MUY */
extern void i7767 (void) ; /* A: CLA SWP SCA DVI */
extern void i7771 (void) ; /* CLA SWP DPSZ */
extern void i7773 (void) ; /* A: CLA SWP SCA SHL */
extern void i7775 (void) ;
extern void i7777 (void) ; /* A: CLA SWP SCA LSR */
/* -------------------------------------------------------------------- */

576
Emulation/iot.c Normal file
View File

@ -0,0 +1,576 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* iot.c - IOT instructions code for the PDP-8/E
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* EMUL-8: a pdp8e emulator.
*
* Author:
* Bill Haygood
* 41832 Ernest Road
* Loon Lake, WA 99148-9607
* Internet: billh@comtch.iea.com
* Voice/AnsMach/FAX \
* or 509-233-2555
* Cellular/Pager /
*
* Copyright 1992, 1993, 1994 by the author with all rights reserved.
*
* Input / Output Transfer (IOT) module.
*/
#import <Cocoa/Cocoa.h>
#define USE_PDP8_REGISTERS_DIRECTLY 1
#include "PDP8.h"
#include "iot.h"
#include "pdp8defines.h"
#include "PluginAPI.h" // for CAF for I/O devices
/* -------------------------------------------------------------------- */
VOID iuser (VOID)
{
io_flags |= userFLAG;
tsc8.eriot = INST;
tsc8.ecdf = ((tsc8.eriot & 07707) == 06201);
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6000 (VOID) /* SKON 6000 */
{
if (int_ena)
++PC ;
int_ena = delay = false ;
EXECUTION_TIME (12);
}
unsigned s6000 (VOID) /* SKON 6000 */
{
return (int_ena);
}
/* -------------------------------------------------------------------- */
VOID i6001 (VOID) /* ION 6001 */
{
int_ena = delay = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6002 (VOID) /* IOF 6002 */
{
int_ena = delay = false ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6003 (VOID) /* SRQ 6003 */
{
if (io_flags & int_mask)
++PC ;
EXECUTION_TIME (12);
}
unsigned s6003 (VOID) /* SRQ 6003 */
{
return (io_flags & int_mask);
}
/* -------------------------------------------------------------------- */
VOID i6004 (VOID) /* GTF 6004 */
{
AC = (AC & 010000) | ((AC & 010000) >> 1) /* Save the LINK */
| ((EAE == 'B' && GTF) ? BIT1 : 0) /* Save the GTF */
| ((io_flags & int_mask) ? BIT2 : 0) /* Save Interrupt Req */
/* | (int_inh << 8) */ /* Save Interrupt Inh */
/* AC(3) should become the inhibit flag, but the PDP-8/E
hardware does not implement this - detected by the
Extended Memory Control and Timeshare Test MAINDEC-8E-D1HA */
| (int_ena << 7) /* Save Interrupt Ena */
| SF ; /* Save UF, IF, DF */
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6005 (VOID) /* RTF 6005 */
{
AC = (AC & 07777) | ((AC & BIT0) << 1) ; /* Restore LINK */
if (EAE == 'B')
GTF = (AC & BIT1) >> 10 ; /* Restore GTF */
SF = AC & 0177 ; /* Restore SF */
UB = (AC & BIT5) << 6; /* Restore UB */
W_IB = IB = (AC & 070) << 9 ; /* Restore IB */
if (IB >= hw.memsize)
W_IB = 0100000;
W_DF = DF = (AC & 07) << 12 ; /* Restore DF */
if (DF >= hw.memsize)
W_DF = 0100000;
int_ena = delay = int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6006 (VOID) /* SGT 6006 */
{
if (EAE == 'B' && GTF)
++PC ;
EXECUTION_TIME (12);
}
unsigned s6006 (VOID) /* SGT 6006 */
{
return (EAE == 'B' && GTF);
}
/* -------------------------------------------------------------------- */
VOID i6007 (VOID) /* CAF 6007 */
{
AC = 0 ; /* Clear pdp8 registers */
int_ena = int_inh = delay = false ;
io_flags = false ; /* no flags, but serial IE's = 1! */
EAE = 'A' ; /* Set EAE mode A */
GTF = false ;
int i;
for (i = 0; i < PDP8_IOADDRS; i++) {
if (pdp8->_state.pluginPointer[i])
[(PDP8Plugin *) pdp8->_state.pluginPointer[i] CAF:i];
}
#ifdef FPP
if (FPP)
{
io_flags &= ~fppFLAG ; /* Clear FPP Int flag */
fpp_mode = LEAV ; /* Interleaved mode */
fpp_run = false ; /* Stop the FPP */
fpp_pause = false ; /* ditto */
fpp_data = FP ; /* Enable FP mode */
fpp_stat = 0 ; /* Clear FPP status */
}
rx5command = 0 ; /* Clear RX50 regs */
rx5curaddr = 0 ;
rx5block = 0 ;
rx5status = 0 ;
rx5unit = 0 ;
rx5lock = false ;
#endif
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
/*
* Field change IOTs.
*/
/* -------------------------------------------------------------------- */
VOID i6201 (VOID) /* CDF 0 6201 */
{
W_DF = DF = 0 ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6202 (VOID) /* CIF 0 6202 */
{
W_IB = IB = 0 ;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6203 (VOID) /* CIF CDF 0 6203 */
{
W_IB = IB = W_DF = DF = 0 ;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
/*
* Clear User Interrupt.
*/
/* -------------------------------------------------------------------- */
VOID i6204 (VOID) /* CINT 6204 */
{
io_flags &= ~userFLAG ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6211 (VOID) /* CDF 1 6211 */
{
if ((W_DF = DF = 010000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6212 (VOID) /* CIF 1 6212 */
{
if ((W_IB = IB = 010000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6213 (VOID) /* CIF CDF 1 6213 */
{
if ((W_IB = IB = W_DF = DF = 010000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6214 (VOID) /* RDF 6214 */
{
AC |= DF >> 9 ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6221 (VOID) /* CDF 2 6221 */
{
if ((W_DF = DF = 020000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6222 (VOID) /* CIF 2 6222 */
{
if ((W_IB = IB = 020000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6223 (VOID) /* CIF CDF 2 6223 */
{
if ((W_IB = IB = W_DF = DF = 020000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6224 (VOID) /* RIF 6224 */
{
AC |= IF >> 9 ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6231 (VOID) /* CDF 3 6231 */
{
if ((W_DF = DF = 030000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6232 (VOID) /* CIF 3 6232 */
{
if ((W_IB = IB = 030000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6233 (VOID) /* CIF CDF 3 6233 */
{
if ((W_IB = IB = W_DF = DF = 030000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6234 (VOID) /* RIB 6234 */
{
AC |= SF ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6241 (VOID) /* CDF 4 6241 */
{
if ((W_DF = DF = 040000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6242 (VOID) /* CIF 4 6242 */
{
if ((W_IB = IB = 040000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6243 (VOID) /* CIF CDF 4 6243 */
{
if ((W_IB = IB = W_DF = DF = 040000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6244 (VOID) /* RMF 6244 */
{
UB = (SF & BIT5) << 6 ;
if ((W_IB = IB = (SF & 070) << 9) >= hw.memsize)
W_IB = 0100000;
if ((W_DF = DF = (SF & 07) << 12) >= hw.memsize)
W_DF = 0100000;
int_inh = true;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6251 (VOID) /* CDF 5 6251 */
{
if ((W_DF = DF = 050000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6252 (VOID) /* CIF 5 6252 */
{
if ((W_IB = IB = 050000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6253 (VOID) /* CIF CDF 5 6253 */
{
if ((W_IB = IB = W_DF = DF = 050000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
/*
* Skip on User Interrupt.
*/
/* -------------------------------------------------------------------- */
VOID i6254 (VOID) /* SINT 6254 */
{
if (io_flags & userFLAG)
++PC ;
EXECUTION_TIME (12);
}
unsigned s6254 (VOID) /* SINT 6254 */
{
return (io_flags & userFLAG);
}
/* -------------------------------------------------------------------- */
VOID i6261 (VOID) /* CDF 6 6261 */
{
if ((W_DF = DF = 060000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6262 (VOID) /* CIF 6 6262 */
{
if ((W_IB = IB = 060000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6263 (VOID) /* CIF CDF 6 6263 */
{
if ((W_IB = IB = W_DF = DF = 060000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
/*
* Clear the User Flag.
*/
/* -------------------------------------------------------------------- */
VOID i6264 (VOID) /* CUF 6264 */
{
UB = 0 ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6271 (VOID) /* CDF 7 6271 */
{
if ((W_DF = DF = 070000) >= hw.memsize)
W_DF = 0100000;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6272 (VOID) /* CIF 7 6272 */
{
if ((W_IB = IB = 070000) >= hw.memsize)
W_IB = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
VOID i6273 (VOID) /* CIF CDF 7 6273 */
{
if ((W_IB = IB = W_DF = DF = 070000) >= hw.memsize)
W_IB = W_DF = 0100000;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
/*
* Set the User Flag.
*/
/* -------------------------------------------------------------------- */
VOID i6274 (VOID) /* SUF 6274 */
{
UB = 1 << 12 ;
int_inh = true ;
EXECUTION_TIME (12);
}
/* -------------------------------------------------------------------- */
/*
* FPP-8/A Floating Point Processor
*/
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6551 (VOID) /* FPINT 6551 */
{
if (io_flags & fppFLAG)
++PC ;
EXECUTION_TIME (12);
}
#error "s6551 missing"
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6552 (VOID) /* FPICL 6552 */
{
io_flags &= ~fppFLAG ; /* Clear FPP Int flag */
fpp_mode = LEAV ; /* Interleaved mode */
fpp_run = false ; /* Stop the FPP */
fpp_pause = false ; /* ditto */
fpp_data = FP ; /* Enable FP mode */
fpp_stat = 0 ; /* Clear FPP status */
EXECUTION_TIME (12);
}
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6553 (VOID) /* FPCOM 6553 */
{
if (fpp_run == false && !(io_flags & fppFLAG))
{
fpp_command = (AC & 07777) | 0100000 ; /* Insure non-zero */
/* See FPEP below */
fpp_stat &= ~(BIT0 | BIT8 | BIT9) ; /* Set FPP mode FP */
if (fpp_command & BIT0)
{
fpp_stat |= BIT0 ; /* Set DP in status */
fpp_data = DP ; /* Set DP mode */
}
int_mask &= ~fppFLAG ; /* Clear interrupts */
if (fpp_command & BIT3) /* Enable interrupts ? */
int_mask |= fppFLAG ; /* Yes */
fpp_mode = LEAV ; /* Set interleave mode */
if (fpp_command & BIT8) /* Lockout mode ? */
{
fpp_mode = LOCK ; /* Yes */
fpp_stat |= BIT8 ;
}
}
EXECUTION_TIME (12);
}
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6554 (VOID) /* FPHLT 6554 */
{
if (fpp_run)
{
fpp_pause = true ;
fpp_stat |= BIT2 ;
if (fpp_stat & BIT10) /* If FPP paused, */
fpp_pc = --fpp_pc & 077777 ; /* decrement FPC */
}
EXECUTION_TIME (12);
}
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6555 (VOID) /* FPST 6555 */
{
if (fpp_run == false && !(io_flags & fppFLAG))
{
fpp_aptp = ((fpp_command & 07) << 12) | (AC & 07777) ;
fpp_pc = ((*(base + fpp_aptp) & 07) << 12)
+ (*(base + fpp_aptp + 1)) ;
fpp_opadd = fpp_pc ; /* OPADD (2-5) */
if (!(fpp_command & BIT5))
fpp_x0 = ((*(base + fpp_aptp) & 070) << 9)
+ (*(base + fpp_aptp + 2)) ;
if (!(fpp_command & BIT6))
fpp_br = ((*(base + fpp_aptp) & 0700) << 6)
+ (*(base + fpp_aptp + 3)) ;
if (!(fpp_command & BIT7))
{
fpp_ac [0] = *(base + fpp_aptp + 5) ;
fpp_ac [1] = *(base + fpp_aptp + 6) ;
fpp_ac [2] = *(base + fpp_aptp + 7) ;
if (fpp_data == EP)
{
fpp_ac [3] = *(base + fpp_aptp + 8) ;
fpp_ac [4] = *(base + fpp_aptp + 9) ;
fpp_ac [5] = *(base + fpp_aptp + 10) ;
}
}
fpp_stat &= ~BIT10 ; /* Clear FPAUSE in stat */
fpp_run = true ;
fpp_stat |= BIT11 ; /* Set RUN in status */
++PC ;
}
EXECUTION_TIME (12);
}
#error "s6555 missing"
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6556 (VOID) /* FPRST 6556 */
{
AC = (AC & 010000) | fpp_stat ;
EXECUTION_TIME (12);
}
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6557 (VOID) /* FPIST 6557 */
{
if (io_flags & fppFLAG)
{
++PC ;
AC = (AC & 010000) | fpp_stat ;
fpp_stat = 0 ;
io_flags &= ~fppFLAG ;
}
EXECUTION_TIME (12);
}
#error "s6557 missing"
#endif
/* -------------------------------------------------------------------- */
#ifdef FPP
VOID i6567 (VOID) /* FPEP 6567 */
{
if ((AC & BIT0) && fpp_run == false && fpp_command)
{
fpp_stat &= ~BIT0 ; /* Remove DP mode */
if (fpp_command & 0100000)
{
fpp_stat |= 4 ; /* Set EP in status */
fpp_data = EP ; /* Set EP mode */
fpp_command &= 0107777 ;
}
}
AC &= 010000 ;
EXECUTION_TIME (12);
}
#endif

109
Emulation/iot.h Normal file
View File

@ -0,0 +1,109 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* iot.c - Interface for the IOT instructions code for the PDP-8/E
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* EMUL-8: a pdp8e emulator.
*
* Author:
* Bill Haygood
* 41832 Ernest Road
* Loon Lake, WA 99148-9607
* Internet: billh@comtch.iea.com
* Voice/AnsMach/FAX \
* or 509-233-2555
* Cellular/Pager /
*
* Copyright 1992, 1993, 1994 by the author with all rights reserved.
*
* Include file for Input / Output Transfer (IOT) module.
*/
/* -------------------------------------------------------------------- */
/*
* IOT Instructions
*/
/* -------------------------------------------------------------------- */
extern void iuser (void) ;
extern void i6000 (void) ; /* SKON 6000 */
extern unsigned s6000 (void) ; /* SKON (skip test) */
extern void i6001 (void) ; /* ION 6001 */
extern void i6002 (void) ; /* IOF 6002 */
extern void i6003 (void) ; /* SRQ 6003 */
extern unsigned s6003 (void) ; /* SRQ (skip test) */
extern void i6004 (void) ; /* GTF 6004 */
extern void i6005 (void) ; /* RTF 6005 */
extern void i6006 (void) ; /* SGT 6006 */
extern unsigned s6006 (void) ; /* SGT (skip test) */
extern void i6007 (void) ; /* CAF 6007 */
extern void i6201 (void) ; /* CDF 0 6201 */
extern void i6202 (void) ; /* CIF 0 6202 */
extern void i6203 (void) ; /* CIF CDF 0 6203 */
extern void i6204 (void) ; /* CINT 6204 */
extern void i6211 (void) ; /* CDF 1 6211 */
extern void i6212 (void) ; /* CIF 1 6212 */
extern void i6213 (void) ; /* CIF CDF 1 6213 */
extern void i6214 (void) ; /* RDF 6214 */
extern void i6221 (void) ; /* CDF 2 6221 */
extern void i6222 (void) ; /* CIF 2 6222 */
extern void i6223 (void) ; /* CIF CDF 2 6223 */
extern void i6224 (void) ; /* RIF 6224 */
extern void i6231 (void) ; /* CDF 3 6231 */
extern void i6232 (void) ; /* CIF 3 6232 */
extern void i6233 (void) ; /* CIF CDF 3 6233 */
extern void i6234 (void) ; /* RIB 6234 */
extern void i6241 (void) ; /* CDF 4 6241 */
extern void i6242 (void) ; /* CIF 4 6242 */
extern void i6243 (void) ; /* CIF CDF 4 6243 */
extern void i6244 (void) ; /* RMF 6244 */
extern void i6251 (void) ; /* CDF 5 6251 */
extern void i6252 (void) ; /* CIF 5 6252 */
extern void i6253 (void) ; /* CIF CDF 5 6253 */
extern void i6254 (void) ; /* SINT 6254 */
extern unsigned s6254 (void) ; /* SINT (skip test) */
extern void i6261 (void) ; /* CDF 6 6261 */
extern void i6262 (void) ; /* CIF 6 6262 */
extern void i6263 (void) ; /* CIF CDF 6 6263 */
extern void i6264 (void) ; /* CUF 6264 */
extern void i6271 (void) ; /* CDF 7 6271 */
extern void i6272 (void) ; /* CIF 7 6272 */
extern void i6273 (void) ; /* CIF CDF 7 6273 */
extern void i6274 (void) ; /* SUF 6274 */
extern void i6551 (void) ; /* FPINT 6551 */
extern unsigned s6551 (void) ; /* FPINT (skip test) */
extern void i6552 (void) ; /* FPICL 6552 */
extern void i6553 (void) ; /* FPCOM 6553 */
extern void i6554 (void) ; /* FPHLT 6554 */
extern void i6555 (void) ; /* FPST 6555 */
extern unsigned s6555 (void) ; /* FPST (skip test) */
extern void i6556 (void) ; /* FPRST 6556 */
extern void i6557 (void) ; /* FPIST 6557 */
extern unsigned s6557 (void) ; /* FPIST (skip test) */
extern void i6567 (void) ; /* FPEP 6567 */
extern void rxsel (void) ; /* SEL 6750 */
extern void rxlcd (void) ; /* LCD 6751 */
extern void rxxdr (void) ; /* XDR 6752 */
extern void rxstr (void) ; /* STR 6753 */
extern void rxser (void) ; /* SER 6754 */
extern void rxsdn (void) ; /* SDN 6755 */
extern void rxintr (void) ; /* INTR 6756 */
extern void rxinit (void) ; /* INIT 6757 */
/* -------------------------------------------------------------------- */

1095
Emulation/itab.c Normal file

File diff suppressed because it is too large Load Diff

25
Emulation/itab.h Normal file
View File

@ -0,0 +1,25 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* itab.h - The PDP-8/E instruction table
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
extern void (*itab[])(void);

587
Emulation/mri.c Normal file
View File

@ -0,0 +1,587 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* mri.c - MRI instructions code for the PDP-8/E
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* EMUL-8: a pdp8e emulator.
*
* Author:
* Bill Haygood
* 41832 Ernest Road
* Loon Lake, WA 99148-9607
* Internet: billh@comtch.iea.com
* Voice/AnsMach/FAX \
* or 509-233-2555
* Cellular/Pager /
*
* Copyright 1992, 1993, 1994 by the author with all rights reserved.
*
* Memory Reference Instruction (MRI) module.
*/
#import <Cocoa/Cocoa.h>
#define USE_PDP8_REGISTERS_DIRECTLY 1
#include "PDP8.h"
#include "mri.h"
#include "pdp8defines.h"
/* -------------------------------------------------------------------- */
VOID i0000 (VOID)
{
AC &= *(base + (IF + INST)) | 010000 ;
EXECUTION_TIME (26);
}
/* -------------------------------------------------------------------- */
VOID i0200 (VOID)
{
AC &= *(base + (IF | (PC & 07600) | (INST & 0177))) | 010000 ;
EXECUTION_TIME (26);
}
/* -------------------------------------------------------------------- */
VOID i0400 (VOID)
{
AC &= *(base + (DF | *(base + (IF | (INST & 0177))))) | 010000 ;
EXECUTION_TIME (38);
}
/* -------------------------------------------------------------------- */
VOID i0410 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
AC &= *(base + (DF | (*p = (*p + 1) & 07777))) | 010000 ;
EXECUTION_TIME (40);
}
/* -------------------------------------------------------------------- */
VOID i0600 (VOID)
{
AC &= *(base + (DF | *(base + (IF | (PC & 07600)
| (INST & 0177))))) | 010000 ;
EXECUTION_TIME (38);
}
/* -------------------------------------------------------------------- */
VOID i0610 (VOID)
{
REG UINT page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (INST & 0177)) ;
if (!page && (++*p & 010000))
*p &= 07777 ;
AC &= *(base + (DF | *p)) | 010000 ;
EXECUTION_TIME (page ? 38 : 40);
}
/* -------------------------------------------------------------------- */
VOID i1000 (VOID)
{
AC = (AC + *(base + (IF | (INST & 0177)))) & 017777 ;
EXECUTION_TIME (26);
}
/* -------------------------------------------------------------------- */
VOID i1200 (VOID)
{
AC = (AC + *(base + (IF | (PC & 07600) | (INST & 0177)))) & 017777 ;
EXECUTION_TIME (26);
}
/* -------------------------------------------------------------------- */
VOID i1400 (VOID)
{
AC = (AC + *(base + (DF | *(base + (IF | (INST & 0177)))))) & 017777 ;
EXECUTION_TIME (38);
}
/* -------------------------------------------------------------------- */
VOID i1410 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
AC = (AC + *(base + (DF | (*p = (*p + 1) & 07777)))) & 017777 ;
EXECUTION_TIME (40);
}
/* -------------------------------------------------------------------- */
VOID i1600 (VOID)
{
AC = (AC + *(base + (DF | *(base + (IF | (PC & 07600)
| (INST & 0177)))))) & 017777 ;
EXECUTION_TIME (38);
}
/* -------------------------------------------------------------------- */
VOID i1610 (VOID)
{
REG UINT page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (INST & 0177)) ;
if (!page && (++*p & 010000))
*p &= 07777 ;
AC = (AC + *(base + (DF | *p))) & 017777 ;
EXECUTION_TIME (page ? 38 : 40);
}
/* -------------------------------------------------------------------- */
VOID i2000 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
if (!(*p = (*p + 1) & 07777))
++PC ;
EXECUTION_TIME (26);
}
unsigned s2000 (VOID)
{
REG UWORD *p = base + (IF | (base[IF | PC] & 0177));
/* Don´t use INST but pdp8.mem[pdp8.IF | pdp8.PC] because
state.currInst is not set up for skip tests */
return (!((*p + 1) & 07777));
}
/* -------------------------------------------------------------------- */
VOID i2200 (VOID)
{
REG UWORD *p = base + (IF | (PC & 07600) | (INST & 0177)) ;
if (!(*p = (*p + 1) & 07777))
++PC ;
EXECUTION_TIME (26);
}
unsigned s2200 (VOID)
{
REG UWORD *p = base + (IF | (PC & 07600) | (base[IF | PC] & 0177)) ;
return (!((*p + 1) & 07777));
}
/* -------------------------------------------------------------------- */
VOID i2400 (VOID)
{
REG UWORD addr = base[IF | (INST & 0177)];
REG UWORD *p = base + (DF | addr);
REG UWORD *wp = base + (W_DF | addr);
*wp = (*p + 1) & 07777;
if (! *wp) /* MB is checked, no re-read from memory */
PC++;
EXECUTION_TIME (38);
}
unsigned s2400 (VOID)
{
REG UWORD addr = base[IF | (base[IF | PC] & 0177)];
REG UWORD *p = base + (DF | addr);
return (! ((*p + 1) & 07777));
}
/* -------------------------------------------------------------------- */
VOID i2410 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
REG UWORD *wp;
*p = (*p + 1) & 07777 ;
wp = base + (W_DF | *p);
p = base + (DF | *p) ;
*wp = (*p + 1) & 07777;
if (! *wp) /* MB is checked, no re-read from memory */
++PC ;
EXECUTION_TIME (40);
}
unsigned s2410 (VOID)
{
REG UWORD *p = base + (IF | (base[IF | PC] & 0177)) ;
REG UWORD *pp;
REG UWORD inc;
pp = base + (DF | ((*p + 1) & 07777)) ;
inc = (pp == p) ? 1 : 0;
return (! ((*pp + 1 + inc) & 07777));
}
/* -------------------------------------------------------------------- */
VOID i2600 (VOID)
{
REG UWORD addr = base[IF | (PC & 07600) | (INST & 0177)];
REG UWORD *p = base + (DF | addr);
REG UWORD *wp = base + (W_DF | addr);
*wp = (*p + 1) & 07777;
if (! *wp) /* MB is checked, no re-read from memory */
++PC ;
EXECUTION_TIME (38);
}
unsigned s2600 (VOID)
{
REG UWORD addr = base[IF | (PC & 07600) | (base[IF | PC] & 0177)];
REG UWORD *p = base + (DF | addr);
return (! ((*p + 1) & 07777));
}
/* -------------------------------------------------------------------- */
VOID i2610 (VOID)
{
REG UWORD page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (INST & 0177)) ;
REG UWORD *wp;
if (!page)
*p = (*p + 1) & 07777 ;
wp = base + (W_DF | *p);
p = base + (DF | *p) ;
*wp = (*p + 1) & 07777;
if (! *wp) /* MB is checked, no re-read from memory */
++PC;
EXECUTION_TIME (page ? 38 : 40);
}
unsigned s2610 (VOID)
{
REG UWORD page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (base[IF | PC] & 0177)) ;
REG UWORD *pp;
REG UWORD inc;
if (!page) {
pp = base + (DF | ((*p + 1) & 07777)) ;
inc = (pp == p) ? 1 : 0;
} else {
pp = base + (DF | *p) ;
inc = 0;
}
return (! ((*pp + 1 + inc) & 07777));
}
/* -------------------------------------------------------------------- */
VOID i3000 (VOID)
{
*(base + (IF | (INST & 0177))) = AC & 07777 ;
AC &= 010000 ;
EXECUTION_TIME (26);
}
/* -------------------------------------------------------------------- */
VOID i3200 (VOID)
{
*(base + (IF | (PC & 07600) | (INST & 0177))) = AC & 07777 ;
AC &= 010000 ;
EXECUTION_TIME (26);
}
/* -------------------------------------------------------------------- */
VOID i3400 (VOID)
{
*(base + (W_DF | *(base + (IF | (INST & 0177))))) = AC & 07777 ;
AC &= 010000 ;
EXECUTION_TIME (38);
}
/* -------------------------------------------------------------------- */
VOID i3410 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
*p = ++*p & 07777 ;
*(base + (W_DF | *p)) = AC & 07777 ;
AC &= 010000 ;
EXECUTION_TIME (40);
}
/* -------------------------------------------------------------------- */
VOID i3600 (VOID)
{
*(base + (W_DF | *(base + (IF | (PC & 07600) | (INST & 0177)))))
= AC & 07777 ;
AC &= 010000 ;
EXECUTION_TIME (38);
}
/* -------------------------------------------------------------------- */
VOID i3610 (VOID)
{
REG UINT page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (INST & 0177)) ;
if (!page)
*p = (*p + 1) & 07777 ;
*(base + (W_DF | *p)) = AC & 07777 ;
AC &= 010000 ;
EXECUTION_TIME (page ? 38 : 40);
}
/* -------------------------------------------------------------------- */
VOID i4000 (VOID)
{
REG UINT temp = INST & 0177 ;
*(base + (W_IB | temp)) = (PC + 1) & 07777 ;
PC = temp ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (26);
}
VOID u4000 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
PC = INST & 0177;
EXECUTION_TIME (26);
} else
i4000 ();
}
/* -------------------------------------------------------------------- */
VOID i4200 (VOID)
{
REG UINT temp = (PC & 07600) | (INST & 0177) ;
*(base + (W_IB | temp)) = (PC + 1) & 07777 ;
PC = temp ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (26);
}
VOID u4200 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
PC = (PC & 07600) | (INST & 0177);
EXECUTION_TIME (26);
} else
i4200 ();
}
/* -------------------------------------------------------------------- */
VOID i4400 (VOID)
{
REG UINT temp = *(base + (IF | (INST & 0177))) ;
*(base + (W_IB | temp )) = (PC + 1) & 07777 ;
PC = temp ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (38);
}
VOID u4400 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
PC = *(base + (IF | (INST & 0177)));
EXECUTION_TIME (38);
} else
i4400 ();
}
/* -------------------------------------------------------------------- */
VOID i4410 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
*(base + (W_IB | (*p = (*p + 1) & 07777))) = (PC + 1) & 07777 ;
PC = *p ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (40);
}
VOID u4410 (VOID) /* user mode with TSC8-75 */
/* this opcode is not checked by the TSC8.SV hardware diagnostics */
{
REG UWORD *p;
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
p = base + (IF | (INST & 0177));
PC = *p = (*p + 1) & 07777;
EXECUTION_TIME (40);
} else
i4410 ();
}
/* -------------------------------------------------------------------- */
VOID i4600 (VOID)
{
REG UINT temp = *(base + (IF | (PC & 07600) | (INST & 0177))) ;
*(base + (W_IB | temp)) = (PC + 1) & 07777 ;
PC = temp ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (38);
}
VOID u4600 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
PC = *(base + (IF | (PC & 07600) | (INST & 0177)));
EXECUTION_TIME (38);
} else
i4600 ();
}
/* -------------------------------------------------------------------- */
VOID i4610 (VOID)
{
REG UINT page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (INST & 0177)) ;
if (!page)
*p = (*p + 1) & 07777 ;
*(base + (W_IB | *p)) = (PC + 1) & 07777 ;
PC = *p ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (page ? 38 : 40);
}
VOID u4610 (VOID) /* user mode with TSC8-75 */
/* the TSC8.SV hardware diagnostics doesn´t check this opcode at the autoincrement memory locations */
{
REG UINT page;
REG UWORD *p;
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
page = PC & 07600;
p = base + (IF | page | (INST & 0177));
if (! page)
*p = (*p + 1) & 07777;
PC = *p;
EXECUTION_TIME (page ? 38 : 40);
} else
i4610 ();
}
/* -------------------------------------------------------------------- */
VOID i5000 (VOID)
{
PC = (INST & 0177) - 1 ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (12);
}
VOID u5000 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
}
i5000 ();
}
/* -------------------------------------------------------------------- */
VOID i5200 (VOID)
{
PC = ((PC & 07600) | (INST & 0177)) - 1 ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (12);
}
VOID u5200 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
}
i5200 ();
}
/* -------------------------------------------------------------------- */
VOID i5400 (VOID)
{
PC = *(base + (IF | (INST & 0177))) - 1 ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (24);
}
VOID u5400 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
}
i5400 ();
}
/* -------------------------------------------------------------------- */
VOID i5410 (VOID)
{
REG UWORD *p = base + (IF | (INST & 0177)) ;
PC = *p ;
*p = (*p + 1) & 07777 ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (26);
}
VOID u5410 (VOID) /* user mode with TSC8-75 */
/* this opcode is not checked by the TSC8.SV hardware diagnostics */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
}
i5410 ();
}
/* -------------------------------------------------------------------- */
VOID i5600 (VOID)
{
PC = *(base + (IF | (PC & 07600) | (INST & 0177))) - 1 ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (24);
}
VOID u5600 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
}
i5600 ();
}
/* -------------------------------------------------------------------- */
VOID i5610 (VOID)
{
REG UINT page = PC & 07600 ;
REG UWORD *p = base + (IF | page | (INST & 0177)) ;
if (!page)
*p = (*p + 1) & 07777 ;
PC = *p - 1 ;
IF = IB ;
if (hw.hasKM8Etimesharing)
UF = UB ;
int_inh = false ;
EXECUTION_TIME (page ? 24 : 26);
}
VOID u5610 (VOID) /* user mode with TSC8-75 */
{
tsc8.eriot = INST;
tsc8.ecdf = 0;
if (int_mask & tsc8.flag) {
tsc8.ertb = PC;
io_flags |= tsc8.flag;
}
i5610 ();
}
/* -------------------------------------------------------------------- */

95
Emulation/mri.h Normal file
View File

@ -0,0 +1,95 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* mri.h - Interface for the MRI instructions code for the PDP-8/E
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* EMUL-8: a pdp8e emulator.
*
* Author:
* Bill Haygood
* 41832 Ernest Road
* Loon Lake, WA 99148-9607
* Internet: billh@comtch.iea.com
* Voice/AnsMach/FAX \
* or 509-233-2555
* Cellular/Pager /
*
* Copyright 1992, 1993, 1994 by the author with all rights reserved.
*
* Memory Reference Instruction (MRI) module.
*/
/* -------------------------------------------------------------------- */
extern void i0000 (void) ;
extern void i0200 (void) ;
extern void i0400 (void) ;
extern void i0410 (void) ;
extern void i0600 (void) ;
extern void i0610 (void) ;
extern void i1000 (void) ;
extern void i1200 (void) ;
extern void i1400 (void) ;
extern void i1410 (void) ;
extern void i1600 (void) ;
extern void i1610 (void) ;
extern void i2000 (void) ;
extern unsigned s2000 (void) ;
extern void i2200 (void) ;
extern unsigned s2200 (void) ;
extern void i2400 (void) ;
extern unsigned s2400 (void) ;
extern void i2410 (void) ;
extern unsigned s2410 (void) ;
extern void i2600 (void) ;
extern unsigned s2600 (void) ;
extern void i2610 (void) ;
extern unsigned s2610 (void) ;
extern void i3000 (void) ;
extern void i3200 (void) ;
extern void i3400 (void) ;
extern void i3410 (void) ;
extern void i3600 (void) ;
extern void i3610 (void) ;
extern void i4000 (void) ;
extern void u4000 (void) ;
extern void i4200 (void) ;
extern void u4200 (void) ;
extern void i4400 (void) ;
extern void u4400 (void) ;
extern void i4410 (void) ;
extern void u4410 (void) ;
extern void i4600 (void) ;
extern void u4600 (void) ;
extern void i4610 (void) ;
extern void u4610 (void) ;
extern void i5000 (void) ;
extern void u5000 (void) ;
extern void i5200 (void) ;
extern void u5200 (void) ;
extern void i5400 (void) ;
extern void u5400 (void) ;
extern void i5410 (void) ;
extern void u5410 (void) ;
extern void i5600 (void) ;
extern void u5600 (void) ;
extern void i5610 (void) ;
extern void u5610 (void) ;
/* -------------------------------------------------------------------- */

3062
Emulation/opr.c Normal file

File diff suppressed because it is too large Load Diff

472
Emulation/opr.h Normal file
View File

@ -0,0 +1,472 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* opr.h - Interface for the operate instructions code for the PDP-8/E
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* EMUL-8: a pdp8e emulator.
*
* Author:
* Bill Haygood
* 41832 Ernest Road
* Loon Lake, WA 99148-9607
* Internet: billh@comtch.iea.com
* Voice/AnsMach/FAX \
* or 509-233-2555
* Cellular/Pager /
*
* Copyright 1992, 1993, 1994 by the author with all rights reserved.
*
* Include file for Operate microinstruction (OPR) module
* for all OPRs except EAE.
*/
/* -------------------------------------------------------------------- */
extern void i7000 (void) ; /* NOP */
extern void i7001 (void) ; /* IAC */
extern void i7002 (void) ; /* BSW */
extern void i7003 (void) ; /* IAC BSW */
extern void i7004 (void) ; /* RAL */
extern void i7005 (void) ; /* IAC RAL */
extern void i7006 (void) ; /* RTL */
extern void i7007 (void) ; /* IAC RTL */
extern void i7010 (void) ; /* RAR */
extern void i7011 (void) ; /* IAC RAR */
extern void i7012 (void) ; /* RTR */
extern void i7013 (void) ; /* IAC RTR */
extern void i7014 (void) ; /* RAR RAL (reserved) */
extern void i7015 (void) ; /* IAC RAR RAL (reserved) */
extern void i7016 (void) ; /* RTR RTL (reserved) */
extern void i7017 (void) ; /* IAC RTR RTL (reserved) */
extern void i7020 (void) ; /* CML */
extern void i7021 (void) ; /* CML IAC */
extern void i7022 (void) ; /* CML BSW */
extern void i7023 (void) ; /* CML IAC BSW */
extern void i7024 (void) ; /* CML RAL */
extern void i7025 (void) ; /* CML IAC RAL */
extern void i7026 (void) ; /* CML RTL */
extern void i7027 (void) ; /* CML IAC RTL */
extern void i7030 (void) ; /* CML RAR */
extern void i7031 (void) ; /* CML IAC RAR */
extern void i7032 (void) ; /* CML RTR */
extern void i7033 (void) ; /* CML IAC RTR */
extern void i7034 (void) ; /* CML RAR RAL (reserved) */
extern void i7035 (void) ; /* CML IAC RAR RAL (reserved) */
extern void i7036 (void) ; /* CML RTR RTL (reserved) */
extern void i7037 (void) ; /* CML IAC RTR RTL (reserved) */
extern void i7040 (void) ; /* CMA */
extern void i7041 (void) ; /* CMA IAC */
extern void i7042 (void) ; /* CMA BSW */
extern void i7043 (void) ; /* CMA IAC BSW */
extern void i7044 (void) ; /* CMA RAL */
extern void i7045 (void) ; /* CMA IAC RAL */
extern void i7046 (void) ; /* CMA RTL */
extern void i7047 (void) ; /* CMA IAC RTL */
extern void i7050 (void) ; /* CMA RAR */
extern void i7051 (void) ; /* CMA IAC RAR */
extern void i7052 (void) ; /* CMA RTR */
extern void i7053 (void) ; /* CMA IAC RTR */
extern void i7054 (void) ; /* CMA RAR RAL (reserved) */
extern void i7055 (void) ; /* CMA IAC RAR RAL (reserved) */
extern void i7056 (void) ; /* CMA RTR RTL (reserved) */
extern void i7057 (void) ; /* CMA IAC RTR RTL (reserved) */
extern void i7060 (void) ; /* CMA CML */
extern void i7061 (void) ; /* CMA CML IAC */
extern void i7062 (void) ; /* CMA CML BSW */
extern void i7063 (void) ; /* CMA CML IAC BSW */
extern void i7064 (void) ; /* CMA CML RAL */
extern void i7065 (void) ; /* CMA CML IAC RAL */
extern void i7066 (void) ; /* CMA CML RTL */
extern void i7067 (void) ; /* CMA CML IAC RTL */
extern void i7070 (void) ; /* CMA CML RAR */
extern void i7071 (void) ; /* CMA CML IAC RAR */
extern void i7072 (void) ; /* CMA CML RTR */
extern void i7073 (void) ; /* CMA CML IAC RTR */
extern void i7074 (void) ; /* CMA CML RAR RAL (reserved) */
extern void i7075 (void) ; /* CMA CML IAC RAR RAL */
extern void i7076 (void) ; /* CMA CML RTR RTL (reserved) */
extern void i7077 (void) ; /* CMA CML IAC RTR RTL */
extern void i7100 (void) ; /* CLL */
extern void i7101 (void) ; /* CLL IAC */
extern void i7102 (void) ; /* CLL BSW */
extern void i7103 (void) ; /* CLL IAC BSW */
extern void i7104 (void) ; /* CLL RAL */
extern void i7105 (void) ; /* CLL IAC RAL */
extern void i7106 (void) ; /* CLL RTL */
extern void i7107 (void) ; /* CLL IAC RTL */
extern void i7110 (void) ; /* CLL RAR */
extern void i7111 (void) ; /* CLL IAC RAR */
extern void i7112 (void) ; /* CLL RTR */
extern void i7113 (void) ; /* CLL IAC RTR */
extern void i7114 (void) ; /* CLL RAR RAL (reserved) */
extern void i7115 (void) ; /* CLL IAC RAR RAL (reserved) */
extern void i7116 (void) ; /* CLL RTR RTL (reserved) */
extern void i7117 (void) ; /* CLL IAC RTR RTL (reserved) */
extern void i7120 (void) ; /* CLL CML */
extern void i7121 (void) ; /* CLL CML IAC */
extern void i7122 (void) ; /* CLL CML BSW */
extern void i7123 (void) ; /* CLL CML IAC BSW */
extern void i7124 (void) ; /* CLL CML RAL */
extern void i7125 (void) ; /* CLL CML IAC RAL */
extern void i7126 (void) ; /* CLL CML RTL */
extern void i7127 (void) ; /* CLL CML IAC RTL */
extern void i7130 (void) ; /* CLL CML RAR */
extern void i7131 (void) ; /* CLL CML IAC RAR */
extern void i7132 (void) ; /* CLL CML RTR */
extern void i7133 (void) ; /* CLL CML IAC RTR */
extern void i7134 (void) ; /* CLL CML RAR RAL (reserved) */
extern void i7135 (void) ; /* CLL CML IAC RAR RAL */
extern void i7136 (void) ; /* CLL CML RTR RTL (reserved) */
extern void i7137 (void) ; /* CLL CML IAC RTR RTL */
extern void i7140 (void) ; /* CLL CMA */
extern void i7141 (void) ; /* CLL CMA IAC */
extern void i7142 (void) ; /* CLL CMA BSW */
extern void i7143 (void) ; /* CLL CMA IAC BSW */
extern void i7144 (void) ; /* CLL CMA RAL */
extern void i7145 (void) ; /* CLL CMA IAC RAL */
extern void i7146 (void) ; /* CLL CMA RTL */
extern void i7147 (void) ; /* CLL CMA IAC RTL */
extern void i7150 (void) ; /* CLL CMA RAR */
extern void i7151 (void) ; /* CLL CMA IAC RAR */
extern void i7152 (void) ; /* CLL CMA RTR */
extern void i7153 (void) ; /* CLL CMA IAC RTR */
extern void i7154 (void) ; /* CLL CMA RAR RAL (reserved) */
extern void i7155 (void) ; /* CLL CMA IAC RAR RAL */
extern void i7156 (void) ; /* CLL CMA RTR RTL (reserved) */
extern void i7157 (void) ; /* CLL CMA IAC RTR RTL */
extern void i7160 (void) ; /* CLL CMA CML */
extern void i7161 (void) ; /* CLL CMA CML IAC */
extern void i7162 (void) ; /* CLL CMA CML BSW */
extern void i7163 (void) ; /* CLL CMA CML IAC BSW */
extern void i7164 (void) ; /* CLL CMA CML RAL */
extern void i7165 (void) ; /* CLL CMA CML IAC RAL */
extern void i7166 (void) ; /* CLL CMA CML RTL */
extern void i7167 (void) ; /* CLL CMA CML IAC RTL */
extern void i7170 (void) ; /* CLL CMA CML RAR */
extern void i7171 (void) ; /* CLL CMA CML IAC RAR */
extern void i7172 (void) ; /* CLL CMA CML RTR */
extern void i7173 (void) ; /* CLL CMA CML IAC RTR */
extern void i7174 (void) ; /* CLL CMA CML RAR RAL */
extern void i7175 (void) ; /* CLL CMA CML IAC RAR RAL */
extern void i7176 (void) ; /* CLL CMA CML RTR RTL */
extern void i7177 (void) ; /* CLL CMA CML IAC RTR RTL */
extern void i7200 (void) ; /* CLA */
extern void i7201 (void) ; /* CLA IAC */
extern void i7202 (void) ; /* CLA BSW */
extern void i7203 (void) ; /* CLA IAC BSW */
extern void i7204 (void) ; /* CLA RAL */
extern void i7205 (void) ; /* CLA IAC RAL */
extern void i7206 (void) ; /* CLA RTL */
extern void i7207 (void) ; /* CLA IAC RTL */
extern void i7210 (void) ; /* CLA RAR */
extern void i7211 (void) ; /* CLA IAC RAR */
extern void i7212 (void) ; /* CLA RTR */
extern void i7213 (void) ; /* CLA IAC RTR */
extern void i7214 (void) ; /* CLA RAR RAL (reserved) */
extern void i7215 (void) ; /* CLA IAC RAR RAL (reserved) */
extern void i7216 (void) ; /* CLA RTR RTL (reserved) */
extern void i7217 (void) ; /* CLA IAC RTR RTL (reserved) */
extern void i7220 (void) ; /* CLA CML */
extern void i7221 (void) ; /* CLA CML IAC */
extern void i7222 (void) ; /* CLA CML BSW */
extern void i7223 (void) ; /* CLA CML IAC BSW */
extern void i7224 (void) ; /* CLA CML RAL */
extern void i7225 (void) ; /* CLA CML IAC RAL */
extern void i7226 (void) ; /* CLA CML RTL */
extern void i7227 (void) ; /* CLA CML IAC RTL */
extern void i7230 (void) ; /* CLA CML RAR */
extern void i7231 (void) ; /* CLA CML IAC RAR */
extern void i7232 (void) ; /* CLA CML RTR */
extern void i7233 (void) ; /* CLA CML IAC RTR */
extern void i7234 (void) ; /* CLA CML RAR RAL (reserved) */
extern void i7235 (void) ; /* CLA CML IAC RAR RAL */
extern void i7236 (void) ; /* CLA CML RTR RTL (reserved) */
extern void i7237 (void) ; /* CLA CML IAC RTR RTL */
extern void i7240 (void) ; /* CLA CMA */
extern void i7241 (void) ; /* CLA CMA IAC */
extern void i7242 (void) ; /* CLA CMA BSW */
extern void i7243 (void) ; /* CLA CMA IAC BSW */
extern void i7244 (void) ; /* CLA CMA RAL */
extern void i7245 (void) ; /* CLA CMA IAC RAL */
extern void i7246 (void) ; /* CLA CMA RTL */
extern void i7247 (void) ; /* CLA CMA IAC RTL */
extern void i7250 (void) ; /* CLA CMA RAR */
extern void i7251 (void) ; /* CLA CMA IAC RAR */
extern void i7252 (void) ; /* CLA CMA RTR */
extern void i7253 (void) ; /* CLA CMA IAC RTR */
extern void i7254 (void) ; /* CLA CMA RAR RAL (reserved) */
extern void i7255 (void) ; /* CLA CMA IAC RAR RAL */
extern void i7256 (void) ; /* CLA CMA RTR RTL (reserved) */
extern void i7257 (void) ; /* CLA CMA IAC RTR RTL */
extern void i7260 (void) ; /* CLA CMA CML */
extern void i7261 (void) ; /* CLA CMA CML IAC */
extern void i7262 (void) ; /* CLA CMA CML BSW */
extern void i7263 (void) ; /* CLA CMA CML IAC BSW */
extern void i7264 (void) ; /* CLA CMA CML RAL */
extern void i7265 (void) ; /* CLA CMA CML IAC RAL */
extern void i7266 (void) ; /* CLA CMA CML RTL */
extern void i7267 (void) ; /* CLA CMA CML IAC RTL */
extern void i7270 (void) ; /* CLA CMA CML RAR */
extern void i7271 (void) ; /* CLA CMA CML IAC RAR */
extern void i7272 (void) ; /* CLA CMA CML RTR */
extern void i7273 (void) ; /* CLA CMA CML IAC RTR */
extern void i7274 (void) ; /* CLA CMA CML RAR RAL */
extern void i7275 (void) ; /* CLA CMA CML IAC RAR RAL */
extern void i7276 (void) ; /* CLA CMA CML RTR RTL */
extern void i7277 (void) ; /* CLA CMA CML IAC RTR RTL */
extern void i7300 (void) ; /* CLA CLL */
extern void i7301 (void) ; /* CLA CLL IAC */
extern void i7302 (void) ; /* CLA CLL BSW */
extern void i7303 (void) ; /* CLA CLL IAC BSW */
extern void i7304 (void) ; /* CLA CLL RAL */
extern void i7305 (void) ; /* CLA CLL IAC RAL */
extern void i7306 (void) ; /* CLA CLL RTL */
extern void i7307 (void) ; /* CLA CLL IAC RTL */
extern void i7310 (void) ; /* CLA CLL RAR */
extern void i7311 (void) ; /* CLA CLL IAC RAR */
extern void i7312 (void) ; /* CLA CLL RTR */
extern void i7313 (void) ; /* CLA CLL IAC RTR */
extern void i7314 (void) ; /* CLA CLL RAR RAL (reserved) */
extern void i7315 (void) ; /* CLA CLL IAC RAR RAL */
extern void i7316 (void) ; /* CLA CLL RTR RTL (reserved) */
extern void i7317 (void) ; /* CLA CLL IAC RTR RTL */
extern void i7320 (void) ; /* CLA CLL CML */
extern void i7321 (void) ; /* CLA CLL CML IAC */
extern void i7322 (void) ; /* CLA CLL CML BSW */
extern void i7323 (void) ; /* CLA CLL CML IAC BSW */
extern void i7324 (void) ; /* CLA CLL CML RAL */
extern void i7325 (void) ; /* CLA CLL CML IAC RAL */
extern void i7326 (void) ; /* CLA CLL CML RTL */
extern void i7327 (void) ; /* CLA CLL CML IAC RTL */
extern void i7330 (void) ; /* CLA CLL CML RAR */
extern void i7331 (void) ; /* CLA CLL CML IAC RAR */
extern void i7332 (void) ; /* CLA CLL CML RTR */
extern void i7333 (void) ; /* CLA CLL CML IAC RTR */
extern void i7334 (void) ; /* CLA CLL CML RAR RAL */
extern void i7335 (void) ; /* CLA CLL CML IAC RAR RAL */
extern void i7336 (void) ; /* CLA CLL CML RTR RTL */
extern void i7337 (void) ; /* CLA CLL CML IAC RTR RTL */
extern void i7340 (void) ; /* CLA CLL CMA */
extern void i7341 (void) ; /* CLA CLL CMA IAC */
extern void i7342 (void) ; /* CLA CLL CMA BSW */
extern void i7343 (void) ; /* CLA CLL CMA IAC BSW */
extern void i7344 (void) ; /* CLA CLL CMA RAL */
extern void i7345 (void) ; /* CLA CLL CMA IAC RAL */
extern void i7346 (void) ; /* CLA CLL CMA RTL */
extern void i7347 (void) ; /* CLA CLL CMA IAC RTL */
extern void i7350 (void) ; /* CLA CLL CMA RAR */
extern void i7351 (void) ; /* CLA CLL CMA IAC RAR */
extern void i7352 (void) ; /* CLA CLL CMA RTR */
extern void i7353 (void) ; /* CLA CLL CMA IAC RTR */
extern void i7354 (void) ; /* CLA CLL CMA RAR RAL */
extern void i7355 (void) ; /* CLA CLL CMA IAC RAR RAL */
extern void i7356 (void) ; /* CLA CLL CMA RTR RTL */
extern void i7357 (void) ; /* CLA CLL CMA IAC RTR RTL */
extern void i7360 (void) ; /* CLA CLL CMA CML */
extern void i7361 (void) ; /* CLA CLL CMA CML IAC */
extern void i7362 (void) ; /* CLA CLL CMA CML BSW */
extern void i7363 (void) ; /* CLA CLL CMA CML IAC BSW */
extern void i7364 (void) ; /* CLA CLL CMA CML RAL */
extern void i7365 (void) ; /* CLA CLL CMA CML IAC RAL */
extern void i7366 (void) ; /* CLA CLL CMA CML RTL */
extern void i7367 (void) ; /* CLA CLL CMA CML IAC RTL */
extern void i7370 (void) ; /* CLA CLL CMA CML RAR */
extern void i7371 (void) ; /* CLA CLL CMA CML IAC RAR */
extern void i7372 (void) ; /* CLA CLL CMA CML RTR */
extern void i7373 (void) ; /* CLA CLL CMA CML IAC RTR */
extern void i7374 (void) ; /* CLA CLL CMA CML RAR RAL */
extern void i7375 (void) ; /* CLA CLL CMA CML IAC RAR RAL */
extern void i7376 (void) ; /* CLA CLL CMA CML RTR RTL */
extern void i7377 (void) ; /* CLA CLL CMA CML IAC RTR RTL */
extern void i7400 (void) ; /* NOP Grp II */
extern void i7402 (void) ; /* HLT */
extern void i7404 (void) ; /* OSR */
extern void i7406 (void) ; /* OSR HLT */
extern void i7410 (void) ; /* SKP */
extern unsigned s7410 (void) ; /* SKP (skip test) */
extern void i7412 (void) ; /* SKP HLT */
extern void u7412 (void) ; /* SKP HLT (user mode) */
extern void i7414 (void) ; /* SKP OSR */
extern void i7416 (void) ; /* SKP OSR HLT */
extern void i7420 (void) ; /* SNL */
extern unsigned s7420 (void) ; /* SNL (skip test) */
extern void i7422 (void) ; /* SNL HLT */
extern void u7422 (void) ; /* SNL HLT (user mode) */
extern void i7424 (void) ; /* SNL OSR */
extern void i7426 (void) ; /* SNL OSR HLT */
extern void i7430 (void) ; /* SZL */
extern unsigned s7430 (void) ; /* SZL (skipt test) */
extern void i7432 (void) ; /* SZL HLT */
extern void u7432 (void) ; /* SZL HLT (user mode) */
extern void i7434 (void) ; /* SZL OSR */
extern void i7436 (void) ; /* SZL OSR HLT */
extern void i7440 (void) ; /* SZA */
extern unsigned s7440 (void) ; /* SZA (skip test) */
extern void i7442 (void) ; /* SZA HLT */
extern void u7442 (void) ; /* SZA HLT (user mode) */
extern void i7444 (void) ; /* SZA OSR */
extern void i7446 (void) ; /* SZA OSR HLT */
extern void i7450 (void) ; /* SNA */
extern unsigned s7450 (void) ; /* SNA (skip test) */
extern void i7452 (void) ; /* SNA HLT */
extern void u7452 (void) ; /* SNA HLT (user mode) */
extern void i7454 (void) ; /* SNA OSR */
extern void i7456 (void) ; /* SNA OSR HLT */
extern void i7460 (void) ; /* SZA SNL */
extern unsigned s7460 (void) ; /* SZA SNL (skip test) */
extern void i7462 (void) ; /* SZA SNL HLT */
extern void u7462 (void) ; /* SZA SNL HLT (user mode) */
extern void i7464 (void) ; /* SZA SNL OSR */
extern void i7466 (void) ; /* SZA SNL OSR HLT */
extern void i7470 (void) ; /* SNA SZL */
extern unsigned s7470 (void) ; /* SNA SZL (skip test) */
extern void i7472 (void) ; /* SNA SZL HLT */
extern void u7472 (void) ; /* SNA SZL HLT (user mode) */
extern void i7474 (void) ; /* SNA SZL OSR */
extern void i7476 (void) ; /* SNA SZL OSR HLT */
extern void i7500 (void) ; /* SMA */
extern unsigned s7500 (void) ; /* SMA (skip test) */
extern void i7502 (void) ; /* SMA HLT */
extern void u7502 (void) ; /* SMA HLT (user mode) */
extern void i7504 (void) ; /* SMA OSR */
extern void i7506 (void) ; /* SMA OSR HLT */
extern void i7510 (void) ; /* SPA */
extern unsigned s7510 (void) ; /* SPA (skip test) */
extern void i7512 (void) ; /* SPA HLT */
extern void u7512 (void) ; /* SPA HLT (user mode) */
extern void i7514 (void) ; /* SPA OSR */
extern void i7516 (void) ; /* SPA OSR HLT */
extern void i7520 (void) ; /* SMA SNL */
extern unsigned s7520 (void) ; /* SMA SNL (skip test) */
extern void i7522 (void) ; /* SMA SNL HLT */
extern void u7522 (void) ; /* SMA SNL HLT (user mode) */
extern void i7524 (void) ; /* SMA SNL OSR */
extern void i7526 (void) ; /* SMA SNL OSR HLT */
extern void i7530 (void) ; /* SPA SZL */
extern unsigned s7530 (void) ; /* SPA SZL (skip test) */
extern void i7532 (void) ; /* SPA SZL HLT */
extern void u7532 (void) ; /* SPA SZL HLT (user mode) */
extern void i7534 (void) ; /* SPA SZL OSR */
extern void i7536 (void) ; /* SPA SZL OSR HLT */
extern void i7540 (void) ; /* SMA SZA */
extern unsigned s7540 (void) ; /* SMA SZA (skip test) */
extern void i7542 (void) ; /* SMA SZA HLT */
extern void u7542 (void) ; /* SMA SZA HLT (user mode) */
extern void i7544 (void) ; /* SMA SZA OSR */
extern void i7546 (void) ; /* SMA SZA OSR HLT */
extern void i7550 (void) ; /* SPA SNA */
extern unsigned s7550 (void) ; /* SPA SNA (skip test) */
extern void i7552 (void) ; /* SPA SNA HLT */
extern void u7552 (void) ; /* SPA SNA HLT (user mode) */
extern void i7554 (void) ; /* SPA SNA OSR */
extern void i7556 (void) ; /* SPA SNA OSR HLT */
extern void i7560 (void) ; /* SMA SZA SNL */
extern unsigned s7560 (void) ; /* SMA SZA SNL (skip test) */
extern void i7562 (void) ; /* SMA SZA SNL HLT */
extern void u7562 (void) ; /* SMA SZA SNL HLT (user mode) */
extern void i7564 (void) ; /* SMA SZA SNL OSR */
extern void i7566 (void) ; /* SMA SZA SNL OSR HLT */
extern void i7570 (void) ; /* SPA SNA SZL */
extern unsigned s7570 (void) ; /* SPA SNA SZL (skip test) */
extern void i7572 (void) ; /* SPA SNA SZL HLT */
extern void u7572 (void) ; /* SPA SNA SZL HLT (user mode) */
extern void i7574 (void) ; /* SPA SNA SZL OSR */
extern void i7576 (void) ; /* SPA SNA SZL OSR HLT */
extern void i7600 (void) ; /* CLA Grp II */
extern void i7602 (void) ; /* CLA HLT */
extern void u7602 (void) ; /* CLA HLT (user mode) */
extern void i7604 (void) ; /* CLA OSR */
extern void i7606 (void) ; /* CLA OSR HLT */
extern void i7610 (void) ; /* SKP CLA */
extern void i7612 (void) ; /* SKP CLA HLT */
extern void u7612 (void) ; /* SKP CLA HLT (user mode) */
extern void i7614 (void) ; /* SKP CLA OSR */
extern void i7616 (void) ; /* SKP CLA OSR HLT */
extern void i7620 (void) ; /* SNL CLA */
extern void i7622 (void) ; /* SNL CLA HLT */
extern void u7622 (void) ; /* SNL CLA HLT (user mode) */
extern void i7624 (void) ; /* SNL CLA OSR */
extern void i7626 (void) ; /* SNL CLA OSR HLT */
extern void i7630 (void) ; /* SZL CLA */
extern void i7632 (void) ; /* SZL CLA HLT */
extern void u7632 (void) ; /* SZL CLA HLT (user mode) */
extern void i7634 (void) ; /* SZL CLA OSR */
extern void i7636 (void) ; /* SZL CLA OSR HLT */
extern void i7640 (void) ; /* SZA CLA */
extern void i7642 (void) ; /* SZA CLA HLT */
extern void u7642 (void) ; /* SZA CLA HLT (user mode) */
extern void i7644 (void) ; /* SZA CLA OSR */
extern void i7646 (void) ; /* SZA CLA OSR HLT */
extern void i7650 (void) ; /* SNA CLA */
extern void i7652 (void) ; /* SNA CLA HLT */
extern void u7652 (void) ; /* SNA CLA HLT (user mode) */
extern void i7654 (void) ; /* SNA CLA OSR */
extern void i7656 (void) ; /* SNA CLA OSR HLT */
extern void i7660 (void) ; /* SZA SNL CLA */
extern void i7662 (void) ; /* SZA SNL CLA HLT */
extern void u7662 (void) ; /* SZA SNL CLA HLT (user mode) */
extern void i7664 (void) ; /* SZA SNL CLA OSR */
extern void i7666 (void) ; /* SZA SNL CLA OSR HLT */
extern void i7670 (void) ; /* SNA SZL CLA */
extern void i7672 (void) ; /* SNA SZL CLA HLT */
extern void u7672 (void) ; /* SNA SZL CLA HLT (user mode) */
extern void i7674 (void) ; /* SNA SZL CLA OSR */
extern void i7676 (void) ; /* SNA SZL CLA OSR HLT */
extern void i7700 (void) ; /* SMA CLA */
extern void i7702 (void) ; /* SMA CLA HLT */
extern void u7702 (void) ; /* SMA CLA HLT */
extern void i7704 (void) ; /* SMA CLA OSR */
extern void i7706 (void) ; /* SMA CLA OSR HLT */
extern void i7710 (void) ; /* SPA CLA */
extern void i7712 (void) ; /* SPA CLA HLT */
extern void u7712 (void) ; /* SPA CLA HLT (user mode) */
extern void i7714 (void) ; /* SPA CLA OSR */
extern void i7716 (void) ; /* SPA CLA OSR HLT */
extern void i7720 (void) ; /* SMA SNL CLA */
extern void i7722 (void) ; /* SMA SNL CLA HLT */
extern void u7722 (void) ; /* SMA SNL CLA HLT (user mode) */
extern void i7724 (void) ; /* SMA SNL CLA OSR */
extern void i7726 (void) ; /* SMA SNL CLA OSR HLT */
extern void i7730 (void) ; /* SPA SZL CLA */
extern void i7732 (void) ; /* SPA SZL CLA HLT */
extern void u7732 (void) ; /* SPA SZL CLA HLT (user mode) */
extern void i7734 (void) ; /* SPA SZL CLA OSR */
extern void i7736 (void) ; /* SPA SZL CLA OSR HLT */
extern void i7740 (void) ; /* SMA SZA CLA */
extern void i7742 (void) ; /* SMA SZA CLA HLT */
extern void u7742 (void) ; /* SMA SZA CLA HLT (user mode) */
extern void i7744 (void) ; /* SMA SZA CLA OSR */
extern void i7746 (void) ; /* SMA SZA CLA OSR HLT */
extern void i7750 (void) ; /* SPA SNA CLA */
extern void i7752 (void) ; /* SPA SNA CLA HLT */
extern void u7752 (void) ; /* SPA SNA CLA HLT (user mode) */
extern void i7754 (void) ; /* SPA SNA CLA OSR */
extern void i7756 (void) ; /* SPA SNA CLA OSR HLT */
extern void i7760 (void) ; /* SMA SZA SNL CLA */
extern void i7762 (void) ; /* SMA SZA SNL CLA HLT */
extern void u7762 (void) ; /* SMA SZA SNL CLA HLT */
extern void i7764 (void) ; /* SMA SZA SNL CLA OSR */
extern void i7766 (void) ; /* SMA SZA SNL CLA OSR HLT */
extern void i7770 (void) ; /* SPA SNA SZL CLA */
extern void i7772 (void) ; /* SPA SNA SZL CLA HLT */
extern void u7772 (void) ; /* SPA SNA SZL CLA HLT */
extern void i7774 (void) ; /* SPA SNA SZL CLA OSR */
extern void i7776 (void) ; /* SPA SNA SZL CLA OSR HLT */
/* -------------------------------------------------------------------- */

80
Emulation/pdp8defines.h Normal file
View File

@ -0,0 +1,80 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* pdp8defines.h - #defines making the PDP8 class from
* PDP8.h compatible to Bill Haygoods pdp8
* instruction execution routines
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Types */
#define VOID void
#define REG register
#define UWORD unsigned short
#define ULONG unsigned long
#define LONG long
#define INT short
#define UINT unsigned short
#define BYTE char
#define UBYTE unsigned char
/* Attributes of the PDP8 class */
#define base (pdp8->mem)
#define SR (pdp8->SR)
#define AC (pdp8->AC)
#define PC (pdp8->PC)
#define SC (pdp8->SC)
#define MQ (pdp8->MQ)
#define GTF (pdp8->GTF)
#define IF (pdp8->IF)
#define IB (pdp8->IB)
#define W_IB (pdp8->W_IB)
#define DF (pdp8->DF)
#define W_DF (pdp8->W_DF)
#define UF (pdp8->UF)
#define UB (pdp8->UB)
#define SF (pdp8->SF)
#define int_ena (pdp8->IENABLE)
#define int_inh (pdp8->IINHIBIT)
#define delay (pdp8->IDELAY)
#define io_flags (pdp8->IOFLAGS)
#define int_mask (pdp8->IMASK)
#define EAE (pdp8->eaeMode)
#define tsc8 (pdp8->_tsc8)
#define hw (pdp8->_hw)
#define INST (pdp8->_state.currInst)
#define run (pdp8->_state.running)
/* The 12 bits of a PDP-8 word are numered 0-11 from left to right.
The following defines reflect this numbering. */
#define BIT0 04000
#define BIT1 02000
#define BIT2 01000
#define BIT3 00400
#define BIT4 00200
#define BIT5 00100
#define BIT6 00040
#define BIT7 00020
#define BIT8 00010
#define BIT9 00004
#define BIT10 00002
#define BIT11 00001

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>NSControl</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSView</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key></key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSPreferencePane</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>_firstKeyView</key>
<string>NSView</string>
<key>_initialKeyView</key>
<string>NSView</string>
<key>_lastKeyView</key>
<string>NSView</string>
<key>_window</key>
<string>NSWindow</string>
</dict>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>GeneralPreferences</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSPreferencePane</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>644</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../pdp8e-simulator.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>67</integer>
</array>
<key>IBSystem Version</key>
<string>9C31</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>

View File

@ -0,0 +1,35 @@
{
IBClasses = (
{
ACTIONS = {"" = id; };
CLASS = FirstResponder;
LANGUAGE = ObjC;
SUPERCLASS = NSObject;
},
{
ACTIONS = {driftChange = id; goSpeedClick = id; traceSpeedChange = id; };
CLASS = GeneralPreferences;
LANGUAGE = ObjC;
OUTLETS = {
driftSlider = NSSlider;
driftSliderLeftLabel = NSTextField;
driftSliderRightLabel = NSTextField;
goSpeedRadiobuttons = NSMatrix;
traceSpeedSlider = NSSlider;
};
SUPERCLASS = NSPreferencePane;
},
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = NSView;
"_initialKeyView" = NSView;
"_lastKeyView" = NSView;
"_window" = NSWindow;
};
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>156 102 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* InfoPlist.strings - Localized strings for General preference pane Info.plist
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
NSPrefPaneIconLabel = "General";
PrefPaneWindowTitle = "General Preferences";

View File

@ -0,0 +1,26 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* GeneralPreferences.h - General Preferences Pane
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define GENERAL_PREFS_TRACE_SPEED_KEY @"TraceSpeed"
#define GENERAL_PREFS_GO_SPEED_KEY @"GoSpeed"

View File

@ -0,0 +1,41 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* GeneralPreferences.m - General Preferences Pane
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <PreferencePanes/PreferencePanes.h>
#import "GeneralPreferences.h"
@interface GeneralPreferences : NSPreferencePane
{
}
@end
@implementation GeneralPreferences
// empty class, otherwise the preference pane bundle has no loadable code and does not load
@end

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>de.bernhard-baehr.pdp8e.GeneralPreferences</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.2</string>
<key>CFBundleShortVersionString</key>
<string>2.0.2</string>
<key>NSMainNibFile</key>
<string>GeneralPreferences</string>
<key>NSPrefPaneIconFile</key>
<string>generalPrefIcon.tiff</string>
<key>NSPrefPaneIconLabel</key>
<string>General</string>
<key>NSPrincipalClass</key>
<string>GeneralPreferences</string>
<key>OrderInPreferencesPanelToolbar</key>
<string>01</string>
<key>PrefPaneWindowTitle</key>
<string>General Preferences</string>
</dict>
</plist>

Binary file not shown.

33
KC8EA/BackgroundView.h Normal file
View File

@ -0,0 +1,33 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* BackgroundView.h - NSView for a background image for a window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@interface BackgroundView : NSView
{
@private
NSImage *backgroundImage;
}
- (void) setBackgroundImage:(NSString *)imageName ofType:(NSString *)type;
@end

47
KC8EA/BackgroundView.m Normal file
View File

@ -0,0 +1,47 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* BackgroundView.m - NSView for a background image for a window
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "BackgroundView.h"
@implementation BackgroundView
- (void) setBackgroundImage:(NSString *)imageName ofType:(NSString *)type;
{
backgroundImage = [[NSImage alloc] initByReferencingFile:
[[NSBundle bundleForClass:[self class]] pathForResource:imageName ofType:type]];
}
- (void) drawRect:(NSRect)rect
{
[backgroundImage drawInRect:[self bounds] fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:1];
}
@end

46
KC8EA/ConsoleSwitchCell.h Normal file
View File

@ -0,0 +1,46 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ConsoleSwitchCell.h - NSButtonCell subclass for the console switches
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// for toggles with default position "up"
// - image is up image with shaddow
// - alternate image is down position
// - alternate title is the name of the up position image with shadow
// for switches
// - image is the down image
// - alternate image is the up position image without shadow
// - alternate title is the name of the up position image with shadow
// tag value == -1 for a momentary changing switch, otherwise it is a dual state switch
@interface ConsoleSwitchCell : NSButtonCell
{
@private
IBOutlet ConsoleSwitchCell *leftNeighbour;
NSImage *upWithShadow;
NSImage *upWithoutShadow;
}
- (void) updateShadow:(BOOL)showShadow;
@end

92
KC8EA/ConsoleSwitchCell.m Normal file
View File

@ -0,0 +1,92 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* ConsoleSwitchCell.h - NSButtonCell subclass for the console switches
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import "ConsoleSwitchCell.h"
@implementation ConsoleSwitchCell
- (void) awakeFromNib
{
if ([self tag] == -1) {
upWithoutShadow = [[NSImage alloc] initByReferencingFile:
[[NSBundle bundleForClass:[self class]]
pathForResource:[self alternateTitle] ofType:@"png"]];
upWithShadow = [[self image] retain];
} else {
upWithoutShadow = [[self alternateImage] retain];
upWithShadow = [[NSImage alloc] initByReferencingFile:
[[NSBundle bundleForClass:[self class]]
pathForResource:[self alternateTitle] ofType:@"png"]];
}
[(NSButton *)[self controlView] setAlternateTitle:nil];
}
- (void) highlight:(BOOL)flag withFrame:(NSRect)frame inView:(NSView *)view
{
// we need highlight only for momentary changing switches, detected via tag value -1
if ([self tag] == -1) {
[super highlight:flag withFrame:frame inView:view];
[leftNeighbour updateShadow:! flag];
}
else
[view setNeedsDisplay:YES];
}
- (void) performClick:(id)sender
{
// called by the key equivalents; the default method causes the switch to highlight
// we need highlight only for momentary changing switches, detected via tag value -1
if ([self tag] == -1)
[super performClick:sender];
else {
[self setState:! [self state]];
[[self target] performSelector:[self action] withObject:sender];
}
[[self controlView] setNeedsDisplay:YES]; // to show keyboad operation via space key with Tiger
}
- (void) setState:(int)state
{
[super setState:state];
[leftNeighbour updateShadow:state];
}
- (void) updateShadow:(BOOL)showShadow
{
if ([self tag] == -1)
[self setImage:showShadow ? upWithShadow : upWithoutShadow];
else
[self setAlternateImage:showShadow ? upWithShadow : upWithoutShadow];
}
@end

View File

@ -0,0 +1,28 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* InfoPlist.strings - Localized strings for Info.plist
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
CFBundleName = "KC8-EA Programmers Console";
CFBundleGetInfoString = "KC8-EA Programmers Console 2.0.2, Copyright © 1994-2015 Bernhard Baehr";
NSHumanReadableCopyright = "Copyright © 1994-2015 Bernhard Baehr";
CFBundleHelpBookName = "KC8-EA Programmer's Console Help";

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,314 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* index.html - Online help for the KC8-EA Programmer's Console
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>KC8-EA Programmer&rsquo;s Console Help</title>
<meta name="description"
content="Describes the functioning of the KC8-EA Programmer&rsquo;s Console">
<meta name="AppleTitle" content="KC8-EA Programmer's Console Help">
<meta name="AppleIcon" content="pdp8e.png">
<link href="styles.css" rel="stylesheet" media="all">
</head>
<body>
<h1>Controls and Indicators of the KC8-EA Programmer&rsquo;s Console</h1>
<p>
The controls and indicators on the Programmer&rsquo;s Console provide manual control and indicate the
program conditions of the PDP-8/E. Controls on the Programmer&rsquo;s Console provide the operator
with the hardware to start, stop, examine, modify, or continue a program. The indicators on the console
provide a visual indication of the machine status and current program, the contents of the major registers,
and the condition of the control flip-flops. A lighted indicator denotes the presence of a binary 1 in
a specific register bit position or control flip-flop. The table below lists the functions of controls and
indicators. The controls are divided into two groups; switches and keys. Keys are momentary, or
spring-return, switches.
</p>
<table>
<tr>
<th width="150px">Control or Indicator</th>
<th class="left">Function</th>
</tr>
<tr>
<td>Off / Power / Panel Lock</td>
<td class="left">
This is a key operated switch. In the counter-clockwise, or OFF, position, the
switch disconnects all primary power to the machiine. In the POWER, or straight up position,
it enables all manual controls and applies primary computer power. In the PANEL LOCK or
clockwise position, it disables all keys and switches with the exception of the Switch
Register and the SW switch. In this position, a running program is protected from
inadvertent switch operation and all panel indicators except the RUN light are turned off.
</td>
</tr>
<tr>
<td>SW</td>
<td class="left">
When this switch is up, the line on the OMNIBUS called SW is high; when the lever is down,
the line is low. This switch is used by special peripheral controls, such as the
Bootstrap Loader.
</td>
</tr>
<tr>
<td>Switch Register Switches<br>(SR)</td>
<td class="left">
These 12 switches provide a means of communication between operator and machine.
They allow a 12-bit word to be input. When the switch is up, it designates a binary 1
to the machine; switch down is a 0. These switches are used during manual functions or
under program control.
</td>
</tr>
<tr>
<td>Load Address Key<br>(ADDR LOAD)</td>
<td class="left">
This key loads the contents of the Switch Register into the CPMA and forces Fetch to be
set (no Major States while the Load Address Key is depressed).
</td>
</tr>
<tr>
<td>Extended Address Load<br>(EXTD ADDR LOAD)</td>
<td class="left">
This switch loads the contents of SR(6&ndash;11) into the Data Field and Instruction Field
registers of the Memory Extension Control. SR(9&ndash;11) goes to Data Field 0&ndash;2,
SR(6&ndash;8) goes to Instruction Field 0&ndash;2.
</td>
</tr>
<tr>
<td>Clear Key (CLEAR)</td>
<td class="left">
This key issues an Initialize Pulse, clearing the AC, Link, Interrupt system, and I/O Flags.
</td>
</tr>
<tr>
<td>Continue Key (CONT)</td>
<td class="left">
This key resumes the computer program by issuing a Memory Start and setting the Run
flip-flop. The word stored at the address currently held by the CPMA is taken as the first
instruction.
</td>
</tr>
<tr>
<td>Examine Key (EXAM)</td>
<td class="left">
Puts the contents of core memory at the address specified by the contents of the CPMA
into the MB. Then the contents of the PC and CPMA are incremented by one to allow
examination of the contents of sequential core memory addresses by repeating the operation
of the Examine switch.
</td>
</tr>
<tr>
<td>Halt Switch (HALT)</td>
<td class="left">
This switch clears the Run flip-flop and and causes the machine to stop at TS1 of the next
Fetch cycle. This switch is also used for single instruction stepping.
</td>
</tr>
<tr>
<td>Single Step Switch<br>(SING STEP)</td>
<td class="left">
This switch clears the Run flip-flop and causes the machine to stop at TS1 of the next
cycle. Thereafter, repeated depressing of the Continue key steps the program one cycle at
a time, so that the contents of registers can be observed in each state.
</td>
</tr>
<tr>
<td>Deposit Key (DEP)</td>
<td class="left">
Loads the contents of the SR into the MB and core memory at the address given by the
current contents of the CPMA. Then the contents of the PC and CPMA are incremented by one.
This allows storing of information in sequential memory addresses by repeated operation
of the Deposit switch.
</td>
</tr>
<tr>
<td>Indicator Selector Switch</td>
<td class="left">
This is a six-position rotary switch, used to select a register for display. The six
positions are as follows:
<ul>
<li>STATE &mdash; Indicates an individual function for each bit:<br>
<table>
<tr><td>0</td><td class="left">Fetch</td></tr>
<tr><td>1</td><td class="left">Defer</td></tr>
<tr><td>2</td><td class="left">Execute</td></tr>
<tr><td>3</td><td class="left">Instruction Register 0</td></tr>
<tr><td>4</td><td class="left">Instruction Register 1</td></tr>
<tr><td>5</td><td class="left">Instruction Register 2</td></tr>
<tr><td>6</td><td class="left">MD DIR</td></tr>
<tr><td>7</td><td class="left">Data Control</td></tr>
<tr><td>8</td><td class="left">SW</td></tr>
<tr><td>9</td><td class="left">Pause</td></tr>
<tr><td>10</td><td class="left">Break in Prog</td></tr>
<tr><td>11</td><td class="left">Break</td></tr>
</table>
</li>
<li>STATUS &mdash; Indicates an individual function each bit:<br>
<table>
<tr><td>0</td><td class="left">Link</td></tr>
<tr><td>1</td><td class="left">Greater Than Flag</td></tr>
<tr><td>2</td><td class="left">Interrupt Bus</td></tr>
<tr><td>3</td><td class="left">No Interrupt Allowed</td></tr>
<tr><td>4</td><td class="left">Interrupt On</td></tr>
<tr><td>5</td><td class="left">User Mode</td></tr>
<tr><td>6</td><td class="left">Instruction Field 0</td></tr>
<tr><td>7</td><td class="left">Instruction Field 1</td></tr>
<tr><td>8</td><td class="left">Instruction Field 2</td></tr>
<tr><td>9</td><td class="left">Data Field 0</td></tr>
<tr><td>10</td><td class="left">Data Field 1</td></tr>
<tr><td>11</td><td class="left">Data Field 2</td></tr>
</table>
</li>
<li>AC &mdash; Indicates bits 0&ndash;11 of the Accumulator at TS1.</li>
<li>MD &mdash; Indicates information just written or rewritten into memory.</li>
<li>MQ &mdash; Indicates contents of MQ register during TS1.</li>
<li>BUS &mdash; Indicates bis 0&ndash;11 of the DATA lines.</li>
</ul>
</td>
</tr>
<tr>
<td>Memory Address</td>
<td class="left">
Indicates the contents of the memory address which will be accessed next.
</td>
</tr>
<tr>
<td>EMA</td>
<td class="left">
Indicates which Extended Memory field is being accessed.
</td>
</tr>
<tr>
<td>Run Light</td>
<td class="left">
When lit means machine&rsquo;s timing is enabled and capable of executing instructions.
</td>
</tr>
</table>
<h1>Limitations and extensions of the simulated KC8-EA Programmer&rsquo;s Console</h1>
<p>
The simulated KC8-EA has some limitations and extensions compared to a hardware KC8-EA:
</p>
<ul>
<li>
The console is able to simulate single step execution. This simulation is done console
internally because the PDP-8/E Simulator itself performs PDP-8/E instructions atomically.
While executing a Fetch and Defer memory cycle, no state changes occur in the simulators
PDP-8/E, only the display lights of the console reflect the accompanying state changes.
When the final Execute memory cycle (or, for single cycle instructions, e. g. OPRs, the
Fetch cycle) is performed, the simulators PDP-8/E is instructed by the console to perform
the complete PDP-8/E instruction at once. So, while the console is in a Defer or Execute
state, there may be inconsistencies between the register values visible in the CPU window
and the corresponding values displayed by the KC8-EA. To avoid confusion, it is suggested
not to alternately use single step execution of the console and the instruction stepping
of the simulator.
</li>
<li>
When the user depresses the Single Step switch while the PDP-8/E is running,
it halts at TS1 of a Fetch cycle, like with the Halt switch, and not at TS1 of any memory cycle.
When the Single Step or Halt switch is down, the simulator can&rsquo;t be started
in Step, Trace or Go mode.
</li>
<li>
When the machine is in single instruction mode (Halt switch down) and an interrupt is pending,
depressing the Continue switch once brings the simulator to the first instruction of the
interrupt service routine at location 1. On a real PDP-8/E, the switch must be operated twice
to reach this state. When the interrupt is caused by a privileged instruction executed in
user mode, the simulator halts after the privileged instruction, a hardware PDP-8/E halts
at location 0. The next operation of the Continue switch brings both the simulator and a
real PDP-8/E to the first instruction of the interrupt service routine at location 1.
This different behaviour is also present when stepping on memory cycle level (Single Step switch
down).
</li>
<li>
The state of the SW switch is not directly available for other I/O devices. But whenever the
user operates this switch, a Cocoa notification with the name
&ldquo;kc8eaSWChangedNotification&rdquo; is posted; the notification object is a number representing
the state of the switch, 0 for down and 1 for up.
</li>
<li>
Turning the Power key to OFF quits the PDP-8/E Simulator.
</li>
<li>
When the PDP-8/E is running, the display lights are sampled with a frequency of 60 Hz. They then
display the state at the end of the Fetch cycle, before the instruction is actually executed,
of the next PDP-8/E instruction to be performed; so the STATE display display can indicate Defer
and Execute cycles.
</li>
<li>
At least in the following points the display differs from a hardware PDP-8/E:
<ul>
<li>
The DATA CONT, BRK PROG and BRK indicators of the STATE display are always off.
</li>
<li>
The PAUSE indicator of the STATE display may be inprecise.
</li>
<li>
The NO INT indicator of the STATUS display is illuminated when the Interrupt Delay or
Interrupt Inhibit flag is set. On a hardware PDP-8/E, this indicator is derived from
signals not available with the PDP-8/E Simulator.
</li>
<li>
The BUS display may be inprecise under certain circumstances, e. g. for group 3 OPRs
of the EAE or for IOT instructions, where always the AC is shown.
</li>
<li>
The MD display does not reflect the additional memory access of EAE two word instructions.
</li>
<li>
When the PDP-8/E halts from the Step, Trace or Go mode of the simulator, the STATE, MD and
BUS display may be inprecise. E. g. the MD DIR is always turned on, MD shows the opcode
of the last instruction executed, but not the memory references eventually performed by
the instruction. (When you execute single PDP-8/E instructions by pressing the
Continue key of the console while the Halt switch is down, the display is more precise
because then the KC8-EA internally simulates the Fetch, Defer and Execute cycle of the
instruction.)
</li>
</ul>
</li>
<li>
The console keys and switches can be operated using the following keyboard shortcuts:
<table>
<tr><td>&#x2325;w</td><td class="left">Operate the SW switch</td></tr>
<tr><td>&#x2325;0,&hellip;,&#x2325;9, &#x2325;a, &#x2325;b</td>
<td class="left">Operate the corresponding switch of the Switch Register</td></tr>
<tr><td>&#x2325;l</td><td class="left">Operate the Load Address key</td></tr>
<tr><td>&#x2325;x</td><td class="left">Operate the Extended Address Load key</td></tr>
<tr><td>&#x2325;c</td><td class="left">Operate the Clear key</td></tr>
<tr><td>&#x2325;t</td><td class="left">Operate the Continue key</td></tr>
<tr><td>&#x2325;e</td><td class="left">Operate the Examine key</td></tr>
<tr><td>&#x2325;h</td><td class="left">Operate the Halt switch</td></tr>
<tr><td>&#x2325;s</td><td class="left">Operate the Single Step switch</td></tr>
<tr><td>&#x2325;d</td><td class="left">Operate the Deposit key</td></tr>
<tr><td>&#x2325;&lt;</td><td class="left">Turn the Indicator Selector switch anticlockwise</td></tr>
<tr><td>&#x2325;&gt;</td><td class="left">Turn the Power key clockwise</td></tr>
</table>
</li>
</ul>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,239 @@
/*
* PDP-8/E Simulator
*
* Copyright © 1994-2015 Bernhard Baehr
*
* styles.css - Online help - Style sheet
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
p {
font-size: 9pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
text-decoration: none
}
p.small {
font-size: 8pt;
}
a {
font-family: "Lucida Grande", Arial, "Sans Serif";
text-decoration: none
}
a:hover {
text-decoration: underline
}
ul {
margin-left: 1.25em; padding-left: 0em;
}
li {
font-size: 9pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
text-decoration: none
}
#mainbox {
background-color: #fff;
margin-top: 30px;
margin-right: 26px;
margin-left: 18px;
position: absolute;
top: 10px
}
#taskbox {
background-color: #eee;
list-style-type: decimal;
list-style-position: outside;
margin-top: 12px;
margin-bottom: 12px;
border: solid 1px #444
}
h1 {
font-size: 12pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 6pt;
}
h2 {
font-size: 12pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 8pt;
}
h3 {
font-size: 10pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 5pt;
}
h4 {
font-size: 9pt;
font-family: "Lucida Grande", Arial, "Sans Serif";
padding-top: 4pt;
}
/* index.html */
table.index {
padding-top: 20px;
width: 100%;
}
td.banner {
padding: 20px;
}
td.toc {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
padding-right:20px;
border-left: 1px solid darkgray;
}
p.toc {
line-height: 40px;
}
/* other pages */
table {
border-collapse: separate;
border-spacing: 0px;
}
th {
font-family: "Lucida Grande", Arial, "Sans Serif";
font-size: 9pt;
font-style: bold;
border-bottom: 1px solid gray;
padding-left: 10px;
padding-right: 10px;
}
th.left {
text-align: left;
}
td {
text-align: center;
vertical-align: top;
font-family: "Lucida Grande", Arial, "Sans Serif";
font-size: 9pt;
padding-left: 10px;
padding-right: 10px;
}
td.left {
text-align: left;
}
td.right {
text-align: right;
}
td.br {
border-right: 1px solid gray;
}
td.bb {
border-bottom: 1px solid lightgray;
}
td.bb_left {
text-align: left;
border-bottom: 1px solid lightgray;
}
td.bbr {
border-bottom: 1px solid lightgray;
border-right: 1px solid gray;
}
td.opcode {
vertical-align: middle;
width: 40px;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_right {
text-align: right;
vertical-align: middle;
width: 40px;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_left {
text-align: left;
vertical-align: middle;
width: 40px;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tb {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border-top: 1px solid black;
border-bottom: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tlb {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border-top: 1px solid black;
border-left: 1px solid black;
border-bottom: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tbr {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border-top: 1px solid black;
border-bottom: 1px solid black;
border-right: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}
td.opcode_tlbr {
vertical-align: middle;
background: lightgray;
width: 40px;
height: 40px;
border: 1px solid black;
padding-left: 0px;
padding-right: 0px;
}

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
* PDP-8/E Simulator
*
* Copyright © 1994-2014 Bernhard Baehr
*
* io-info.plist - KC8-EA Programmers Console I/O info property list
*
* This file is part of PDP-8/E Simulator.
*
* PDP-8/E Simulator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<dict>
<key>ioflags</key>
<array>
</array>
<key>ioaddresses</key>
<array>
</array>
<key>iots</key>
<array>
</array>
</dict>
</plist>

Some files were not shown because too many files have changed in this diff Show More