832 lines
100 KiB
JavaScript
832 lines
100 KiB
JavaScript
(function(){/*
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
|
|
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
|
|
may be used freely provided the original author name is acknowledged in any modified source code.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
Jeff Parsons 2012-2016
|
|
|
|
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
|
|
|
|
PCjs 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.
|
|
|
|
PCjs 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 PCjs. If not,
|
|
see <http://www.gnu.org/licenses/gpl.html>.
|
|
|
|
You are required to include the above copyright notice in every source code file of every
|
|
copy or modified version of this work, and to display that copyright notice on every screen
|
|
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
|
|
|
|
Some PCjs files also attempt to load external resource files, such as character-image files,
|
|
ROM files, and disk image files. Those external resource files are not considered part of PCjs
|
|
for purposes of the GNU General Public License, and the author does not claim any copyright
|
|
as to their contents.
|
|
*/
|
|
var g;
|
|
function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
|
|
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function k(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function ca(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
|
|
function da(){var a=ea();return-1!==a.indexOf("pcjs.org",a.length-8)}var fa={"&":"&","<":"<",">":">",'"':""","'":"'"};function ha(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
|
var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ka=Date.now||function(){return+new Date};
|
|
function la(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
|
function m(a,b,c,d){var e=0,f=null,h=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),h;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
|
typeof b){var n="",p;for(p in b)b.hasOwnProperty(p)&&(n&&(n+="&"),n+=p+"="+encodeURIComponent(b[p]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),h=[f,e]);return h}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")}
|
|
function q(a){window&&window.alert(a)}function ma(a){var b=!1;window&&(b=window.confirm(a));return b}var na=null;function oa(){if(null==na){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}na=a}return na}function pa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
|
function qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},sa=!1,ta=!1,ua=!0;function va(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function t(a){r.init.push(a)}
|
|
function wa(a){if(ua)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function xa(a){!ua&&a?(ua=!0,sa&&ya("init"),ta&&ya("show")):ua=a}function ya(a){r[a]&&wa(r[a])}va("onload",function(){sa=!0;wa(r.init)});va("onpageshow",function(){ta=!0;wa(r.show)});va(ra("Opera")||ra("iOS")?"onunload":"onbeforeunload",function(){wa(r.exit)});
|
|
function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.hb=b.comment;this.Eb=b;b=this.id.indexOf(".");0>b?this.Ca=this.id:(this.Ta=this.id.substr(0,b),this.Ca=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Xc:!1,Yc:!1,L:!1,error:!1};this.La=null;this.h.error=!1;this.w={};this.I=null;w.push(this)}var za=void 0,Aa={};
|
|
if(window){za||(za=window.location.search.substr(1));for(var Ba,Ca=/\+/g,Da=/([^&=]+)=?([^&]*)/g;Ba=Da.exec(za);)Aa[decodeURIComponent(Ba[1].replace(Ca," "))]=decodeURIComponent(Ba[2].replace(Ca," "))}function Ea(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
|
function x(a,b){b||(b=v);a.prototype=Ea(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Fa=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Fa={},w=[];function Ga(a,b,c){Fa[a]&&b&&(Fa[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<w.length;b++){var d=w[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
|
function Ha(a){if(void 0!==a){var b;for(b=0;b<w.length;b++)if(w[b].id===a)return w[b]}return null}function z(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<w.length;d++)if(c)c==w[d]&&(c=null);else if(!(a!=w[d].type||b&&w[d].id.indexOf(b)))return w[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
|
|
function B(a,b){b=C(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var h=f.getAttribute("class");if(h)for(var l=h.split(" "),n=0;n<l.length;n++)switch(h=l[n],h){case "pdp11-binding":(h=A(f))&&h.binding&&a.P(h.type,h.binding,f,h.value),n=l.length}}}}
|
|
function C(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
|
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},P:function(a,b,c){switch(b){case "clear":return this.w[b]||(this.w[b]=c,c.onclick=function(a){return function(){a.w.print&&(a.w.print.value="")}}(this)),!0;case "print":return this.w[b]||(this.Ra=this.w[b]=c,c.value="",this.M=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
|
this.K=function(a){this.M(a,this.Ca)}),!0;default:return!1}},log:function(){},M:function(){},status:function(a){this.M(this.Ca+": "+a)},K:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},ca:function(){return this.h.L=!0},ba:function(a,b){b&&(this.h.L=!1);return!0}};function D(a){if(!a.h.error&&(a.h.ready=!0,a.h.ready)){var b=a.La;a.La=null;b&&b()}}function Ia(a,b){b&&(a.h.ready?b():a.La=b);return a.h.ready}
|
|
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
|
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ja="undefined"!==typeof ArrayBuffer;function Ka(a){v.call(this,"Panel",a,Ka)}x(Ka);g=Ka.prototype;
|
|
g.P=function(a,b,c,d){return this.A&&this.A.P(a,b,c,d)||this.a&&this.a.P(a,b,c,d)?!0:this.parent.P.call(this,a,b,c,d)};g.ja=function(a,b,c,d){this.A=a;this.l=b;this.a=c;this.I=d};g.ca=function(a,b){b||La();return!0};g.ba=function(){return!0};g.ua=function(){};function La(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Ha(e.id);f||(a=!0,f=new Ka(e));B(f,d);a&&D(f)}}t(La);
|
|
function Ma(a,b,c){v.call(this,"Bus",a,Ma);this.a=b;this.I=c;this.B=a.busWidth||16;this.m=0;this.H=[];this.v=null;this.D=Math.pow(2,this.B);this.i=this.D-1|0;this.c=(this.B>>1)+2;10>this.c&&(this.c=10);15<this.c&&(this.c=15);this.l=1<<this.c;this.F=this.l>>2;this.g=this.l-1;this.A=this.D/this.l|0;this.ga=[];this.o=0;this.s=[];this.xb=[Na,Oa,Pa,Qa];a=new E(this);Ra(a,this.I);this.b=Array(this.A);for(b=0;b<this.A;b++)this.b[b]=a;D(this)}x(Ma);
|
|
function Na(a,b){var c=-1,d=this.controller,e=d.ga[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=Sa(d)}function Oa(a,b,c){var d=!1,e=this.controller,f=e.ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||Sa(e)}
|
|
function Pa(a,b){var c=-1,d=this.controller;(a=d.ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=Sa(d)}function Qa(a,b,c){var d=!1,e=this.controller;if(a=e.ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||Sa(e)}function Ta(a,b){if(b!=a.m){var c;a.m&&(c=(1<<a.m)-8192,Ua(a,c,8192,a.H),a.m=0);b&&(a.m=b,c=(1<<b)-8192,a.H=Va(a,c,8192),a.v?Ua(a,c,8192,a.v):(Wa(a,c,8192,Xa,a),a.v=Va(a,c,8192)))}}
|
|
Ma.prototype.reset=function(){for(var a=0;a<this.s.length;a++)this.s[a]();Ta(this,16)};function Sa(a){a.o||F(a.a,4);return 0}Ma.prototype.ca=function(a,b){b||this.reset();return!0};
|
|
function Wa(a,b,c,d,e){for(var f=b,h=c,l=f>>>a.c;0<h&&l<a.b.length;){var n=a.b[l],p=l*a.l,u=a.l-(f-p);u>h&&(u=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.ya)return n.Oa+=n.ya-f,n.ya=f,!0;if(f>=n.ya+n.Oa){u=n.size-(f-p);u>h&&(u=h);n.Oa=f-n.ya+u;f=p+a.l;h-=u;l++;continue}}return Ya(1,f,h)}f=new E(a,f,u,a.l,d,e);Ra(f,a.I,n);a.b[l++]=f;f=p+a.l;h-=u}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+Za[d]+" at "+k(b,8,!0)),!0):Ya(2,b,c)}
|
|
function Va(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.l;return d}function Ua(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.l}}function $a(a,b){return a.b[(b&a.i)>>>a.c].Xa(b&a.g,b)}function ab(a,b){return a.b[(b&a.i)>>>a.c].jc(b&a.g,b)}function bb(a,b,c){a.b[(b&a.i)>>>a.c].Rc(b&a.g,c&65535,b)}
|
|
function cb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.b[d];if(e.ha||e.zb){c[b++]=d;var f=b++;if(e=e.save()){for(var h=0,l=0,n=[];h<e.length;){for(var p=e[h],u=h+1;u<e.length&&e[u]===p;)u++;n[l++]=u-h;n[l++]=p;h=u}n.length<e.length&&(e=n)}c[f]=e}}return c}function db(a,b,c,d,e,f,h,l){for(;b<=c;b+=2){var n=b&8191;void 0!==a.ga[n]?q("I/O address already registered: "+k(b,8,!0)):a.ga[n]=[d,e,f,h,l||"unknown",!1]}}
|
|
function eb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Db)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;e&1&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&n&&(l=function(a,c){return function(b,d){return a(c(d)&-256|b,d)}.bind(b)}(p,n)));db(a,e,e,h,l,n,p,f[4])}}}function fb(a,b){a.s.push(b)}function G(a){a.o||F(a.a,4)}
|
|
function Ya(a,b,c){q("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function H(a){v.call(this,"Device",a,H);this.c={data:0,Wc:0,Ma:20,$c:0};this.b={Zc:0,ab:-1}}x(H);g=H.prototype;g.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;var e=this;this.b.ab=gb(this.a,function(){e.b.ka|=128;e.b.ka&64&&(hb(e.a,0,6,64),ib(e.a,e.b.ab,1E3/60))});eb(b,this,I);fb(b,this.reset.bind(this));D(this)};g.Mb=function(){var a=this.b.ka;this.b.ka&=-129;return a};
|
|
g.vc=function(a){this.b.ka=a;a&64&&ib(this.a,this.b.ab,1E3/60);this.b.ka=a&-129};g.Ob=function(){var a=this.a;return a.B&62337|a.Da<<5|a.Ea<<1};g.xc=function(a){var b=this.a;a&=62337;if(b.B!=a){b.B=a;b.Da=a>>5&3;b.Ea=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Na!=c&&(b.Na=c,jb(b))}kb(this)};g.Pb=function(){var a=this.a.la;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Qb=function(){return this.a.Za};g.Rb=function(){return this.a.ma};
|
|
g.yc=function(a){var b=this.a;b.ma!=a&&(b.ma=a,a&16?(b.Va=4194303,b.Fa=3915776):(b.Va=262143,b.Fa=253952),jb(b));kb(this)};function kb(a){a.c.Ma=a.c.Ma&-8|(a.a.Na?a.a.ma&16?1:2:4)}g.cc=function(a){return this.a.C[1][a>>1&7]};g.Kc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.ac=function(a){return this.a.C[1][(a>>1&7)+8]};g.Ic=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.bc=function(a){return this.a.O[1][a>>1&7]};g.Jc=function(a,b){b=b>>1&7;this.a.O[1][b]=a;this.a.C[1][b]&=65295};
|
|
g.$b=function(a){return this.a.O[1][(a>>1&7)+8]};g.Hc=function(a,b){b=(b>>1&7)+8;this.a.O[1][b]=a;this.a.C[1][b]&=65295};g.Lb=function(a){return this.a.C[0][a>>1&7]};g.uc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Jb=function(a){return this.a.C[0][(a>>1&7)+8]};g.sc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Kb=function(a){return this.a.O[0][a>>1&7]};g.tc=function(a,b){b=b>>1&7;this.a.O[0][b]=a;this.a.C[0][b]&=65295};g.Ib=function(a){return this.a.O[0][(a>>1&7)+8]};
|
|
g.rc=function(a,b){b=(b>>1&7)+8;this.a.O[0][b]=a;this.a.C[0][b]&=65295};g.ic=function(a){return this.a.C[3][a>>1&7]};g.Qc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.gc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Oc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.O[3][a>>1&7]};g.Pc=function(a,b){b=b>>1&7;this.a.O[3][b]=a;this.a.C[3][b]&=65295};g.fc=function(a){return this.a.O[3][(a>>1&7)+8]};g.Nc=function(a,b){b=(b>>1&7)+8;this.a.O[3][b]=a;this.a.C[3][b]&=65295};
|
|
g.sa=function(a){a&=7;return this.a.u&2048?this.a.ra[a]:this.a.f[a]};g.va=function(a,b){b&=7;this.a.u&2048?this.a.ra[b]=a:this.a.f[b]=a};g.Ub=function(){return this.a.u&49152?this.a.U[0]:this.a.f[6]};g.Bc=function(a){this.a.u&49152?this.a.U[0]=a:this.a.f[6]=a};g.Xb=function(){return this.a.f[7]};g.Ec=function(a){this.a.f[7]=a};g.ta=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.ra[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.ra[b]=a};
|
|
g.Vb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.U[1]};g.Cc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.U[1]=a};g.Wb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.U[3]};g.Dc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.U[3]=a};g.Hb=function(a){return this.a.qb[a-65504>>1]};g.qc=function(a,b){this.a.qb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.wb=function(){};g.ec=function(){return 1};g.Mc=function(){};g.Gb=function(){return this.a.G};
|
|
g.pc=function(){this.a.G=0};g.Nb=function(){return this.a.pb};g.wc=function(a,b){b&1||(a&=255);this.a.pb=a};g.Sb=function(){return this.a.$a};g.zc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.$a=a;b.j|=2};g.dc=function(){return this.a.na&65280};g.Lc=function(a){this.a.na=a|255};g.Tb=function(){return lb(this.a)};g.Ac=function(a){mb(this.a,a&-1809|lb(this.a)&1808);this.a.j|=128};g.vb=function(){};g.reset=function(){this.c.Ma=this.c.Ma&-120|20;this.b.ka=0};
|
|
var J={},I=(J[62592]=[null,null,H.prototype.cc,H.prototype.Kc,"SISDR"],J[62608]=[null,null,H.prototype.ac,H.prototype.Ic,"SDSDR"],J[62624]=[null,null,H.prototype.bc,H.prototype.Jc,"SISAR"],J[62640]=[null,null,H.prototype.$b,H.prototype.Hc,"SDSAR"],J[62656]=[null,null,H.prototype.Lb,H.prototype.uc,"KISDR"],J[62672]=[null,null,H.prototype.Jb,H.prototype.sc,"KDSDR"],J[62688]=[null,null,H.prototype.Kb,H.prototype.tc,"KISAR"],J[62704]=[null,null,H.prototype.Ib,H.prototype.rc,"KDSAR"],J[62798]=[null,null,
|
|
H.prototype.Rb,H.prototype.yc,"MMR3"],J[65382]=[null,null,H.prototype.Mb,H.prototype.vc,"LKS"],J[65402]=[null,null,H.prototype.Ob,H.prototype.xc,"MMR0"],J[65404]=[null,null,H.prototype.Pb,H.prototype.vb,"MMR1"],J[65406]=[null,null,H.prototype.Qb,H.prototype.vb,"MMR2"],J[65408]=[null,null,H.prototype.ic,H.prototype.Qc,"UISDR"],J[65424]=[null,null,H.prototype.gc,H.prototype.Oc,"UDSDR"],J[65440]=[null,null,H.prototype.hc,H.prototype.Pc,"UISAR"],J[65456]=[null,null,H.prototype.fc,H.prototype.Nc,"UDSAR"],
|
|
J[65472]=[null,null,H.prototype.sa,H.prototype.va,"R0SET0"],J[65473]=[null,null,H.prototype.sa,H.prototype.va,"R1SET0"],J[65474]=[null,null,H.prototype.sa,H.prototype.va,"R2SET0"],J[65475]=[null,null,H.prototype.sa,H.prototype.va,"R3SET0"],J[65476]=[null,null,H.prototype.sa,H.prototype.va,"R4SET0"],J[65477]=[null,null,H.prototype.sa,H.prototype.va,"R5SET0"],J[65478]=[null,null,H.prototype.Ub,H.prototype.Bc,"R6KERNEL"],J[65479]=[null,null,H.prototype.Xb,H.prototype.Ec,"R7KERNEL"],J[65480]=[null,null,
|
|
H.prototype.ta,H.prototype.wa,"R0SET1"],J[65481]=[null,null,H.prototype.ta,H.prototype.wa,"R1SET1"],J[65482]=[null,null,H.prototype.ta,H.prototype.wa,"R2SET1"],J[65483]=[null,null,H.prototype.ta,H.prototype.wa,"R3SET1"],J[65484]=[null,null,H.prototype.ta,H.prototype.wa,"R4SET1"],J[65485]=[null,null,H.prototype.ta,H.prototype.wa,"R5SET1"],J[65486]=[null,null,H.prototype.Vb,H.prototype.Cc,"R6SUPER"],J[65487]=[null,null,H.prototype.Wb,H.prototype.Dc,"R6USER"],J[65504]=[null,null,H.prototype.Hb,H.prototype.qc,
|
|
"CTRL",1170],J[65520]=[null,null,H.prototype.nb,H.prototype.wb,"LSIZE",1170],J[65522]=[null,null,H.prototype.nb,H.prototype.wb,"HSIZE",1170],J[65524]=[null,null,H.prototype.ec,H.prototype.Mc,"SYSID",1170],J[65526]=[null,null,H.prototype.Gb,H.prototype.pc,"CPUERR",1170],J[65528]=[null,null,H.prototype.Nb,H.prototype.wc,"MB",1170],J[65530]=[null,null,H.prototype.Sb,H.prototype.zc,"PIR"],J[65532]=[null,null,H.prototype.dc,H.prototype.Lc,"SL"],J[65534]=[null,null,H.prototype.Tb,H.prototype.Ac,"PSW"],
|
|
J);I[62594]=I[62592];I[62596]=I[62592];I[62598]=I[62592];I[62600]=I[62592];I[62602]=I[62592];I[62604]=I[62592];I[62606]=I[62592];I[62610]=I[62608];I[62612]=I[62608];I[62614]=I[62608];I[62616]=I[62608];I[62618]=I[62608];I[62620]=I[62608];I[62622]=I[62608];I[62626]=I[62624];I[62628]=I[62624];I[62630]=I[62624];I[62632]=I[62624];I[62634]=I[62624];I[62636]=I[62624];I[62638]=I[62624];I[62642]=I[62640];I[62644]=I[62640];I[62646]=I[62640];I[62648]=I[62640];I[62650]=I[62640];I[62652]=I[62640];I[62654]=I[62640];
|
|
I[62658]=I[62656];I[62660]=I[62656];I[62662]=I[62656];I[62664]=I[62656];I[62666]=I[62656];I[62668]=I[62656];I[62670]=I[62656];I[62674]=I[62672];I[62676]=I[62672];I[62678]=I[62672];I[62680]=I[62672];I[62682]=I[62672];I[62684]=I[62672];I[62686]=I[62672];I[62690]=I[62688];I[62692]=I[62688];I[62694]=I[62688];I[62696]=I[62688];I[62698]=I[62688];I[62700]=I[62688];I[62702]=I[62688];I[62706]=I[62704];I[62708]=I[62704];I[62710]=I[62704];I[62712]=I[62704];I[62714]=I[62704];I[62716]=I[62704];I[62718]=I[62704];
|
|
I[65410]=I[65408];I[65412]=I[65408];I[65414]=I[65408];I[65416]=I[65408];I[65418]=I[65408];I[65420]=I[65408];I[65422]=I[65408];I[65426]=I[65424];I[65428]=I[65424];I[65430]=I[65424];I[65432]=I[65424];I[65434]=I[65424];I[65436]=I[65424];I[65438]=I[65424];I[65442]=I[65440];I[65444]=I[65440];I[65446]=I[65440];I[65448]=I[65440];I[65450]=I[65440];I[65452]=I[65440];I[65454]=I[65440];I[65458]=I[65456];I[65460]=I[65456];I[65462]=I[65456];I[65464]=I[65456];I[65466]=I[65456];I[65468]=I[65456];I[65470]=I[65456];
|
|
I[65506]=I[65504];I[65508]=I[65504];I[65510]=I[65504];I[65512]=I[65504];I[65514]=I[65504];I[65516]=I[65504];I[65518]=I[65504];t(function(){for(var a=C(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=A(c);switch(d.name){case "default":d=new H(d),B(d,c)}}});var nb;if(Ja){var ob=new ArrayBuffer(2);(new DataView(ob)).setUint16(0,256,!0);nb=256===(new Uint16Array(ob))[0]}else nb=!1;var pb=nb;
|
|
function E(a,b,c,d,e,f){this.l=a;this.id=qb+=2;this.a=null;this.ya=b;this.Oa=c;this.size=d||0;this.type=e||rb;this.w=e==sb;this.controller=null;Ra(this);this.ha=this.zb=!1;if(d)if(f)this.controller=f,this.a=null,tb(this,f.xb);else if(Ja)this.b=new ArrayBuffer(d),this.g=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>1),this.a=new Int32Array(this.b,0,d>>2),tb(this,pb?ub:vb);else{this.a=Array(d>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;tb(this,wb)}else tb(this)}
|
|
var rb=0,sb=2,Xa=4,Za=["NONE","RAM","ROM","VID","H/W"],qb=0;
|
|
E.prototype={constructor:E,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ja)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ja)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.ha=!0}return!1},s:function(){return 255},v:function(){},A:function(a,b){return this.Xa(a++,b++)|this.Xa(a,b)<<8},B:function(a,b,c){this.Pa(a++,
|
|
b&255,c++);this.Pa(a,b>>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},X:function(a){a&1&&G(this.l);var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},da:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ha=!0},qa:function(a,b){a&1&&G(this.l);var c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.ha=!0},F:function(a,b){return this.H(a,b)},
|
|
S:function(a,b){return this.V(a,b)},Z:function(a,b,c){this.w||this.ub(a,b,c)},fa:function(a,b,c){this.w||this.oa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},R:function(a){a&1&&G(this.l);return this.g.getUint16(a,!0)},W:function(a){a&1&&G(this.l);return this.o[a>>1]},Y:function(a,b){this.c[a]=b;this.ha=!0},$:function(a,b){this.c[a]=b;this.ha=!0},ea:function(a,b){a&1&&G(this.l);this.g.setUint16(a,b,!0);this.ha=!0},pa:function(a,b){a&1&&G(this.l);this.o[a>>1]=b;this.ha=!0}};
|
|
function Ra(a,b,c){a.I=b;a.i=a.m=0;c&&((a.i=c.i)&&xb(a,yb,!1),(a.m=c.m)&&zb(a,yb,!1))}function zb(a,b,c){c&&a.m||(a.Pa=!a.w&&b[1]||a.v,a.Rc=!a.w&&b[3]||a.B);if(c||void 0===c)a.ub=b[1]||a.v,a.oa=b[3]||a.B}function xb(a,b,c){c&&a.i||(a.Xa=b[0]||a.s,a.jc=b[2]||a.A);if(c||void 0===c)a.H=b[0]||a.s,a.V=b[2]||a.A}function tb(a,b){b||(b=Ab);xb(a,b,void 0);zb(a,b,void 0)}var Ab=[],wb=[E.prototype.N,E.prototype.da,E.prototype.X,E.prototype.qa],yb=[E.prototype.F,E.prototype.Z,E.prototype.S,E.prototype.fa];
|
|
if(Ja)var vb=[E.prototype.D,E.prototype.Y,E.prototype.R,E.prototype.ea],ub=[E.prototype.J,E.prototype.$,E.prototype.W,E.prototype.pa];function Bb(a,b){v.call(this,"CPU",a,Bb);var c=a.multiplier||1;this.Ia=a.cycles||b;this.Z=c;this.Ua=Math.round(this.Ia/1E4)/100;this.da=this.Ua*this.Z;this.h.T=!1;this.h.rb=!1;this.h.za=a.autoStart;this.h.bb=!1;this.h.Ka=!1;this.Ba=this.ea=0;this.Ha=a.csStart;this.oa=a.csInterval;this.pa=a.csStop;this.H=[];this.kb=this.nc.bind(this);D(this)}x(Bb);var Cb=["power","reset"];
|
|
g=Bb.prototype;g.ja=function(a,b,c,d){this.A=a;this.l=b;this.I=d;for(b=0;b<Cb.length;b++)(c=this.w[Cb[b]])&&this.A.P(null,Cb[b],c);a=Db(a,"autoStart");null!=a&&(this.h.za="true"==a?!0:"false"==a?!1:!!a);D(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.ca=function(a,b){if(!b){if(a&&this.restore){Eb(this);if(!this.restore(a))return!1;Fb(this)}else this.reset();this.M("No debugger detected")}Gb(this);return!0};g.ba=function(a){return a?this.save():!0};
|
|
g.za=function(){return this.h.za||void 0===this.w.run?(Hb(this),!0):!1};g.eb=function(){return 0};function Fb(a){void 0===a.Ha&&(a.Ha=0);void 0===a.oa&&(a.oa=-1);void 0===a.pa&&(a.pa=-1);a.h.Ka=0<=a.Ha&&0<a.oa;a.h.Ka&&(a.Ba=0,a.ea=a.Ha-a.$)}
|
|
function Ib(a,b,c,d){if(a.w[b]){void 0===c&&(a.h.error=!0,a.K("Value for "+b+" is invalid"),K(a));var e=a.I&&a.I.b||8;if(!a.h.T||a.h.bb)if(8==e){e="";d?11<d&&(d=11):d=c&-65536?11:6;if(null==c||isNaN(c))for(;0<d--;)e="?"+e;else for(;0<d--;)e=String.fromCharCode((c&7)+48)+e,c>>=3;d=""+e}else d=k(c,d);else d="--------".substr(0,d||4);a.w[b].textContent!=d&&(a.w[b].textContent=d)}}
|
|
g.P=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.h.L)a=!0;else{var b=null,c,l=y(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.h.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.h.L);c++);c==l.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.h.ready?"powered yet":"ready yet"+(b.La?" (waiting for notification)":""))+".");a=!1}a&&(d.h.T?K(d):Hb(d))};a=!0;break;
|
|
case "speed":this.w[b]=c;a=!0;break;case "setSpeed":this.w[b]=c,c.onclick=function(){Jb(d,d.Z<<1)},c.textContent=this.da.toFixed(2)+"Mhz",a=!0}return a};function Kb(a,b,c){a.$+=b;c&&(a.Y=a.a=0)}function Lb(a,b){var c=1;b&&1<a.Z&&a.W&&(c=a.W/a.Ua);a.ib=Math.round(1E3/30);a.Ja=Math.floor(a.Ia/30*c);b||(a.qa=a.Ja);a.Wa=0}function Mb(a){return a.$+a.S+a.Y-a.a}function Eb(a){a.W=0;a.jb=0;a.$=a.S=a.Y=a.a=0;Fb(a);Jb(a,1)}
|
|
function Jb(a,b){if(void 0!==b&&(.8>a.W/a.da&&(b=1),a.Z=b,b=a.Ua*a.Z,a.da!=b)){a.da=b;b=a.da.toFixed(2)+"Mhz";var c=a.w.setSpeed;c&&(c.textContent=b);a.M("target speed: "+b)}Kb(a,a.S);a.S=0;a.R=ka();a.X=0;Lb(a)}function gb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function ib(a,b,c){0<=b&&b<a.H.length&&0>a.H[b][0]&&(c*=a.Ia*a.Z/1E3,a.H[b][0]=c)}
|
|
g.nc=function(){if(this.h.T){this.Wa>=this.Ia&&Lb(this,!0);this.xa=0;this.Ga=ka();if(this.X){var a=this.Ga-this.X;a>this.ib&&(this.R+=a,this.R>this.Ga&&(this.R=this.Ga))}try{do{for(var b,c=this.h.Ka?1:this.Ja,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.sb(b)}catch(p){if("number"!=typeof p)throw p;}for(var f=this.Y-this.a,a=f,h=this.H.length-1;0<=h;h--){var l=this.H[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.xa+=f;this.S+=f;Kb(this,0,!0);a=f;if(this.h.Ka){var n=
|
|
!1;this.Ba=this.Ba+this.eb()|0;this.ea-=a;0>=this.ea&&(this.ea+=this.oa,n=!0);0<=this.pa&&this.pa<=Mb(this)&&(this.oa=this.pa=-1,Fb(this),K(this),n=!0);n&&this.M(Mb(this)+" cycles: checksum="+k(this.Ba))}this.qa-=f;if(0>=this.qa){this.qa+=this.Ja;15<=++this.jb&&(this.A&&this.A.ua(),this.jb=0);break}}while(this.h.T)}catch(p){K(this);Gb(this);this.A&&this.A.stop(ka(),Mb(this));b=p.stack||p.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.kb;this.X=ka();d=this.ib;this.xa&&(d=
|
|
Math.round(d*this.xa/this.Ja));d-=this.X-this.Ga;if(e=this.X-this.R)this.W=Math.round(this.S/(10*e))/100,864E5<=e&&(this.$=0,Jb(this));if(0>d||this.W<this.da)-1E3>d&&(this.R-=d),d=0;this.Wa+=this.xa;this.X+=d;b(c,d)}}};function Hb(a){var b;a.h.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.M(a.toString()+" busy");else{Jb(a);a.h.T=!0;a.h.rb=!0;if(b=a.w.run)b.textContent="Halt";a.A&&a.A.start(a.R,Mb(a));Gb(a,!0);setTimeout(a.kb,0)}}g.sb=function(){return 0};
|
|
function K(a){if(a.h.T){a.Y-=a.a;a.a=0;Kb(a,a.S);a.S=0;a.h.T=!1;var b=a.w.run;b&&(b.textContent="Run");a.A&&a.A.stop(ka(),Mb(a));Gb(a)}a.h.complete=void 0}function Gb(a,b){a.A&&a.A.ua(b)}
|
|
function Nb(a){this.Db=+a.model||1170;this.Fb=a.resetAddr||0;Bb.call(this,a,6666667);this.fb=0;this.decode=Ob.bind(this);this.m=65536;this.g=32768;this.i=65535;this.o=32768;this.u=15;this.f=[0,0,0,0,0,0,0,this.Fb];this.ra=[0,0,0,0,0,0];this.U=[0,0,0,0];this.Ea=this.v=0;this.Cb=[4,2,0,1];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.O=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.oc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.qb=[0,0,0,0,0,0,0,0];this.c=this.b=this.Sa=this.D=this.F=this.j=this.pb=0;this.fa=-1;Pb(this);this.h.complete=this.h.yb=!1}x(Nb,Bb);g=Nb.prototype;g.reset=function(){this.h.T&&K(this);Pb(this);Eb(this);this.h.error=!1;this.parent.reset.call(this)};
|
|
function Pb(a){a.na=255;a.G=0;a.$a=0;a.B=0;a.la=0;a.Za=0;a.ma=0;a.Na=0;a.Da=0;a.Va=262143;a.Fa=253952;a.s=[];a.j|=2;a.l&&jb(a)}function jb(a){a.Na?(a.V=65536,a.J=a.Bb,a.N=a.ob,a.lb=a.Tc,Ta(a.l,a.ma&16?22:18)):(a.V=0,a.J=a.Ab,a.N=a.kc,a.lb=a.Sc,Ta(a.l,16))}g.eb=function(){return 0};g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.$,this.Z]);a.set(2,cb(this.l));return a.data()};
|
|
g.restore=function(a){var b=a[1];this.$=b[1];Jb(this,b[3]);a:{b=this.l;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,h=Array(b.F),l=0;l<e.length-1;)for(var n=e[l++],p=e[l++];n--;)h[f++]=p;e=h}f=b.b[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
|
g.P=function(a,b,c){switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":this.w[b]=c;this.fb++;a=!0;break;default:a=this.parent.P.call(this,a,b,c)}return a};
|
|
g.ua=function(a){if(this.fb&&(a||!this.h.T||this.h.bb)){for(a=0;a<this.f.length;a++)Ib(this,"R"+a,this.f[a]);a=lb(this);Ib(this,"PS",a);Ib(this,"NF",a&8?1:0,1);Ib(this,"ZF",a&4?1:0,1);Ib(this,"VF",a&2?1:0,1);Ib(this,"CF",a&1?1:0,1)}if(a=this.w.speed)a.textContent=this.h.T&&this.W?this.W.toFixed(2)+"Mhz":"Stopped"};function M(a){return a.m&65536?1:0}g.ia=function(){return this.o&32768?8:0};function Qb(a){var b=a.N(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}
|
|
function hb(a,b,c,d,e){for(var f=a.s.length;0<f--;)if(a.s[f].tb===d){0<f&&(a.s[f-1].aa+=a.s[f].aa);a.s.splice(f,1);break}if(0<=b){for(f=a.s.length;0<f--;){if(a.s[f].aa>b){a.s[f].aa-=b;break}b-=a.s[f].aa}a.s.splice(f+1,0,{aa:b,mb:c<<5&224,tb:d,Qa:e})}a.j|=2}function lb(a){return a.u=a.u&63728|a.ia()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)}
|
|
function mb(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.u)&2048)for(var c=a.ra.length;0<=--c;){var d=a.f[c];a.f[c]=a.ra[c];a.ra[c]=d}a.v=b>>14&3;c=a.u>>14&3;a.v!=c&&(a.U[c]=a.f[6],a.f[6]=a.U[a.v]);a.j|=2;a.u=b}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function Rb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function Sb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))}
|
|
function F(a,b){var c=!1;0>a.fa?a.fa=lb(a):a.v||(b=4,c=!0);a.B&57344||(a.la=63222,a.Za=b);a.v=0;var d=a.N(b|a.V),e=a.N(b+2&65535|a.V);mb(a,e&-12289|a.fa>>2&12288);c&&(a.G|=4,a.f[6]=4);Tb(a,a.fa);Tb(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.fa=-1;throw b;}function Ub(a){var b=Vb(a),c=Vb(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;mb(a,c);a.j&=-17}
|
|
function Wb(a,b,c){var d,e,f,h=0;d=b>>13;a.ma&a.Cb[a.v]||(d&=7);e=a.C[a.v][d];f=(a.O[a.v][d]<<6)+(b&8191)&a.Va;if(f<a.Fa)f&1&&!(c&1)&&(a.G|=64,F(a,4));else if(a.ma&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.ma&32&&(f=a.oc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Fa&&4186112>f&&(a.G|=32,F(a,4))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:128;break;
|
|
default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.C[a.v][d]=e;if(4194170!==f||a.v)a.Da=a.v,a.Ea=d;h&&(h&57344&&(0<=a.fa&&(h|=128),a.B&57344||(a.B=a.B|h|a.Da<<5|a.Ea<<1),F(a,168)),a.B&61440||!(4191360>f||4194239<f)||(a.B|=4096,a.B&512&&(a.j|=32)));return f}function Vb(a){var b=a.N(a.f[6]|a.V);a.f[6]=a.f[6]+2&65535;return b}
|
|
function Tb(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.B&57344||(a.la=a.la<<8|246);!a.v&&c<=a.na&&4<c&&(c<=a.na-32?(a.G|=4,a.f[6]=4,F(a,4)):(a.G|=8,a.j|=4));a.lb(c,b)}
|
|
function Xb(a,b,c,d){var e,f,h=d&8?0:a.V;switch(b){case 0:return F(a,4),0;case 1:return 6===c&&!a.v&&d&4&&(a.f[6]<=a.na||65534<=a.f[6])&&(a.f[6]<=a.na-32||65534<=a.f[6]?(a.G|=4,a.f[6]=4,F(a,4)):(a.G|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|h;case 2:f=2;e=a.f[c];7!==c&&(e|=h,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.N(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.N(e)|h;a.a-=8;break;
|
|
case 6:return e=Qb(a),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=Qb(a),e=e+a.f[c]&65535,e=a.N(e|a.V)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.B&57344||(a.la=a.la<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.na||65534<=a.f[6])&&(a.f[6]<=a.na-32?(a.G|=4,a.f[6]=4,F(a,4)):(a.G|=8,a.j|=64));return e}g.Ab=function(a,b,c){return Xb(this,a,b,c)};g.Bb=function(a,b,c){return Wb(this,Xb(this,a,b,c),c)};g.kc=function(a){return ab(this.l,a)};g.ob=function(a){return ab(this.l,Wb(this,a,2))};
|
|
g.Sc=function(a,b){bb(this.l,a,b&65535)};g.Tc=function(a,b){bb(this.l,Wb(this,a,4),b)};function Yb(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Xb(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.v=a.u>>12&3,c=a.N(d|c&a.V),a.v=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.U[a.u>>12&3];return c}
|
|
function Zb(a,b,c,d){a.B&57344||(a.la=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Xb(a,b,e,4),c&65536||(e&=65535),a.v=a.u>>12&3,e=Wb(a,e|c&65536,4),a.v=a.u>>14&3,bb(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.U[a.u>>12&3]=d}function $b(a,b){b>>=6;var c=a.F=b&7;(b=a.D=(b&56)>>3)?(c=a.J(b,c,3),a=$a(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.F=b&7;return(b=a.D=(b&56)>>3)?ab(a.l,a.J(b,c,2)):a.f[c]}function ac(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Xb(a,b,c,8)}
|
|
function bc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=$a(a.l,c)):a=a.f[c]&255;return a}function R(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?ab(a.l,a.J(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Sa=a.J(b,e,7),c=d.call(a,c,$a(a.l,e)),e&1&&a.a--,a=a.l,a.b[(e&a.i)>>>a.c].Pa(e&a.g,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),bb(a.l,e,d.call(a,c,ab(a.l,e)))):a.f[e]=d.call(a,c,a.f[e])}
|
|
function cc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.J(b,e,5),d&1&&a.a--,a=a.l,a.b[(d&a.i)>>>a.c].Pa(d&a.g,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function dc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?bb(a.l,a.J(b,d,4),c):a.f[d]=c&65535;return c}function U(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3}
|
|
g.sb=function(a){this.h.complete=!0;this.h.yb=!1;this.h.rb=!1;this.Y=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?F(this,168):this.j&64?F(this,4):this.j&16&&F(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.$a&224,c=this.s.length;0<=--c;){if(0<this.s[c].aa){this.s[c].aa--;this.j|=2;break}if(this.s[c].Qa){if(!this.s[c].Qa()){this.s.splice(c,1);continue}this.s[c].Qa=null}this.s[c].mb>b&&(b=this.s[c].mb,a=this.s[c],this.s.splice(c,1))}b>(this.u&224)&&(this.j&4&&(this.f[7]=
|
|
this.f[7]+2&65535,this.j&=-5),a?F(this,a.tb):F(this,160))}else this.j&1&&this.j++;this.B&57344||(this.la=0,this.Za=this.f[7]);this.j=this.j&7|this.u&16;this.decode(Qb(this))}while(0<this.a);return this.h.complete?this.Y-this.a:void 0===this.h.complete?0:-1};t(function(){for(var a=C(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Nb(d);B(d,c)}});function ec(a,b){var c=b+a;Rb(this,c,a,b);return c&65535}function fc(a,b){var c=b+a;Rb(this,c<<8,a<<8,b<<8);return c&255}
|
|
function gc(a,b){a=b<<1;P(this,a);return a&65535}function hc(a,b){a=b<<1;P(this,a<<8);return a&255}function ic(a,b){a=b&32768|b>>1|b<<16;P(this,a);return a&65535}function jc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function kc(a,b){a=b&~a;N(this,a);return a}function lc(a,b){a=b&~a;N(this,a<<8);return a}function mc(a,b){a|=b;N(this,a);return a}function nc(a,b){a|=b;N(this,a<<8);return a}function oc(a,b){a=~b|65536;O(this,a);return a&65535}
|
|
function pc(a,b){a=~b|256;O(this,a<<8);return a&255}function qc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function rc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function sc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function tc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function uc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}
|
|
function vc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255}function wc(a,b){a=b<<1|this.m>>16&1;P(this,a);return a&65535}function xc(a,b){a=b<<1|this.m>>16&1;P(this,a<<8);return a&255}function yc(a,b){a=(this.m&65536|b)>>1|b<<16;P(this,a);return a&65535}function zc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Ac(a,b){var c=b-a;Sb(this,c,a,b);return c&65535}function Bc(a,b){var c=b-a;Sb(this,c<<8,a<<8,b<<8);return c&255}
|
|
function Cc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Dc(a,b){a^=b;N(this,a);return a&65535}function Ec(a){var b=R(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b}
|
|
function Fc(a){var b=R(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function V(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}
|
|
function Hc(a){var b=R(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.m=65536,this.a-=7}var Ic=[0,7,7,10,7,11,9,13];function Jc(a){var b=this.a;a=ac(this,a);this.f[7]=a&65535;this.a=b-Ic[this.c]}
|
|
var Kc=[0,14,14,17,14,18,16,20];function Lc(a){var b=this.a,c=ac(this,a);a=a>>6&7;Tb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Kc[this.c]}var Mc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Nc=[7,13,13,17,14,18,17,21];function Oc(a){var b=R(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}
|
|
function Pc(){this.a-=5}function W(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.o=32768);this.a-=5}function Qc(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Rc(a){T(this,a,0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)}function Sc(a){T(this,a,Q(this,a),Dc);this.a-=this.c?9:3+(7==this.b?2:0)}function X(){F(this,8)}function Ob(a){Tc[a>>12].call(this,a)}
|
|
var Tc=[function(a){Uc[a>>8&15].call(this,a)},function(a){var b=Q(this,a),c=this.a;N(this,dc(this,a,b));this.a=c-Mc[(this.D?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=Q(this,a);a=R(this,a);Sb(this,b-a,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){N(this,Q(this,a)&R(this,a));this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),kc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?
|
|
2:0)},function(a){T(this,a,Q(this,a),mc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),ec);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){Vc[a>>8&15].call(this,a)},function(a){Wc[a>>8&15].call(this,a)},function(a){var b=$b(this,a);N(this,cc(this,a,b,1)<<8);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){var b=$b(this,a)<<8;a=bc(this,a)<<8;Sb(this,b-a,a,b);this.a-=this.c?4+
|
|
(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){N(this,($b(this,a)&bc(this,a))<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){S(this,a,$b(this,a),lc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){S(this,a,$b(this,a),nc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),Ac);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},X],Uc=[function(a){Xc[a>>
|
|
4&15].call(this,a)},function(a){U(this,a,!0)},function(a){U(this,a,!!(this.i&65535))},function(a){U(this,a,this.i&65535?0:4)},function(a){U(this,a,!this.ia()==!(this.g&32768))},function(a){U(this,a,!this.ia()!=!(this.g&32768))},function(a){U(this,a,!!(this.i&65535)&&!this.ia()==!(this.g&32768))},function(a){U(this,a,(this.i&65535?0:4)||!this.ia()!=!(this.g&32768))},Lc,Lc,function(a){Yc[a>>6&3].call(this,a)},function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>>6&3].call(this,a)},function(a){ad[a>>
|
|
6&3].call(this,a)},X,X],Yc=[function(a){O(this,dc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qc);this.a-=this.c?9:3+(7==this.b?2:0)}],Zc=[function(a){T(this,a,0,uc);this.a-=this.c?11:6},function(a){T(this,a,M(this)?1:0,ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,M(this)?1:0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=R(this,
|
|
a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],$c=[function(a){T(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,gc);this.a-=this.c?9:3+(7==this.b?2:0)}],ad=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.ob(a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Yb(this,a,0);Tb(this,a);N(this,a);this.a-=
|
|
11},function(a){var b=Vb(this),c=this.a;Zb(this,a,0,b);N(this,b);this.a=c-Nc[this.c]},function(a){N(this,dc(this,a,this.ia?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Xc=[function(a){bd[a&15].call(this,a)},X,X,X,Jc,Jc,Jc,Jc,function(a){if(a&8)F(this,8);else{var b=Vb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):F(this,8)},function(a){cd[a&15].call(this,a)},function(a){dd[a&15].call(this,a)},Rc,Rc,
|
|
Rc,Rc],bd=[function(){this.u&49152?(this.G|=128,F(this,4)):K(this);this.a-=7},function(){this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Ub(this);this.j|=this.u&16;this.a-=13},function(){F(this,12);this.a-=5},function(){F(this,16);this.a-=25},function(){this.u&49152||(Pb(this),this.l.reset());this.a-=667},function(){Ub(this);this.a-=13},X,X,X,X,X,X,X,X,X],cd=[Pc,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},V,function(){this.i=1;this.a-=5},V,V,V,function(){this.o=0;this.a-=
|
|
5},V,V,V,V,V,V,V],dd=[Pc,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],Vc=[Oc,Oc,Hc,Hc,Ec,Ec,Fc,Fc,Sc,Sc,X,X,X,X,Qc,Qc],Wc=[function(a){U(this,a,!this.ia())},function(a){U(this,a,this.ia())},function(a){U(this,a,!M(this)&&!!(this.i&65535))},function(a){U(this,a,M(this)||(this.i&65535?0:4))},function(a){U(this,a,!(this.g&32768))},function(a){U(this,a,this.g&32768?2:0)},function(a){U(this,
|
|
a,!M(this))},function(a){U(this,a,M(this))},function(){F(this,24);this.a-=25},function(){F(this,28);this.a-=5},function(a){ed[a>>6&3].call(this,a)},function(a){fd[a>>6&3].call(this,a)},function(a){gd[a>>6&3].call(this,a)},function(a){hd[a>>6&3].call(this,a)},X,X],ed=[function(a){O(this,cc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,rc);this.a-=this.c?
|
|
9:3+(7==this.b?2:0)}],fd=[function(a){S(this,a,0,vc);this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],gd=[function(a){S(this,a,0,zc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b?2:0)},function(a){S(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,jc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b?
|
|
2:0)},function(a){S(this,a,0,hc);this.a-=this.c?9:3+(7==this.b?2:0)}],hd=[X,function(a){a=Yb(this,a,65536);Tb(this,a);N(this,a);this.a-=11},function(a){var b=Vb(this),c=this.a;Zb(this,a,65536,b);N(this,b);this.a=c-Nc[this.c]},X];
|
|
function id(a){v.call(this,"ROM",a,id);this.b=null;this.o=a.addr;this.c=a.size;this.s=a.writable;this.g=a.alias;this.i=a.file;this.A=ba(this.i);if(this.i){a=this.i;var b=ca(this.A);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){jd(c,a,b,f)})}}x(id);id.prototype.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;kd(this)};id.prototype.ca=function(){this.m&&(this.I&&this.I.a(this.id,this.o,this.c,this.m),delete this.m);return!0};
|
|
id.prototype.ba=function(){return!0};
|
|
function jd(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ta,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,h,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),h=e=0;e<f.length;e++)a.b[h++]=f[e]&255,a.b[h++]=f[e]>>8&255;else if(f=l.data)for(a.b=Array(4*f.length),h=e=0;e<f.length;e++)a.b[h++]=f[e]&255,a.b[h++]=f[e]>>8&255,a.b[h++]=f[e]>>16&255,a.b[h++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){q("Empty ROM: "+b);
|
|
return}if(1==a.b.length){q(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=aa(b[e]);kd(a)}}
|
|
function kd(a){if(!Ia(a))if(!a.i)D(a);else if(a.b&&a.l){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+k(a.b.length,8,!0)+") does not match specified size ("+k(a.c,8,!0)+")";a.h.error=!0;a.K(b)}else{b=a.o;if(Wa(a.l,b,a.c,a.s?1:sb)){var c;for(c=0;c<a.b.length;c++){var d=a.l,e=b+c,f=a.b[c];d.o++;d.b[(e&d.i)>>>d.c].ub(e&d.g,f&255,e);d.o--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++)d=a,e=b[c],f=Va(d.l,d.o,d.c),Ua(d.l,
|
|
e,d.c,f);delete a.b}}D(a)}}t(function(){for(var a=C(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new id(d);B(d,c)}});function Y(a){v.call(this,"RAM",a,Y);this.g=a.addr;this.c=a.size;this.b=!1}x(Y);Y.prototype.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;!this.b&&this.c&&Wa(this.l,this.g,this.c,1)&&(this.b=!0);this.b||q("No RAM allocated");D(this)};Y.prototype.ca=function(){return!0};Y.prototype.ba=function(){return!0};Y.prototype.reset=function(){};
|
|
t(function(){for(var a=C(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Y(d);B(d,c)}});function ld(a){v.call(this,"Keyboard",a,ld);D(this)}x(ld);ld.prototype.P=function(){return!1};ld.prototype.ja=function(a,b,c,d){this.A=a;this.a=c;this.I=d};t(function(){for(var a=C(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new ld(d);B(d,c)}});
|
|
function Z(a){this.g=this.m=null;this.H=a.tabSize;this.B=a.charBOL;this.o=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=md;b&&(void 0===c&&(c="Panel"),(c=z(c,this.id))&&(b=c.w[b])&&this.P(null,a,b))}this.s=this.v=null;this.exports={connect:this.gb,receiveData:this.Ya}}x(Z);var md="buffer";g=Z.prototype;
|
|
g.P=function(a,b,c){var d=this;switch(b){case md:return this.w[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.Ya(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Ya(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
|
g.ja=function(a,b,c,d){this.A=a;this.l=b;this.a=c;this.I=d;var e=this;this.J=gb(this.a,function(){e.b&128||!e.i.length||(e.F=e.i.shift(),e.b|=128,e.b&64&&hb(e.a,40,4,48))});this.D=function(){e.c|=128;return!!(e.c&64)};eb(b,this,nd);D(this)};
|
|
g.gb=function(){if(!this.s){var a=Db(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ia(b[0]);if(c!=this.Ca)return;b=ia(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.v=d.receiveData){this.status(this.Ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ca=function(a,b){if(!b)if(this.gb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
|
g.ba=function(a){return a?this.save():!0};g.reset=function(){od(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return od(this)};function od(a){a.F=0;a.b=0;a.c=128;a.i=[];return!0}g.Ya=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);ib(this.a,this.J,50);return!0};g.Zb=function(){return this.b&65535};g.Gc=function(a){this.b=this.b&-112|a&111};
|
|
g.Yb=function(){this.b&=-129;0<this.i.length&&ib(this.a,this.J,50);return this.F};g.Fc=function(){};g.mc=function(){return this.c};g.Vc=function(a){128==(this.c&192)&&a&64&&hb(this.a,8,4,52,this.D);this.c=this.c&-70|a&69};g.lc=function(){return 0};
|
|
g.Uc=function(a){if(a&=255){this.v&&this.v.call(this.s,a);if(this.g)if(13==a)this.o=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.o&&this.o--;else{var b;b=(b=ja[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.M(this.m),
|
|
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;hb(this.a,100,4,52,this.D)}};var pd={},nd=(pd[65392]=[null,null,Z.prototype.Zb,Z.prototype.Gc,"RCSR"],pd[65394]=[null,null,Z.prototype.Yb,Z.prototype.Fc,"RBUF"],pd[65396]=[null,null,Z.prototype.mc,Z.prototype.Vc,"XCSR"],pd[65398]=[null,null,Z.prototype.lc,Z.prototype.Uc,"XBUF"],pd);t(function(){for(var a=C(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Z(d);B(d,c)}});
|
|
function qd(a,b,c){v.call(this,"Computer",a,qd);this.h.L=!1;rd(this,b);this.B=Db(this,"autoPower",a);this.g=0;this.N=a.busWidth||a.buswidth;this.b=sd;this.A=null;this.o=this.H=!1;this.R=Db(this,"url")||"";(Math.random()+.1).toString(36);this.c=td(this);if(this.a=z("CPU",this.id)){this.I=z("Debugger",this.id);this.l=new Ma({id:this.Ta+".bus",busWidth:this.N},this.a,this.I);var d,e=y(this.id);if((this.i=z("Panel",this.id))&&this.i.Ra)for(b=0;b<e.length;b++)d=e[b],d.K=this.i.K,d.M=this.i.M,d.Ra=this.i.Ra;
|
|
this.M("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.M("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ja&&d.ja(this,this.l,this.a,this.I);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=Db(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=sd),this.b&&(this.v=new L(this,
|
|
"1.30.1"),ud(this.v)?b=null:delete this.v);!b&&this.b&&(b=vd(this))&&(this.o=!0);if(b){var h=this;m(b,null,!0,function(a,b,c){c?(h.s=null,h.o=!1,h.K("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(h.A=b,h.H=!0);D(h)})}else D(this);this.w.power||(this.B=!0);!c&&this.B&&wd(this,this.Aa)}else q("Unable to find CPU component")}x(qd);var sd=0;
|
|
function rd(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.J=b}function Db(a,b,c){var d=b.toLowerCase(),d=Aa[b]||Aa[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function wd(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ia(f)){Ia(f,function(){wd(a,b,c)});return}}b.call(a,c)}
|
|
function xd(a,b){var c=new L(a,"1.30.1","validate");if(ud(c)&&yd(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=qd.prototype;
|
|
g.Aa=function(a){void 0===a&&(a=this.b||(this.A?1:sd));if(!this.g){this.g++;var b=!1,c=!1;this.F=!1;var d=this.v||new L(this,"1.30.1");if(-1==a)b=!0;else if(a>sd){if(ud(d,this.A)){this.m=new L(this,"1.30.1","failsafe");ud(this.m)&&(zd(this,d),a=2,Ad(this.m));this.m.set("timestamp",la());Bd(this.m);var e=this.b&&!this.o;if(1==a||ma("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=yd(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?ud(d,h):("error"==
|
|
f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.M(f+": "+h),Ad(d),ud(d)?(c=yd(d),e=!0):c=!1))}e&&xd(this,c?d:null)}else 2==a&&d.clear()}else xd(this);delete this.A;delete this.v}e=y(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=Cd(this,h,d,b,c));b=[d,a,c];-1!=a?wd(this,this.cb,b):this.cb(b)}};
|
|
function Cd(a,b,c,d,e){if(!b.h.L){b.h.L=!0;if(b.ca){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ca(f,d)&&f&&(q("Unable to restore state for "+b.type),a.D&&!a.H?(c.clear(),a.b=sd,window&&window.location.reload()):a.F=!0,b.ca(null),e=!1)}if(!d&&b.hb)for(a=b.hb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
g.cb=function(a){var b=a[0],c=0>a[1];a=a[2];this.S=!0;this.h.L=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.a&&(Cd(this,this.a,b,c,a),this.a.za());this.F&&(zd(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0};
|
|
function zd(a,b){if(ma("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.R;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
function Dd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),h=new L(a,"1.30.1","validate"),l=la();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ba&&(c&&K(a.a),d=a.a.ba(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;n<l.length;n++){var p=l[n];p.h.L&&(p.ba&&(d=p.ba(b,c),"object"===typeof d&&f.set(p.id,
|
|
d)),c&&(p.h.L=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Ed(a,a.c,f.toString()),Bd(h)&&Bd(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.h.L=!1,b=a.w.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.l&&this.l.reset&&this.l.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.l&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
|
g.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
|
g.P=function(a,b,c){var d=this;switch(b){case "power":return this.w[b]=c,c.onclick=function(){d.g||(d.h.L?Dd(d,!1,!0):wd(d,d.Aa))},!0;case "reset":return this.w[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.s){var a=ma("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Dd(d,a,!0);!a&&d.D?window&&window.location.reload():d.Aa(sd)}else d.reset(),d.a&&d.a.za()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.w[b]=
|
|
c,c.onclick=function(){var a=td(d,!0);if(a){var b=!!(d.b&&!d.s||d.D),c=Dd(d,b);b?Ed(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
|
function td(a,b){var c=a.c;c||((c=pa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Fd(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
|
function Fd(a,b){a.c=null;b=m(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(qa("user",b.data),a.c=b.data)}catch(d){q(d.message+" ("+c+")")}return a.c}function vd(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+Gd(a,"1.30.1"));return b}
|
|
function Ed(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Gd(a,"1.30.1");d.data=c;b=m(ea()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.K("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.K(c),qa("user",""),a.c=null)}}
|
|
g.ua=function(a){this.a&&this.a.ua(a);this.i&&this.i.ua(a)};t(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],h=A(f),h=new qd(h,d,!0);B(h,f);h.B&&wd(h,h.Aa)}});r.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.S&&!c.h.L&&c.Aa(-1)}});
|
|
r.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.h.L&&Dd(c,!(!c.b||c.s),!0)}});function L(a,b,c){this.id=a.id;this.key=Gd(a,b,c);this.I=a.I;Ad(this,a.Eb)}function Gd(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
|
L.prototype={constructor:L,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){Ad(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
|
1);c=0}}};function Ad(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Bd(a){var b=!0;if(oa()){var c=JSON.stringify(a[a.id]);qa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function yd(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function ud(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:oa()&&(b=pa(a.key))?(a[a.id]=b,a.a=!0):!1}var Hd=0;
|
|
function Id(a,b,c,d,e,f){e("Loading "+a+"...");m(a,null,!0,function(h,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Jd(l,a,b,c,d,e,f)})}
|
|
function Jd(a,b,c,d,e,f,h){function l(a,f){if(f)h(f,null);else{c&&(Ga(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(u){f=null,a=u.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?e?Kd(a,f,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
|
function Kd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],p,u=/( [a-z]+=)(['"])(.*?)\2/g;p=u.exec(f);)n=0>n.indexOf(p[1])?n.replace(">",p[0]+">"):n.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
|
"");a=a.replace(d[0],h);Kd(a,b,c)}})}else c(a,null)}
|
|
function Ld(a,b,c,d){function e(a){if(void 0===l){var b=h&&C(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=ha(a))}function f(a){e("Error: "+a);n&&(--Hd||xa(!0));n=!1}var h,l,n=!0;Hd++;Fa[a]={};try{if(h=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],ga=document.createElement("style");ga.type="text/css";ga.styleSheet?ga.styleSheet.cssText=p:ga.appendChild(document.createTextNode(p));u.appendChild(ga)}c||
|
|
(c="/versions/pdp11/1.30.1/components.xsl");p=function(d,l){l?Id(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--Hd||xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--Hd||xa(!0)):f("invalid machine element: "+
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Id(b,a,d,!0,e,p):Jd(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(Gc){f(Gc.message)}return n}window.embedPDP11=function(a,b,c,d){xa(!1);return Ld(a,b,c,d)};window.enableEvents=xa;window.sendEvent=ya;})();
|