831 lines
100 KiB
JavaScript
831 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.4 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.fb=b.comment;this.Db=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,Wc:!1,Xc:!1,L:!1,error:!1};this.La=null;this.h.error=!1;this.v={};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.T(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},T:function(a,b,c){switch(b){case "clear":return this.v[b]||(this.v[b]=c,c.onclick=function(a){return function(){a.v.print&&(a.v.print.value="")}}(this)),!0;case "print":return this.v[b]||(this.Ra=this.v[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);this.b=0;this.h.bb=!0}x(Ka);g=Ka.prototype;
|
|
g.T=function(a,b,c,d){if(this.A&&this.A.T(a,b,c,d)||this.a&&this.a.T(a,b,c,d))return!0;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":return this.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.T.call(this,a,b,c,d)}};g.ka=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};
|
|
function E(a,b,c,d){if(a.v[b]){void 0===c&&(a.h.error=!0,a.K("Value for "+b+" is invalid"),F(a.a));var e=a.I&&a.I.b||8;if(!a.a.h.S||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.v[b].textContent!=d&&(a.v[b].textContent=d)}}function Ma(a,b,c,d){for(var e=0;e<d;e++){var f=a.v[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
|
g.da=function(a){if(this.b&&(a||!this.a.h.S||this.h.bb)){for(a=0;a<this.a.f.length;a++)E(this,"R"+a,this.a.f[a]);a=Na(this.a);E(this,"PS",a);E(this,"NF",a&8?1:0,1);E(this,"ZF",a&4?1:0,1);E(this,"VF",a&2?1:0,1);E(this,"CF",a&1?1:0,1);Ma(this,"D",this.a.f[0],16);Ma(this,"A",this.a.f[7],22)}};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 Oa(a,b,c){v.call(this,"Bus",a,Oa);this.a=b;this.I=c;this.B=a.busWidth||16;this.m=0;this.H=[];this.w=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.ha=[];this.o=0;this.s=[];this.wb=[Pa,Qa,Ra,Sa];a=new G(this);Ta(a,this.I);this.b=Array(this.A);for(b=0;b<this.A;b++)this.b[b]=a;D(this)}x(Oa);
|
|
function Pa(a,b){var c=-1,d=this.controller,e=d.ha[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.ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=Ua(d)}function Qa(a,b,c){var d=!1,e=this.controller,f=e.ha[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.ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||Ua(e)}
|
|
function Ra(a,b){var c=-1,d=this.controller;(a=d.ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=Ua(d)}function Sa(a,b,c){var d=!1,e=this.controller;if(a=e.ha[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||Ua(e)}function Va(a,b){if(b!=a.m){var c;a.m&&(c=(1<<a.m)-8192,Wa(a,c,8192,a.H),a.m=0);b&&(a.m=b,c=(1<<b)-8192,a.H=Xa(a,c,8192),a.w?Wa(a,c,8192,a.w):(Ya(a,c,8192,Za,a),a.w=Xa(a,c,8192)))}}
|
|
Oa.prototype.reset=function(){for(var a=0;a<this.s.length;a++)this.s[a]();Va(this,16)};function Ua(a){a.o||H(a.a,4);return 0}Oa.prototype.ca=function(a,b){b||this.reset();return!0};
|
|
function Ya(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 $a(1,f,h)}f=new G(a,f,u,a.l,d,e);Ta(f,a.I,n);a.b[l++]=f;f=p+a.l;h-=u}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+ab[d]+" at "+k(b,8,!0)),!0):$a(2,b,c)}
|
|
function Xa(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 Wa(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 bb(a,b){return a.b[(b&a.i)>>>a.c].Xa(b&a.g,b)}function cb(a,b){return a.b[(b&a.i)>>>a.c].jc(b&a.g,b)}function db(a,b,c){a.b[(b&a.i)>>>a.c].Qc(b&a.g,c&65535,b)}
|
|
function eb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.b[d];if(e.ia||e.yb){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 fb(a,b,c,d,e,f,h,l){for(;b<=c;b+=2){var n=b&8191;void 0!==a.ha[n]?q("I/O address already registered: "+k(b,8,!0)):a.ha[n]=[d,e,f,h,l||"unknown",!1]}}
|
|
function gb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Cb)){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;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));fb(a,e,e,h,l,n,p,f[4])}}}function hb(a,b){a.s.push(b)}function ib(a){a.o||H(a.a,4)}
|
|
function $a(a,b,c){q("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Vc:0,Ma:20,Zc:0};this.b={Yc:0,ab:-1}}x(I);g=I.prototype;g.ka=function(a,b,c,d){this.l=b;this.a=c;this.I=d;var e=this;this.b.ab=jb(this.a,function(){e.b.la|=128;e.b.la&64&&(kb(e.a,0,6,64),lb(e.a,e.b.ab,1E3/60))});gb(b,this,J);hb(b,this.reset.bind(this));D(this)};g.Mb=function(){var a=this.b.la;this.b.la&=-129;return a};
|
|
g.uc=function(a){this.b.la=a;a&64&&lb(this.a,this.b.ab,1E3/60);this.b.la=a&-129};g.Ob=function(){var a=this.a;return a.B&62337|a.Da<<5|a.Ea<<1};g.wc=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,mb(b))}nb(this)};g.Pb=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Qb=function(){return this.a.Za};g.Rb=function(){return this.a.na};
|
|
g.xc=function(a){var b=this.a;b.na!=a&&(b.na=a,a&16?(b.Va=4194303,b.Fa=3915776):(b.Va=262143,b.Fa=253952),mb(b));nb(this)};function nb(a){a.c.Ma=a.c.Ma&-8|(a.a.Na?a.a.na&16?1:2:4)}g.cc=function(a){return this.a.C[1][a>>1&7]};g.Jc=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.Hc=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.Ic=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.Gc=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.tc=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.rc=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.sc=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.qc=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.Pc=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.Nc=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.Oc=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.Mc=function(a,b){b=(b>>1&7)+8;this.a.O[3][b]=a;this.a.C[3][b]&=65295};
|
|
g.ta=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.va=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Ub=function(){return this.a.u&49152?this.a.U[0]:this.a.f[6]};g.Ac=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.Dc=function(a){this.a.f[7]=a};g.ua=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a};
|
|
g.Vb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.U[1]};g.Bc=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.Cc=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.pb[a-65504>>1]};g.pc=function(a,b){this.a.pb[b-65504>>1]=a};g.mb=function(a){return 65520==a?61183:0};g.vb=function(){};g.ec=function(){return 1};g.Lc=function(){};g.Gb=function(){return this.a.G};
|
|
g.oc=function(){this.a.G=0};g.Nb=function(){return this.a.ob};g.vc=function(a,b){b&1||(a&=255);this.a.ob=a};g.Sb=function(){return this.a.$a};g.yc=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.oa&65280};g.Kc=function(a){this.a.oa=a|255};g.Tb=function(){return Na(this.a)};g.zc=function(a){ob(this.a,a&-1809|Na(this.a)&1808);this.a.j|=128};g.ub=function(){};g.reset=function(){this.c.Ma=this.c.Ma&-120|20;this.b.la=0};
|
|
var K={},J=(K[62592]=[null,null,I.prototype.cc,I.prototype.Jc,"SISDR"],K[62608]=[null,null,I.prototype.ac,I.prototype.Hc,"SDSDR"],K[62624]=[null,null,I.prototype.bc,I.prototype.Ic,"SISAR"],K[62640]=[null,null,I.prototype.$b,I.prototype.Gc,"SDSAR"],K[62656]=[null,null,I.prototype.Lb,I.prototype.tc,"KISDR"],K[62672]=[null,null,I.prototype.Jb,I.prototype.rc,"KDSDR"],K[62688]=[null,null,I.prototype.Kb,I.prototype.sc,"KISAR"],K[62704]=[null,null,I.prototype.Ib,I.prototype.qc,"KDSAR"],K[62798]=[null,null,
|
|
I.prototype.Rb,I.prototype.xc,"MMR3"],K[65382]=[null,null,I.prototype.Mb,I.prototype.uc,"LKS"],K[65402]=[null,null,I.prototype.Ob,I.prototype.wc,"MMR0"],K[65404]=[null,null,I.prototype.Pb,I.prototype.ub,"MMR1"],K[65406]=[null,null,I.prototype.Qb,I.prototype.ub,"MMR2"],K[65408]=[null,null,I.prototype.ic,I.prototype.Pc,"UISDR"],K[65424]=[null,null,I.prototype.gc,I.prototype.Nc,"UDSDR"],K[65440]=[null,null,I.prototype.hc,I.prototype.Oc,"UISAR"],K[65456]=[null,null,I.prototype.fc,I.prototype.Mc,"UDSAR"],
|
|
K[65472]=[null,null,I.prototype.ta,I.prototype.va,"R0SET0"],K[65473]=[null,null,I.prototype.ta,I.prototype.va,"R1SET0"],K[65474]=[null,null,I.prototype.ta,I.prototype.va,"R2SET0"],K[65475]=[null,null,I.prototype.ta,I.prototype.va,"R3SET0"],K[65476]=[null,null,I.prototype.ta,I.prototype.va,"R4SET0"],K[65477]=[null,null,I.prototype.ta,I.prototype.va,"R5SET0"],K[65478]=[null,null,I.prototype.Ub,I.prototype.Ac,"R6KERNEL"],K[65479]=[null,null,I.prototype.Xb,I.prototype.Dc,"R7KERNEL"],K[65480]=[null,null,
|
|
I.prototype.ua,I.prototype.wa,"R0SET1"],K[65481]=[null,null,I.prototype.ua,I.prototype.wa,"R1SET1"],K[65482]=[null,null,I.prototype.ua,I.prototype.wa,"R2SET1"],K[65483]=[null,null,I.prototype.ua,I.prototype.wa,"R3SET1"],K[65484]=[null,null,I.prototype.ua,I.prototype.wa,"R4SET1"],K[65485]=[null,null,I.prototype.ua,I.prototype.wa,"R5SET1"],K[65486]=[null,null,I.prototype.Vb,I.prototype.Bc,"R6SUPER"],K[65487]=[null,null,I.prototype.Wb,I.prototype.Cc,"R6USER"],K[65504]=[null,null,I.prototype.Hb,I.prototype.pc,
|
|
"CTRL",1170],K[65520]=[null,null,I.prototype.mb,I.prototype.vb,"LSIZE",1170],K[65522]=[null,null,I.prototype.mb,I.prototype.vb,"HSIZE",1170],K[65524]=[null,null,I.prototype.ec,I.prototype.Lc,"SYSID",1170],K[65526]=[null,null,I.prototype.Gb,I.prototype.oc,"CPUERR",1170],K[65528]=[null,null,I.prototype.Nb,I.prototype.vc,"MB",1170],K[65530]=[null,null,I.prototype.Sb,I.prototype.yc,"PIR"],K[65532]=[null,null,I.prototype.dc,I.prototype.Kc,"SL"],K[65534]=[null,null,I.prototype.Tb,I.prototype.zc,"PSW"],
|
|
K);J[62594]=J[62592];J[62596]=J[62592];J[62598]=J[62592];J[62600]=J[62592];J[62602]=J[62592];J[62604]=J[62592];J[62606]=J[62592];J[62610]=J[62608];J[62612]=J[62608];J[62614]=J[62608];J[62616]=J[62608];J[62618]=J[62608];J[62620]=J[62608];J[62622]=J[62608];J[62626]=J[62624];J[62628]=J[62624];J[62630]=J[62624];J[62632]=J[62624];J[62634]=J[62624];J[62636]=J[62624];J[62638]=J[62624];J[62642]=J[62640];J[62644]=J[62640];J[62646]=J[62640];J[62648]=J[62640];J[62650]=J[62640];J[62652]=J[62640];J[62654]=J[62640];
|
|
J[62658]=J[62656];J[62660]=J[62656];J[62662]=J[62656];J[62664]=J[62656];J[62666]=J[62656];J[62668]=J[62656];J[62670]=J[62656];J[62674]=J[62672];J[62676]=J[62672];J[62678]=J[62672];J[62680]=J[62672];J[62682]=J[62672];J[62684]=J[62672];J[62686]=J[62672];J[62690]=J[62688];J[62692]=J[62688];J[62694]=J[62688];J[62696]=J[62688];J[62698]=J[62688];J[62700]=J[62688];J[62702]=J[62688];J[62706]=J[62704];J[62708]=J[62704];J[62710]=J[62704];J[62712]=J[62704];J[62714]=J[62704];J[62716]=J[62704];J[62718]=J[62704];
|
|
J[65410]=J[65408];J[65412]=J[65408];J[65414]=J[65408];J[65416]=J[65408];J[65418]=J[65408];J[65420]=J[65408];J[65422]=J[65408];J[65426]=J[65424];J[65428]=J[65424];J[65430]=J[65424];J[65432]=J[65424];J[65434]=J[65424];J[65436]=J[65424];J[65438]=J[65424];J[65442]=J[65440];J[65444]=J[65440];J[65446]=J[65440];J[65448]=J[65440];J[65450]=J[65440];J[65452]=J[65440];J[65454]=J[65440];J[65458]=J[65456];J[65460]=J[65456];J[65462]=J[65456];J[65464]=J[65456];J[65466]=J[65456];J[65468]=J[65456];J[65470]=J[65456];
|
|
J[65506]=J[65504];J[65508]=J[65504];J[65510]=J[65504];J[65512]=J[65504];J[65514]=J[65504];J[65516]=J[65504];J[65518]=J[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 I(d),B(d,c)}}});var pb;if(Ja){var qb=new ArrayBuffer(2);(new DataView(qb)).setUint16(0,256,!0);pb=256===(new Uint16Array(qb))[0]}else pb=!1;var rb=pb;
|
|
function G(a,b,c,d,e,f){this.l=a;this.id=sb+=2;this.a=null;this.ya=b;this.Oa=c;this.size=d||0;this.type=e||tb;this.v=e==ub;this.controller=null;Ta(this);this.ia=this.yb=!1;if(d)if(f)this.controller=f,this.a=null,vb(this,f.wb);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),vb(this,rb?wb:xb);else{this.a=Array(d>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;vb(this,yb)}else vb(this)}
|
|
var tb=0,ub=2,Za=4,ab=["NONE","RAM","ROM","VID","H/W"],sb=0;
|
|
G.prototype={constructor:G,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.ia=!0}return!1},s:function(){return 255},w: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&&ib(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},ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ia=!0},ra:function(a,b){a&1&&ib(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.ia=!0},F:function(a,b){return this.H(a,b)},
|
|
R:function(a,b){return this.V(a,b)},Z:function(a,b,c){this.v||this.tb(a,b,c)},ga:function(a,b,c){this.v||this.pa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},P:function(a){a&1&&ib(this.l);return this.g.getUint16(a,!0)},W:function(a){a&1&&ib(this.l);return this.o[a>>1]},Y:function(a,b){this.c[a]=b;this.ia=!0},$:function(a,b){this.c[a]=b;this.ia=!0},fa:function(a,b){a&1&&ib(this.l);this.g.setUint16(a,b,!0);this.ia=!0},qa:function(a,b){a&1&&ib(this.l);this.o[a>>1]=b;this.ia=
|
|
!0}};function Ta(a,b,c){a.I=b;a.i=a.m=0;c&&((a.i=c.i)&&zb(a,Ab,!1),(a.m=c.m)&&Bb(a,Ab,!1))}function Bb(a,b,c){c&&a.m||(a.Pa=!a.v&&b[1]||a.w,a.Qc=!a.v&&b[3]||a.B);if(c||void 0===c)a.tb=b[1]||a.w,a.pa=b[3]||a.B}function zb(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 vb(a,b){b||(b=Cb);zb(a,b,void 0);Bb(a,b,void 0)}var Cb=[],yb=[G.prototype.N,G.prototype.ea,G.prototype.X,G.prototype.ra],Ab=[G.prototype.F,G.prototype.Z,G.prototype.R,G.prototype.ga];
|
|
if(Ja)var xb=[G.prototype.D,G.prototype.Y,G.prototype.P,G.prototype.fa],wb=[G.prototype.J,G.prototype.$,G.prototype.W,G.prototype.qa];function Db(a,b){v.call(this,"CPU",a,Db);var c=a.multiplier||1;this.Ia=a.cycles||b;this.Z=c;this.Ua=Math.round(this.Ia/1E4)/100;this.ea=this.Ua*this.Z;this.h.S=!1;this.h.qb=!1;this.h.za=a.autoStart;this.h.Ka=!1;this.Ba=this.fa=0;this.Ha=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.H=[];this.jb=this.nc.bind(this);D(this)}x(Db);var Eb=["power","reset"];g=Db.prototype;
|
|
g.ka=function(a,b,c,d){this.A=a;this.l=b;this.I=d;for(b=0;b<Eb.length;b++)(c=this.v[Eb[b]])&&this.A.T(null,Eb[b],c);a=Fb(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){Gb(this);if(!this.restore(a))return!1;Hb(this)}else this.reset();this.M("No debugger detected")}this.A.da();return!0};g.ba=function(a){return a?this.save():!0};
|
|
g.za=function(){return this.h.za||void 0===this.v.run?(Ib(this),!0):!1};g.eb=function(){return 0};function Hb(a){void 0===a.Ha&&(a.Ha=0);void 0===a.pa&&(a.pa=-1);void 0===a.qa&&(a.qa=-1);a.h.Ka=0<=a.Ha&&0<a.pa;a.h.Ka&&(a.Ba=0,a.fa=a.Ha-a.$)}
|
|
g.T=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.v[b]=c,!0;case "run":return this.v[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.S?F(d):Ib(d))},!0;case "speed":return this.v[b]=
|
|
c,!0;case "setSpeed":return this.v[b]=c,c.onclick=function(){Jb(d,d.Z<<1)},c.textContent=this.ea.toFixed(2)+"Mhz",!0}return!1};g.da=function(){var a=this.v.speed;a&&(a.textContent=this.h.S&&this.W?this.W.toFixed(2)+"Mhz":"Stopped")};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.hb=Math.round(1E3/30);a.Ja=Math.floor(a.Ia/30*c);b||(a.ra=a.Ja);a.Wa=0}function Mb(a){return a.$+a.R+a.Y-a.a}function Gb(a){a.W=0;a.ib=0;a.$=a.R=a.Y=a.a=0;Hb(a);Jb(a,1)}
|
|
function Jb(a,b){if(void 0!==b&&(.8>a.W/a.ea&&(b=1),a.Z=b,b=a.Ua*a.Z,a.ea!=b)){a.ea=b;b=a.ea.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.M("target speed: "+b)}Kb(a,a.R);a.R=0;a.P=ka();a.X=0;Lb(a)}function jb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function lb(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.S){this.Wa>=this.Ia&&Lb(this,!0);this.xa=0;this.Ga=ka();if(this.X){var a=this.Ga-this.X;a>this.hb&&(this.P+=a,this.P>this.Ga&&(this.P=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.rb(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.R+=f;Kb(this,0,!0);a=f;if(this.h.Ka){var n=
|
|
!1;this.Ba=this.Ba+this.eb()|0;this.fa-=a;0>=this.fa&&(this.fa+=this.pa,n=!0);0<=this.qa&&this.qa<=Mb(this)&&(this.pa=this.qa=-1,Hb(this),F(this),n=!0);n&&this.M(Mb(this)+" cycles: checksum="+k(this.Ba))}this.ra-=f;if(0>=this.ra){this.ra+=this.Ja;15<=++this.ib&&(this.A&&this.A.da(),this.ib=0);break}}while(this.h.S)}catch(p){F(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.S){b=setTimeout;c=this.jb;this.X=ka();d=this.hb;this.xa&&(d=Math.round(d*
|
|
this.xa/this.Ja));d-=this.X-this.Ga;if(e=this.X-this.P)this.W=Math.round(this.R/(10*e))/100,864E5<=e&&(this.$=0,Jb(this));if(0>d||this.W<this.ea)-1E3>d&&(this.P-=d),d=0;this.Wa+=this.xa;this.X+=d;b(c,d)}}};function Ib(a){var b;a.h.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.S)a.M(a.toString()+" busy");else{Jb(a);a.h.S=!0;a.h.qb=!0;if(b=a.v.run)b.textContent="Halt";a.A&&a.A.start(a.P,Mb(a));setTimeout(a.jb,0)}}g.rb=function(){return 0};
|
|
function F(a){if(a.h.S){a.Y-=a.a;a.a=0;Kb(a,a.R);a.R=0;a.h.S=!1;var b=a.v.run;b&&(b.textContent="Run");a.A&&a.A.stop(ka(),Mb(a))}a.h.complete=void 0}
|
|
function Nb(a){this.Cb=+a.model||1170;this.Eb=a.resetAddr||0;Db.call(this,a,6666667);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.Eb];this.sa=[0,0,0,0,0,0];this.U=[0,0,0,0];this.Ea=this.w=0;this.Bb=[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.Fb=[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.pb=[0,0,0,0,0,0,0,0];this.c=this.b=this.Sa=this.D=this.F=this.j=this.ob=0;this.ga=-1;Pb(this);this.h.complete=this.h.xb=!1}x(Nb,Db);g=Nb.prototype;g.reset=function(){this.h.S&&F(this);Pb(this);Gb(this);this.h.error=!1;this.parent.reset.call(this)};
|
|
function Pb(a){a.oa=255;a.G=0;a.$a=0;a.B=0;a.ma=0;a.Za=0;a.na=0;a.Na=0;a.Da=0;a.Va=262143;a.Fa=253952;a.s=[];a.j|=2;a.l&&mb(a)}function mb(a){a.Na?(a.V=65536,a.J=a.Ab,a.N=a.nb,a.kb=a.Sc,Va(a.l,a.na&16?22:18)):(a.V=0,a.J=a.zb,a.N=a.kc,a.kb=a.Rc,Va(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,eb(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};function M(a){return a.m&65536?1:0}g.ja=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 kb(a,b,c,d,e){for(var f=a.s.length;0<f--;)if(a.s[f].sb===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,lb:c<<5&224,sb:d,Qa:e})}a.j|=2}function Na(a){return a.u=a.u&63728|a.ja()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)}
|
|
function ob(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.sa.length;0<=--c;){var d=a.f[c];a.f[c]=a.sa[c];a.sa[c]=d}a.w=b>>14&3;c=a.u>>14&3;a.w!=c&&(a.U[c]=a.f[6],a.f[6]=a.U[a.w]);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 H(a,b){var c=!1;0>a.ga?a.ga=Na(a):a.w||(b=4,c=!0);a.B&57344||(a.ma=63222,a.Za=b);a.w=0;var d=a.N(b|a.V),e=a.N(b+2&65535|a.V);ob(a,e&-12289|a.ga>>2&12288);c&&(a.G|=4,a.f[6]=4);Tb(a,a.ga);Tb(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.ga=-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;ob(a,c);a.j&=-17}
|
|
function Wb(a,b,c){var d,e,f,h=0;d=b>>13;a.na&a.Bb[a.w]||(d&=7);e=a.C[a.w][d];f=(a.O[a.w][d]<<6)+(b&8191)&a.Va;if(f<a.Fa)f&1&&!(c&1)&&(a.G|=64,H(a,4));else if(a.na&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Fb[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Fa&&4186112>f&&(a.G|=32,H(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.w][d]=e;if(4194170!==f||a.w)a.Da=a.w,a.Ea=d;h&&(h&57344&&(0<=a.ga&&(h|=128),a.B&57344||(a.B=a.B|h|a.Da<<5|a.Ea<<1),H(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.ma=a.ma<<8|246);!a.w&&c<=a.oa&&4<c&&(c<=a.oa-32?(a.G|=4,a.f[6]=4,H(a,4)):(a.G|=8,a.j|=4));a.kb(c,b)}
|
|
function Xb(a,b,c,d){var e,f,h=d&8?0:a.V;switch(b){case 0:return H(a,4),0;case 1:return 6===c&&!a.w&&d&4&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32||65534<=a.f[6]?(a.G|=4,a.f[6]=4,H(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.ma=a.ma<<8|f<<3&248|c);6==c&&!a.w&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.G|=4,a.f[6]=4,H(a,4)):(a.G|=8,a.j|=64));return e}g.zb=function(a,b,c){return Xb(this,a,b,c)};g.Ab=function(a,b,c){return Wb(this,Xb(this,a,b,c),c)};g.kc=function(a){return cb(this.l,a)};g.nb=function(a){return cb(this.l,Wb(this,a,2))};
|
|
g.Rc=function(a,b){db(this.l,a,b&65535)};g.Sc=function(a,b){db(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.w=a.u>>12&3,c=a.N(d|c&a.V),a.w=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.ma=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Xb(a,b,e,4),c&65536||(e&=65535),a.w=a.u>>12&3,e=Wb(a,e|c&65536,4),a.w=a.u>>14&3,db(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=bb(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)?cb(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=bb(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)?cb(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,bb(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),db(a.l,e,d.call(a,c,cb(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)?db(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.rb=function(a){this.h.complete=!0;this.h.xb=!1;this.h.qb=!1;this.Y=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168):this.j&64?H(this,4):this.j&16&&H(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].lb>b&&(b=this.s[c].lb,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?H(this,a.sb):H(this,160))}else this.j&1&&this.j++;this.B&57344||(this.ma=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(){H(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.ja()==!(this.g&32768))},function(a){U(this,a,!this.ja()!=!(this.g&32768))},function(a){U(this,a,!!(this.i&65535)&&!this.ja()==!(this.g&32768))},function(a){U(this,a,(this.i&65535?0:4)||!this.ja()!=!(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.nb(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.ja?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)H(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):H(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,H(this,4)):F(this);this.a-=7},function(){this.j&4||this.A.da();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(){H(this,12);this.a-=5},function(){H(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.ja())},function(a){U(this,a,this.ja())},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(){H(this,24);this.a-=25},function(){H(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.ka=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(Ya(a.l,b,a.c,a.s?1:ub)){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].tb(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=Xa(d.l,d.o,d.c),Wa(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.ka=function(a,b,c,d){this.l=b;this.a=c;this.I=d;!this.b&&this.c&&Ya(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.T=function(){return!1};ld.prototype.ka=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.v[b])&&this.T(null,a,b))}this.s=this.w=null;this.exports={connect:this.gb,receiveData:this.Ya}}x(Z);var md="buffer";g=Z.prototype;
|
|
g.T=function(a,b,c){var d=this;switch(b){case md:return this.v[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.ka=function(a,b,c,d){this.A=a;this.l=b;this.a=c;this.I=d;var e=this;this.J=jb(this.a,function(){e.b&128||!e.i.length||(e.F=e.i.shift(),e.b|=128,e.b&64&&kb(e.a,40,4,48))});this.D=function(){e.c|=128;return!!(e.c&64)};gb(b,this,nd);D(this)};
|
|
g.gb=function(){if(!this.s){var a=Fb(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.w=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);lb(this.a,this.J,50);return!0};g.Zb=function(){return this.b&65535};g.Fc=function(a){this.b=this.b&-112|a&111};
|
|
g.Yb=function(){this.b&=-129;0<this.i.length&&lb(this.a,this.J,50);return this.F};g.Ec=function(){};g.mc=function(){return this.c};g.Uc=function(a){128==(this.c&192)&&a&64&&kb(this.a,8,4,52,this.D);this.c=this.c&-70|a&69};g.lc=function(){return 0};
|
|
g.Tc=function(a){if(a&=255){this.w&&this.w.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;kb(this.a,100,4,52,this.D)}};var pd={},nd=(pd[65392]=[null,null,Z.prototype.Zb,Z.prototype.Fc,"RCSR"],pd[65394]=[null,null,Z.prototype.Yb,Z.prototype.Ec,"RBUF"],pd[65396]=[null,null,Z.prototype.mc,Z.prototype.Uc,"XCSR"],pd[65398]=[null,null,Z.prototype.lc,Z.prototype.Tc,"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=Fb(this,"autoPower",a);this.g=0;this.N=a.busWidth||a.buswidth;this.b=sd;this.A=null;this.o=this.H=!1;this.P=Fb(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 Oa({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.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ka&&d.ka(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=Fb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=sd),this.b&&(this.w=new L(this,
|
|
"1.30.1"),ud(this.w)?b=null:delete this.w);!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.v.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 Fb(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.w||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.w}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.fb)for(a=b.fb.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.R=!0;this.h.L=!0;var d=this.v.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.P;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&&F(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.v.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)}this.da(!0)};
|
|
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)}this.da(!0)};
|
|
g.T=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.h.L?Dd(d,!1,!0):wd(d,d.Aa))},!0;case "reset":return this.v[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.v[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.da=function(a){this.a&&this.a.da(a);this.i&&this.i.da(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.R&&!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.Db)}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/pdpjs/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;})();
|