pcjs/versions/pdpjs/1.30.1/pdp11.js
2016-10-07 10:58:15 -07:00

850 lines
107 KiB
JavaScript

(function(){/*
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
It has been adapted from the JavaScript PDP 11/70 Emulator v1.3 written by Paul Nankervis
(paulnank@hotmail.com) as of August 2016 from http://skn.noip.me/pdp11/pdp11.html. This code
may be used freely provided the original author name is acknowledged in any modified source code.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
*/
var h;
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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
var ia={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"},ja=Date.now||function(){return+new Date};
function ka(){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 p(a,b,c,d){var e=0,f=null,g=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)}),g;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 m="",n;for(n in b)b.hasOwnProperty(n)&&(m&&(m+="&"),m+=n+"="+encodeURIComponent(b[n]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}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),g=[f,e]);return g}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")}
function q(a){window&&window.alert(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}var ma=null;function na(){if(null==ma){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}ma=a}return ma}function oa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
function pa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function qa(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:[]},ra=!1,sa=!1,ta=!0;function ua(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){r.init.push(a)}
function va(a){if(ta)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 wa(a){!ta&&a?(ta=!0,ra&&xa("init"),sa&&xa("show")):ta=a}function xa(a){r[a]&&va(r[a])}ua("onload",function(){ra=!0;va(r.init)});ua("onpageshow",function(){sa=!0;va(r.show)});ua(qa("Opera")||qa("iOS")?"onunload":"onbeforeunload",function(){va(r.exit)});
function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Rb=b.comment;this.qc=b;b=this.id.indexOf(".");0>b?this.jb=this.id:(this.Eb=this.id.substr(0,b),this.jb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,td:!1,ud:!1,R:!1,error:!1};this.rb=null;this.i.error=!1;this.A={};this.L=null;w.push(this)}var ya=void 0,za={};
if(window){ya||(ya=window.location.search.substr(1));for(var Aa,Ba=/\+/g,Ca=/([^&=]+)=?([^&]*)/g;Aa=Ca.exec(ya);)za[decodeURIComponent(Aa[1].replace(Ba," "))]=decodeURIComponent(Aa[2].replace(Ba," "))}function Da(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=Da(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ea=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Ea={},w=[];function Fa(a,b,c){Ea[a]&&b&&(Ea[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 Ga(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 Ha(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 g=f.getAttribute("class");if(g)for(var l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=A(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),m=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},Z:function(a,b,c){switch(b){case "clear":return this.A[b]||(this.A[b]=c,c.onclick=function(a){return function(){a.A.print&&(a.A.print.value="")}}(this)),!0;case "print":return this.A[b]||(this.Bb=this.A[b]=c,c.value="",this.U=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.P=function(a){this.U(a,this.jb)}),!0;default:return!1}},log:function(){},U:function(){},status:function(a){this.U(this.jb+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},pa:function(){return this.i.R=!0},oa:function(a,b){b&&(this.i.R=!1);return!0}};function D(a){if(!a.i.error&&(a.i.ready=!0,a.i.ready)){var b=a.rb;a.rb=null;b&&b()}}function Ia(a,b){b&&(a.i.ready?b():a.rb=b);return a.i.ready}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ja="undefined"!==typeof ArrayBuffer;function Ka(a){v.call(this,"Panel",a,Ka)}x(Ka);h=Ka.prototype;
h.Z=function(a,b,c,d){return this.B&&this.B.Z(a,b,c,d)||this.a&&this.a.Z(a,b,c,d)?!0:this.parent.Z.call(this,a,b,c,d)};h.za=function(a,b,c,d){this.B=a;this.u=b;this.a=c;this.L=d};h.pa=function(a,b){b||La();return!0};h.oa=function(){return!0};h.Ta=function(){};function La(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Ga(e.id);f||(a=!0,f=new Ka(e));B(f,d);a&&D(f)}}u(La);
function Ma(a,b,c){v.call(this,"Bus",a,Ma);this.a=b;this.L=c;this.B=a.busWidth||16;this.l=Math.pow(2,this.B);this.u=this.l-1|0;this.c=(this.B>>1)+2;10>this.c&&(this.c=10);15<this.c&&(this.c=15);this.g=1<<this.c;this.w=this.g>>2;this.h=this.g-1;this.o=this.l/this.g|0;this.ua=[];this.m=null;this.bb=this.H;a=new E;Na(a,this.L);this.b=Array(this.o);for(b=0;b<this.o;b++)this.b[b]=a;this.Za=Array(4);this.Za[0]=Oa;this.Za[1]=Pa;this.Za[2]=Qa;this.Za[3]=Ra;Sa(this,this.l-8192,8192,Ta,this);Sa(this,57344,
8192,Ta,this);D(this)}x(Ma);function Oa(a,b){var c=-1,d=this.controller,e=d.ua[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.ua[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=d.bb(b|4186112,-1,1)}function Pa(a,b,c){var d=!1,e=this.controller,f=e.ua[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.ua[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||e.bb(c|4186112,b,1)}
function Qa(a,b){var c=-1,d=this.controller;(a=d.ua[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=d.bb(b|4186112,-1,0)}function Ra(a,b,c){var d=!1,e=this.controller;if(a=e.ua[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||e.bb(c|4186112,b,0)}Ma.prototype.reset=function(){this.m&&this.m()};Ma.prototype.H=function(){return 0};Ma.prototype.pa=function(a,b){b||this.reset();return!0};
function Sa(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.c;0<g&&l<a.b.length;){var m=a.b[l],n=l*a.g,t=a.g-(f-n);t>g&&(t=g);if(m&&m.size){if(m.type==d&&m.controller==e){if(f+g<=m.Ya)return m.xb+=m.Ya-f,m.Ya=f,!0;if(f>=m.Ya+m.xb){t=m.size-(f-n);t>g&&(t=g);m.xb=f-m.Ya+t;f=n+a.g;g-=t;l++;continue}}return Ua(1,f,g)}f=new E(f,t,a.g,d,e);Na(f,a.L,m);a.b[l++]=f;f=n+a.g;g-=t}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Va[d]+" at "+k(b,8,!0)),!0):Ua(2,b,c)}function Wa(a,b){return a.b[(b&a.u)>>>a.c].Ib(b&a.h,b)}
function Xa(a){for(var b=0,c=[],d=0;d<a.o;d++){var e=a.b[d];if(e.xa||e.kc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,l=0,m=[];g<e.length;){for(var n=e[g],t=g+1;t<e.length&&e[t]===n;)t++;m[l++]=t-g;m[l++]=n;g=t}m.length<e.length&&(e=m)}c[f]=e}}return c}
function Ya(a,b,c){for(var d in c)for(var e=c[d],f=e[0]?e[0].bind(b):null,g=e[1]?e[1].bind(b):null,l=e[2]?e[2].bind(b):null,m=e[3]?e[3].bind(b):null,n=a,t=+d,e=e[4],z=+d;z<=t;z+=2){var H=z&8191;void 0!==n.ua[H]?q("I/O address already registered: "+k(z,8,!0)):n.ua[H]=[f,g,l,m,!1,e||"unknown"]}}function Za(a,b,c){a.m=b;a.bb=c}function Ua(a,b,c){q("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}
function F(a){v.call(this,"Device",a,F);this.c={data:0,sd:0,Oa:20,Wc:0};this.b={v:0,Mb:-1};this.g={fb:2496,S:0,D:128,gb:0,eb:0,Y:0,$b:0,T:[],Ka:[406,406,406,406],K:[12,12,12,12]};this.h={v:129,ab:0,M:0,Ba:0,va:0,Ga:0,T:[],K:[40,40,40,40],Ka:[1024,1024,512,512],hc:[157,157,29,29]};this.l={a:[8210,8208,8210,8226],K:[22,22,22,50],Ja:[19,19,19,32],zb:[815,411,815,630],T:[],F:2176,Sa:0,Qa:0,da:[0,0,0,0,0,0,0,0],ca:0,V:[4544,4544,4544,4544,4544,4544,4544,4544],Ra:[0,0,0,0,0,0,0,0],Na:0,Tc:[0,0,0,0,0,0,
0,0],ac:0,bc:[0,0,0,0,0,0,0,0],b:[0,0,0,0,0,0,0,0],Uc:[1,2,3,4,5,6,7,8],cc:[0,0,0,0,0,0,0,0],qa:[0,0,0,0,0,0,0,0],wb:[0,0,0,0,0,0,0,0],Rc:[0,0,0,0,0,0,0,0],Sc:[0,0,0,0,0,0,0,0],Pc:[0,0,0,0,0,0,0,0],Qc:[0,0,0,0,0,0,0,0],Fa:0,Lb:0}}x(F);
var $a=[4127,448,4191,450,4383,452,2591,454,21983,32768,65534,13791,16384,65534,770,2719,454,2591,65534,257,0,2566,33028,34051,33282,1281,33537,0,2758,32771,770,1025,1793,0,3078,33794,34305,513,0,5574,43690,4480,4097,4162,4227,4292,4357,57665,1281,769,0,3138,34305,1281,0,24707,2691,2627,24769,34561,1793,0,3076,20739,24899,2691,34562,2753,1281,0,2624,33537,0,16385,24641,1537,1793,0,193,8279,21589,516,12549,1538,2629,513,0,38336,65281,32769,0,32258,2561,2689,32258,3008,514,3009,769,0,5574,510,2551,
2,0,9678,208,769,0,5582,226,135,0,2598,5606,236,2,0,95,242,128,5573,57344,2591,6,5599,256,4,5574,510,3045,5599,460,76,2591,78,5571,65510,5579,12,5570,512,4224,4104,3024,8197,33788,4224,4609,8193,769,0,2640,8197,33785,6145,2625,8193,769,0,8194,761,2574,5572,43690,5579,24,5568,2048,5570,512,2628,4360,2632,2632,8708,769,0,3103,65514,34562,0,305,35406,754,258,119,65160,3024,32403,5579,36,5568,3072,35446,1,740,5570,512,4224,4104,3024,8197,33788,5569,3,2574,3039,454,528,5582,24,4224,2632,2632,8200,769,
0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];h=F.prototype;h.za=function(a,b,c,d){this.u=b;this.a=c;this.L=d;var e=this;this.b.Mb=ab(this.a,function(){e.b.Aa|=128;e.b.Aa&64&&(G(e.a,0,6,64),bb(e.a,e.b.Mb,1E3/60))});Ya(b,this,I);Za(b,this.reset.bind(this),this.ic.bind(this));D(this)};h.wc=function(){var a=this.b.Aa;this.b.Aa&=-129;return a};
h.ad=function(a){this.b.Aa=a;a&64&&bb(this.a,this.b.Mb,1E3/60);this.b.Aa=a&-129};h.xc=function(){var a=this.a;return a.H&62337|a.kb<<5|a.lb<<1};h.bd=function(a){var b=4,c=this.a;c.H=a&=62337;c.kb=a>>5&3;c.lb=a>>1&15;c.Hb=a&257?a&1?6:4:0;cb(c);a=c.H;a&1|256&&(b=this.a.Da&16?1:2);this.c.Oa=this.c.Oa&-8|b};h.Ec=function(a){return this.a.G[1][a>>1&7]};h.jd=function(a,b){this.a.G[1][b>>1&7]=a&65295};h.Cc=function(a){return this.a.G[1][(a>>1&7)+8]};h.gd=function(a,b){this.a.G[1][(b>>1&7)+8]=a&65295};
h.Dc=function(a){return this.a.X[1][a>>1&7]};h.hd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.G[1][b]&=65295};h.Bc=function(a){return this.a.X[1][(a>>1&7)+8]};h.fd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.G[1][b]&=65295};h.vc=function(a){return this.a.G[0][a>>1&7]};h.$c=function(a,b){this.a.G[0][b>>1&7]=a&65295};h.tc=function(a){return this.a.G[0][(a>>1&7)+8]};h.Yc=function(a,b){this.a.G[0][(b>>1&7)+8]=a&65295};h.uc=function(a){return this.a.X[0][a>>1&7]};
h.Zc=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.G[0][b]&=65295};h.sc=function(a){return this.a.X[0][(a>>1&7)+8]};h.Xc=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.G[0][b]&=65295};h.Ic=function(a){return this.a.G[3][a>>1&7]};h.nd=function(a,b){this.a.G[3][b>>1&7]=a&65295};h.Gc=function(a){return this.a.G[3][(a>>1&7)+8]};h.ld=function(a,b){this.a.G[3][(b>>1&7)+8]=a&65295};h.Hc=function(a){return this.a.X[3][a>>1&7]};h.md=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.G[3][b]&=65295};
h.Fc=function(a){return this.a.X[3][(a>>1&7)+8]};h.kd=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.G[3][b]&=65295};h.yc=function(){return db(this.a)};h.cd=function(a){eb(this.a,a&-1809|db(this.a)&1808);this.a.j|=128};
function fb(a){var b=a.g,c,d,e,f=b.Y>>13&7;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.Mc,drive:f,blocksize:256,mapped:0,maxblock:b.Ka[f]*b.K[f],url:"rk"+f+".dsk"});b.D&=-129;switch(b.D>>1&7){case 0:b.fb=2496;b.S=0;b.D=128;b.Y=0;break;case 1:if((b.Y>>4&511)>=b.Ka[f]){b.S|=32832;b.D|=49152;break}if((b.Y&15)>=b.K[f]){b.S|=32800;b.D|=49152;break}c=(b.Y>>4&511)*b.K[f]+(b.Y&15);d=(b.D&48)<<12|b.eb;e=65536-b.gb&65535;gb(a,b.T[f],c,d,e);return;case 2:if((b.Y>>4&511)>=b.Ka[f])b.S|=32832,
b.D|=49152;else if((b.Y&15)>=b.K[f])b.S|=32800,b.D|=49152;else{c=(b.Y>>4&511)*b.K[f]+(b.Y&15);d=(b.D&48)<<12|b.eb;e=65536-b.gb&65535;a.ub(b.T[f],c,d,e);return}}b.fb=f<<13|b.fb&8176|b.Y%9&15;G(a.a,20,5,144,function(){b.D=b.D&65534|128;return!!(b.D&64)})}h.Mc=function(a,b,c,d,e){var f=this.g;f.eb=d&65535;f.D=f.D&-49|d>>12&48;f.gb=65536-e&65535;switch(a){case 1:f.S|=33024;f.D|=49152;break;case 2:f.S|=33792,f.D|=49152}G(this.a,20,5,144,function(){f.D=f.D&65534|128;return!!(f.D&64)})};
function hb(a){var b=a.h,c,d,e,f=b.v>>8&3;b.v&=-2;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.Nc,drive:f,blocksize:128,mapped:1,maxblock:b.Ka[f]*b.K[f],url:"rl"+f+".dsk"});switch(b.v>>1&7){case 2:b.Ba&8&&(b.v&=63);b.Ba=b.hc[f]|b.Ga&64;break;case 3:1==(b.M&3)&&(b.Ga=b.M&4?b.Ga+(b.M&65408)&65408|b.M<<2&64:b.Ga-(b.M&65408)&65408|b.M<<2&64,b.M=b.Ga);break;case 4:b.Ba=b.Ga;break;case 5:if(b.M>>6>=b.Ka[f]){b.v|=37888;break}if((b.M&63)>=b.K[f]){b.v|=37888;break}c=(b.M>>6)*b.K[f]+(b.M&63);
d=(b.va&63)<<16|b.ab;e=65536-b.Ba&65535;gb(a,b.T[f],c,d,e);return;case 6:if(b.M>>6>=b.Ka[f])b.v|=37888;else if((b.M&63)>=b.K[f])b.v|=37888;else{c=(b.M>>6)*b.K[f]+(b.M&63);d=(b.va&63)<<16|b.ab;e=65536-b.Ba&65535;a.ub(b.T[f],c,d,e);return}}G(a.a,20,5,112,function(){b.v|=129;return!!(b.v&64)})}
h.Nc=function(a,b,c,d,e){var f=this.h;f.ab=d&65535;f.v=f.v&-49|d>>12&48;f.va=d>>16&63;f.M=~~(c/f.K[b.na])<<6|c%f.K[b.na];f.Ga=f.M;f.Ba=65536-e&65535;switch(a){case 1:f.v|=33792;break;case 2:f.v|=40960}G(this.a,20,5,112,function(){f.v|=129;return!!(f.v&64)})};function ib(a){a=a.l;a.F=2176;a.ca=0;a.V=[4544,4544,4544,4544,4544,4544,4544,4544];a.Ra=[0,0,0,0,0,0,0,0];a.Na=a.Sa=a.Qa=a.Fa=a.Lb=0}
function jb(a,b){var c=a.l,d,e,f;c.F&=-16513;c.ca&=-2049;c.V[b]&=-1153;G(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.Oc,drive:b,blocksize:256,mapped:0,maxblock:c.zb[0]*c.Ja[0]*c.K[0],url:"rp"+b+".dsk"});switch(c.F&63){case 5:c.wb[b]=c.qa[b];c.F|=32896;c.V[b]|=32896;c.Na|=1<<b;break;case 9:ib(a);break;case 19:c.V[b]|=64;break;case 49:if(c.qa[b]>=c.zb[0]||c.da[b]>>8>=c.Ja[0]||(c.da[b]&255)>=c.K[0]){c.Ra[b]|=1024;c.F|=49152;break}d=(c.qa[b]*c.Ja[0]+(c.da[b]>>8))*c.K[0]+
(c.da[b]&255);e=(c.Fa&63)<<16|c.Qa;f=65536-c.Sa&65535;gb(a,c.T[b],d,e,f);return;case 57:if(c.qa[b]>=c.zb[0]||c.da[b]>>8>=c.Ja[0]||(c.da[b]&255)>=c.K[0])c.Ra[b]|=1024,c.F|=49152;else{d=(c.qa[b]*c.Ja[0]+(c.da[b]>>8))*c.K[0]+(c.da[b]&255);e=(c.Fa&63)<<16|c.Qa;f=65536-c.Sa&65535;a.ub(c.T[b],d,e,f);return}}G(a.a,3,5,172,function(){c.F=c.F&65534|128;c.V[b]|=128;return!!(c.F&64)})}
h.Oc=function(a,b,c,d,e){var f=this.l;f.Sa=65536-e&65535;f.Qa=d&65535;f.F=f.F&-769|d>>8&768;f.Fa=d>>16&63;e=~~(c/f.K[0]);d=~~(e/f.Ja[0]);f.da[b.na]=e%f.Ja[0]<<8|c%f.K[0];f.wb[b.na]=f.qa[b.na]=d;f.Na|=1<<b.na;c>=b.oc-1&&(f.V[b.na]|=1024);switch(a){case 1:f.ca|=512;f.F|=49152;break;case 2:f.ca|=2048,f.F|=49152}G(this.a,20,5,172,function(){f.V[b.na]|=128;f.F=f.F&65534|128;return!!(f.F&64)})};
function kb(a,b,c,d,e,f){var g=~~((f+c.wa-1)/c.wa),l=new XMLHttpRequest;2048>g&&d+2048<c.oc&&(g=2048);l.open("GET",c.url,!0);l.setRequestHeader("Range","bytes="+(d*c.wa<<1)+"-"+(((d+g)*c.wa<<1)-1));l.responseType="arraybuffer";l.onreadystatechange=function(){if(4==l.readyState){var g=b.bind(a),n,t,z,H;n=l.response;if(l.status&&206!=l.status||!n)c.tb(1,c,d,e,f);else{n=new Uint8Array(n);t=d;for(H=0;H<n.length;){if("undefined"===typeof c.cache[t])for(c.cache[t]=[],z=0;z<c.wa;z++)c.cache[t][z]=H<n.length?
n[H]&255|n[H+1]<<8&65280:0,H+=2;else H+=c.wa<<1;t++}g(c,d,e,f)}}};l.send(null)}function J(a,b,c,d,e){c&1?e?d=0<=d?d<<8&65280|b&255:b:K(a.a,4):0<=d?e&&(d=b&65280|d&255):d=b;return d}h.ub=function(a,b,c,d){for(var e;0<d;){if("undefined"===typeof a.cache[b]){kb(this,this.ub,a,b,c,d);return}for(e=0;e<a.wa&&0<d;e++){if(0>this.a.Ua(a.nc?lb(this.a,c):c,a.cache[b][e])){a.tb(2,a,b,c,d);return}c+=2;--d}b++}a.tb(0,a,b,c,d)};
function gb(a,b,c,d,e){for(var f,g;0<e;){if("undefined"===typeof b.cache[c])for(b.cache[c]=[],f=0;f<b.wa;f++)b.cache[c][f]=0;for(f=0;f<b.wa&&0<e;f++){g=a.a.Pa(b.nc?lb(a.a,d):d);if(0>g){b.tb(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.tb(0,b,c,d,e)}h.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.Aa=0;this.g.D=128;this.h.v=128;ib(this)};
h.ic=function(a,b,c){var d,e,f=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.Ea&65280:(a&1&&(b<<=8),f.Ea=b|255,d=0);break;case 4194298:if(0>b)d=f.Kb;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.Kb=d;f.j|=2}break;case 4194294:if(70!==f.La)return K(f,4);0>b?d=f.s:d=f.s=0;break;case 4194292:if(70!==f.La)return K(f,4);d=1;break;case 4194290:if(70!==f.La)return K(f,4);d=0;break;case 4194288:if(70!==f.La)return K(f,4);d=61183;break;case 4194296:0<=b&&!(a&1)&&(b&=
255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.La)return K(f,4);e=a-4194272>>1;0>b?d=f.Cb[e]:(d=J(this,f.Cb[e],a,b,c),0<=d&&(f.Cb[e]=d));break;case 4194254:return a&1?f.C>>14&1?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.fa[3]=b),d=f.fa[3]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.fa[1]=b),d=f.fa[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.C&2048?(0<=b&&(f.f[e]=b),d=f.f[e]):(0<=b&&(f.Ma[e]=b),d=f.Ma[e]),d;case 4194246:return a&
1?(0<=b&&(f.f[7]=b),d=f.f[7]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.fa[0]=b),d=f.fa[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.C&2048?(0<=b&&(f.Ma[e]=b),d=f.Ma[e]):(0<=b&&(f.f[e]=b),d=f.f[e]),d;default:return f.s|=16,K(f,4)}break;case 4194176:e=a>>1&31;d=J(this,f.aa[3][e],a,b,c);0<=d&&(f.aa[3][e]=d,f.aa[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=J(this,f.vb,a,b,c);0<=d&&(f.vb=d);break;case 4194172:d=f.Ca;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194168:0>
b?d=this.c.Wc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;default:return f.s|=16,K(f,4)}break;case 4194048:e=this.g;switch(a&-2){case 4194048:d=J(this,e.fb,a,b,c);0<=d&&(e.fb=d);break;case 4194050:d=J(this,e.S,a,b,c);0<=d&&(e.S=d);break;case 4194052:d=J(this,e.D,a,b,c);0<=b&&0<=d&&(e.D=d&-36993|e.D&36992,e.D&1&&fb(this));break;case 4194054:d=J(this,e.gb,a,b,c);0<=d&&(e.gb=d);break;case 4194056:d=J(this,e.eb,a,b,c);0<=d&&(e.eb=d);break;case 4194058:d=J(this,e.Y,a,b,c);0<=d&&(e.Y=
d);break;case 4194060:break;case 4194062:d=J(this,e.$b,a,b,c);0<=d&&(e.$b=d);break;default:return f.s|=16,K(f,4)}break;case 4193728:var g=this.l;e=g.ca&7;switch(a&-2){case 4193728:d=J(this,g.F,a,b,c);0<=b&&0<=d&&(g.Fa=g.Fa&60|d>>8&3,g.F=d&17279|g.F&34944|2048,d&1&&g.F&128?jb(this,e):192==(d&192)&&G(f,0,5,172));break;case 4193730:d=J(this,g.Sa,a,b,c);0<=d&&(g.Sa=d);break;case 4193732:d=J(this,g.Qa,a,b,c);0<=d&&(g.Qa=d&65534);break;case 4193734:d=J(this,g.da[e],a,b,c);0<=d&&(g.da[e]=d&7967);break;case 4193736:d=
J(this,g.ca,a,b,c);0<=d&&(g.ca=d&63|g.ca&65472,d&128&&ib(this));break;case 4193738:d=g.V[e];break;case 4193740:d=g.Ra[e];break;case 4193742:d=J(this,g.Na,a,b,c);0<=d&&(g.Na=d&255);break;case 4193744:d=g.Tc[e];break;case 4193746:d=J(this,g.ac,a,b,c);0<=d&&(g.ac=d);break;case 4193748:d=J(this,g.bc[e],a,b,c);0<=d&&(g.bc[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.Uc[e];break;case 4193754:d=J(this,g.cc[e],a,b,c);0<=d&&(g.cc[e]=d);break;case 4193756:d=J(this,g.qa[e],a,b,c);0<=d&&(g.qa[e]=
d&511);break;case 4193758:g.wb[e]=g.qa[e];d=g.wb[e];break;case 4193760:d=g.Rc[e];break;case 4193762:d=g.Sc[e];break;case 4193764:d=g.Pc[e];break;case 4193766:d=g.Qc[e];break;case 4193768:d=J(this,g.Fa,a,b,c);0<=d&&(g.Fa=d&63,g.F=g.F&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Lb,a,b,c);0<=d&&(g.Lb=d);break;default:return f.s|=16,K(f,4)}break;case 4192512:e=this.h;switch(a&-2){case 4192512:d=J(this,e.v,a,b,c);0<=b&&0<=d&&(e.va=e.va&60|d>>4&3,e.v=e.v&-1023|d&1022,e.v&128||hb(this));break;case 4192514:d=
J(this,e.ab,a,b,c);0<=d&&(e.ab=d&65534);break;case 4192516:d=J(this,e.M,a,b,c);0<=d&&(e.M=d);break;case 4192518:d=J(this,e.Ba,a,b,c);0<=d&&(e.Ba=d);break;case 4192520:d=J(this,e.va,a,b,c);0<=d&&(e.va=d&63,e.v=e.v&-49|(e.va&3)<<4);break;default:return f.s|=16,K(f,4)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.Da:(d=J(this,f.Da,a,b,c),0<=d&&(70!==f.La&&(d&=-49),f.Da=d,f.sb[0]=d&4?15:7,f.sb[1]=d&2?15:7,f.sb[3]=d&1?15:7,f.Hb&&(e=2,f.Da&16&&(e=1),this.c.Oa=this.c.Oa&-8|e)));break;default:return f.s|=
16,K(f,4)}break;case 4191424:e=a>>1&31;d=J(this,f.aa[0][e],a,b,c);0<=d&&(f.aa[0][e]=d,f.aa[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=J(this,f.aa[1][e],a,b,c);0<=d&&(f.aa[1][e]=d,f.aa[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.La)return K(f,4);e=a>>2&31;d=f.hb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(f.hb[e]=a&2?d<<16|f.hb[e]&65535:f.hb[e]&4294901760|d&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>
b)d=$a[a>>1&255];else return f.s|=16,K(f,4);break;default:return f.s|=16,K(f,4)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};
var L={},I=(L[62592]=[null,null,F.prototype.Ec,F.prototype.jd,"SISDR"],L[62608]=[null,null,F.prototype.Cc,F.prototype.gd,"SDSDR"],L[62624]=[null,null,F.prototype.Dc,F.prototype.hd,"SISAR"],L[62640]=[null,null,F.prototype.Bc,F.prototype.fd,"SDSAR"],L[62656]=[null,null,F.prototype.vc,F.prototype.$c,"KISDR"],L[62672]=[null,null,F.prototype.tc,F.prototype.Yc,"KDSDR"],L[62688]=[null,null,F.prototype.uc,F.prototype.Zc,"KISAR"],L[62704]=[null,null,F.prototype.sc,F.prototype.Xc,"KDSAR"],L[65382]=[null,null,
F.prototype.wc,F.prototype.ad,"LKS"],L[65402]=[null,null,F.prototype.xc,F.prototype.bd,"MMR0"],L[65408]=[null,null,F.prototype.Ic,F.prototype.nd,"UISDR"],L[65424]=[null,null,F.prototype.Gc,F.prototype.ld,"UDSDR"],L[65440]=[null,null,F.prototype.Hc,F.prototype.md,"UISAR"],L[65456]=[null,null,F.prototype.Fc,F.prototype.kd,"UDSAR"],L[65534]=[null,null,F.prototype.yc,F.prototype.cd,"PSW"],L);I[62594]=I[62592];I[62596]=I[62592];I[62598]=I[62592];I[62600]=I[62592];I[62602]=I[62592];I[62604]=I[62592];
I[62606]=I[62592];I[62610]=I[62608];I[62612]=I[62608];I[62614]=I[62608];I[62616]=I[62608];I[62618]=I[62608];I[62620]=I[62608];I[62622]=I[62608];I[62626]=I[62624];I[62628]=I[62624];I[62630]=I[62624];I[62632]=I[62624];I[62634]=I[62624];I[62636]=I[62624];I[62638]=I[62624];I[62642]=I[62640];I[62644]=I[62640];I[62646]=I[62640];I[62648]=I[62640];I[62650]=I[62640];I[62652]=I[62640];I[62654]=I[62640];I[62658]=I[62656];I[62660]=I[62656];I[62662]=I[62656];I[62664]=I[62656];I[62666]=I[62656];I[62668]=I[62656];
I[62670]=I[62656];I[62674]=I[62672];I[62676]=I[62672];I[62678]=I[62672];I[62680]=I[62672];I[62682]=I[62672];I[62684]=I[62672];I[62686]=I[62672];I[62690]=I[62688];I[62692]=I[62688];I[62694]=I[62688];I[62696]=I[62688];I[62698]=I[62688];I[62700]=I[62688];I[62702]=I[62688];I[62706]=I[62704];I[62708]=I[62704];I[62710]=I[62704];I[62712]=I[62704];I[62714]=I[62704];I[62716]=I[62704];I[62718]=I[62704];I[65410]=I[65408];I[65412]=I[65408];I[65414]=I[65408];I[65416]=I[65408];I[65418]=I[65408];I[65420]=I[65408];
I[65422]=I[65408];I[65426]=I[65424];I[65428]=I[65424];I[65430]=I[65424];I[65432]=I[65424];I[65434]=I[65424];I[65436]=I[65424];I[65438]=I[65424];I[65442]=I[65440];I[65444]=I[65440];I[65446]=I[65440];I[65448]=I[65440];I[65450]=I[65440];I[65452]=I[65440];I[65454]=I[65440];I[65458]=I[65456];I[65460]=I[65456];I[65462]=I[65456];I[65464]=I[65456];I[65466]=I[65456];I[65468]=I[65456];I[65470]=I[65456];
u(function(){for(var a=C(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new F(d);B(d,c)}});var mb;if(Ja){var nb=new ArrayBuffer(2);(new DataView(nb)).setUint16(0,256,!0);mb=256===(new Uint16Array(nb))[0]}else mb=!1;var ob=mb;
function E(a,b,c,d,e){this.id=pb+=2;this.a=null;this.Ya=a;this.xb=b;this.size=c||0;this.type=d||qb;this.A=d==rb;this.controller=null;Na(this);this.xa=this.kc=!1;if(c)if(e)this.controller=e,this.a=null,sb(this,e.Za);else if(Ja)this.b=new ArrayBuffer(c),this.g=new DataView(this.b,0,c),this.c=new Uint8Array(this.b,0,c),this.l=new Uint16Array(this.b,0,c>>1),this.a=new Int32Array(this.b,0,c>>2),sb(this,ob?tb:ub);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;sb(this,vb)}else sb(this)}
var qb=0,rb=2,Ta=4,Va=["NONE","RAM","ROM","VID","H/W"],pb=0;
E.prototype={constructor:E,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ja)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ja)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.xa=!0}return!1},m:function(){return 255},B:function(){},o:function(a,b){return this.Ib(a++,b++)|this.Ib(a,b)<<8},w:function(a,b,c){this.yb(a++,
b&255,c++);this.yb(a,b>>8,c)},O:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ha:function(a){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},la:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.xa=!0},Ia:function(a,b){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.xa=!0},I:function(a,b){return this.J(a,b)},$:function(a,b){return this.ea(a,
b)},ja:function(a,b,c){this.A||this.gc(a,b,c)},sa:function(a,b,c){this.A||this.ta(a,b,c)},H:function(a){return this.c[a]},N:function(a){return this.c[a]},W:function(a){return this.g.getUint16(a,!0)},ga:function(a){return this.l[a>>1]},ia:function(a,b){this.c[a]=b;this.xa=!0},ka:function(a,b){this.c[a]=b;this.xa=!0},ra:function(a,b){this.g.setUint16(a,b,!0);this.xa=!0},Ha:function(a,b){this.l[a>>1]=b;this.xa=!0}};
function Na(a,b,c){a.L=b;a.h=a.u=0;c&&((a.h=c.h)&&wb(a,xb,!1),(a.u=c.u)&&yb(a,xb,!1))}function yb(a,b,c){c&&a.u||(a.yb=!a.A&&b[1]||a.B,a.od=!a.A&&b[3]||a.w);if(c||void 0===c)a.gc=b[1]||a.B,a.ta=b[3]||a.w}function wb(a,b,c){c&&a.h||(a.Ib=b[0]||a.m,a.Jc=b[2]||a.o);if(c||void 0===c)a.J=b[0]||a.m,a.ea=b[2]||a.o}function sb(a,b){b||(b=zb);wb(a,b,void 0);yb(a,b,void 0)}var zb=[],vb=[E.prototype.O,E.prototype.la,E.prototype.ha,E.prototype.Ia],xb=[E.prototype.I,E.prototype.ja,E.prototype.$,E.prototype.sa];
if(Ja)var ub=[E.prototype.H,E.prototype.ia,E.prototype.W,E.prototype.ra],tb=[E.prototype.N,E.prototype.ka,E.prototype.ga,E.prototype.Ha];function Ab(a,b){v.call(this,"CPU",a,Ab);var c=a.multiplier||1;this.ob=a.cycles||b;this.ka=c;this.Fb=Math.round(this.ob/1E4)/100;this.ra=this.Fb*this.ka;this.i.ba=!1;this.i.dc=!1;this.i.$a=a.autoStart;this.i.Nb=!1;this.i.qb=!1;this.ib=this.sa=0;this.nb=a.csStart;this.Ia=a.csInterval;this.Va=a.csStop;this.N=[];this.Wb=this.Vc.bind(this);D(this)}x(Ab);
var Bb=["power","reset"];h=Ab.prototype;h.za=function(a,b,c,d){this.B=a;this.u=b;this.L=d;for(b=0;b<Bb.length;b++)(c=this.A[Bb[b]])&&this.B.Z(null,Bb[b],c);this.Ha=null;a=Cb(a,"autoStart");null!=a&&(this.i.$a="true"==a?!0:"false"==a?!1:!!a);D(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.pa=function(a,b){if(!b){if(a&&this.restore){Db(this);if(!this.restore(a))return!1;Eb(this)}else this.reset();this.U("No debugger detected")}Fb(this);return!0};
h.oa=function(a){return a?this.save():!0};h.$a=function(){return this.i.$a||void 0===this.A.run?(Gb(this),!0):!1};h.Pb=function(){return 0};function Eb(a){void 0===a.nb&&(a.nb=0);void 0===a.Ia&&(a.Ia=-1);void 0===a.Va&&(a.Va=-1);a.i.qb=0<=a.nb&&0<a.Ia;a.i.qb&&(a.ib=0,a.sa=a.nb-a.la)}
function Hb(a,b,c,d){if(a.A[b]){void 0===c&&(a.i.error=!0,a.P("Value for "+b+" is invalid"),M(a));var e=a.L&&a.L.b||8;if(!a.i.ba||a.i.Nb)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.A[b].textContent!=d&&(a.A[b].textContent=d)}}
h.Z=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.A[b]=c;a=!0;break;case "run":this.A[b]=c;c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.i.R)a=!0;else{var b=null,c,l=y(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.i.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.i.R);c++);c==l.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.i.ready?"powered yet":"ready yet"+(b.rb?" (waiting for notification)":""))+".");a=!1}a&&(d.i.ba?M(d):Gb(d))};a=!0;break;
case "speed":this.A[b]=c;a=!0;break;case "setSpeed":this.A[b]=c,c.onclick=function(){Ib(d,d.ka<<1)},c.textContent=this.ra.toFixed(2)+"Mhz",a=!0}return a};function Jb(a,b,c){a.la+=b;c&&(a.ja=a.a=0)}function Kb(a,b){var c=1;b&&1<a.ka&&a.ha&&(c=a.ha/a.Fb);a.Ub=Math.round(1E3/30);a.pb=Math.floor(a.ob/30*c);b||(a.Wa=a.pb);a.Gb=0}function Lb(a){return a.la+a.ea+a.ja-a.a}function Db(a){a.ha=0;a.Vb=0;a.la=a.ea=a.ja=a.a=0;Eb(a);Ib(a,1)}
function Ib(a,b){if(void 0!==b&&(.8>a.ha/a.ra&&(b=1),a.ka=b,b=a.Fb*a.ka,a.ra!=b)){a.ra=b;b=a.ra.toFixed(2)+"Mhz";var c=a.A.setSpeed;c&&(c.textContent=b);a.U("target speed: "+b)}Jb(a,a.ea);a.ea=0;a.$=ja();a.ia=0;Kb(a)}function ab(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function bb(a,b,c){0<=b&&b<a.N.length&&0>a.N[b][0]&&(c*=a.ob*a.ka/1E3,a.N[b][0]=c)}
h.Vc=function(){if(this.i.ba){this.Gb>=this.ob&&Kb(this,!0);this.Xa=0;this.mb=ja();if(this.ia){var a=this.mb-this.ia;a>this.Ub&&(this.$+=a,this.$>this.mb&&(this.$=this.mb))}try{do{for(var b,c=this.i.qb?1:this.pb,d=this.N.length-1;0<=d;d--){var e=this.N[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ec(b)}catch(n){if("number"!=typeof n)throw n;}for(var f=this.ja-this.a,a=f,g=this.N.length-1;0<=g;g--){var l=this.N[g];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Xa+=f;this.ea+=f;Jb(this,0,!0);a=f;if(this.i.qb){var m=
!1;this.ib=this.ib+this.Pb()|0;this.sa-=a;0>=this.sa&&(this.sa+=this.Ia,m=!0);0<=this.Va&&this.Va<=Lb(this)&&(this.Ia=this.Va=-1,Eb(this),M(this),m=!0);m&&this.U(Lb(this)+" cycles: checksum="+k(this.ib))}this.Wa-=f;if(0>=this.Wa){this.Wa+=this.pb;15<=++this.Vb&&(this.B&&this.B.Ta(),this.Vb=0);break}}while(this.i.ba)}catch(n){M(this);Fb(this);this.B&&this.B.stop(ja(),Lb(this));b=n.stack||n.message;this.i.error=!0;this.P(b);return}if(this.i.ba){b=setTimeout;c=this.Wb;this.ia=ja();d=this.Ub;this.Xa&&
(d=Math.round(d*this.Xa/this.pb));d-=this.ia-this.mb;if(e=this.ia-this.$)this.ha=Math.round(this.ea/(10*e))/100,864E5<=e&&(this.la=0,Ib(this));if(0>d||this.ha<this.ra)-1E3>d&&(this.$-=d),d=0;this.Gb+=this.Xa;this.ia+=d;b(c,d)}}};function Gb(a){var b;a.i.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.ba)a.U(a.toString()+" busy");else{Ib(a);a.i.ba=!0;a.i.dc=!0;a.Ha&&a.Ha.start();if(b=a.A.run)b.textContent="Halt";a.B&&a.B.start(a.$,Lb(a));Fb(a,!0);setTimeout(a.Wb,0)}}h.ec=function(){return 0};
function M(a){if(a.i.ba){a.ja-=a.a;a.a=0;Jb(a,a.ea);a.ea=0;a.i.ba=!1;a.Ha&&a.Ha.stop();var b=a.A.run;b&&(b.textContent="Run");a.B&&a.B.stop(ja(),Lb(a));Fb(a)}a.i.complete=void 0}function Fb(a,b){a.B&&a.B.Ta(b)}
function Mb(a){this.rc=a.resetAddr||0;Ab.call(this,a,6666667);this.Qb=0;this.decode=Nb.bind(this);this.l=65536;this.g=32768;this.h=65535;this.m=32768;this.C=15;this.f=[0,0,0,0,0,0,0,this.rc];this.Ma=[0,0,0,0,0,0];this.fa=[0,0,0,0];this.lb=this.w=0;this.pc=[4,2,0,1];this.G=[[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.X=[[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.aa=[[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],[65535,65535,65535,65535,65535,65535,65535,65535,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.hb=[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.Cb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.c=this.b=this.Db=this.I=this.J=this.j=0;this.La=70;this.ta=-1;Ob(this);this.i.complete=this.i.jc=!1}x(Mb,Ab);h=Mb.prototype;h.reset=function(){this.i.ba&&M(this);Ob(this);Db(this);this.i.error=!1;this.parent.reset.call(this)};function Ob(a){a.Ea=255;a.s=0;a.Kb=0;a.H=0;a.Ca=0;a.vb=0;a.Da=0;a.Hb=0;a.kb=0;a.sb=262143;a.Tb=253952;a.o=[];a.j|=2;cb(a)}
function cb(a){a.Hb?(a.ga=65536,a.O=a.mc,a.W=a.Zb,a.Xb=a.pd):(a.ga=0,a.O=a.lc,a.W=a.Pa,a.Xb=a.Ua)}h.Pb=function(){return 0};h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.la,this.ka]);a.set(2,Xa(this.u));return a.data()};
h.restore=function(a){var b=a[1];this.la=b[1];Ib(this,b[3]);a:{b=this.u;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.w){for(var f=0,g=Array(b.w),l=0;l<e.length-1;)for(var m=e[l++],n=e[l++];m--;)g[f++]=n;e=g}f=b.b[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
h.Z=function(a,b,c){switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":this.A[b]=c;this.Qb++;a=!0;break;default:a=this.parent.Z.call(this,a,b,c)}return a};
h.Ta=function(a){if(this.Qb&&(a||!this.i.ba||this.i.Nb)){for(a=0;a<this.f.length;a++)Hb(this,"R"+a,this.f[a]);a=db(this);Hb(this,"PS",a);Hb(this,"NF",a&8?1:0,1);Hb(this,"ZF",a&4?1:0,1);Hb(this,"VF",a&2?1:0,1);Hb(this,"CF",a&1?1:0,1)}if(a=this.A.speed)a.textContent=this.i.ba&&this.ha?this.ha.toFixed(2)+"Mhz":"Stopped"};function O(a){return a.l&65536?1:0}h.ya=function(){return this.m&32768?8:0};function Pb(a){var b=a.W(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}
function G(a,b,c,d,e){for(var f=a.o.length;0<f--;)if(a.o[f].fc===d){0<f&&(a.o[f-1].ma+=a.o[f].ma);a.o.splice(f,1);break}if(0<=b){for(f=a.o.length;0<f--;){if(a.o[f].ma>b){a.o[f].ma-=b;break}b-=a.o[f].ma}a.o.splice(f+1,0,{ma:b,Yb:c<<5&224,fc:d,Ab:e})}a.j|=2}function db(a){return a.C=a.C&63728|a.ya()|(a.h&65535?0:4)|(a.g&32768?2:0)|O(a)}
function eb(a,b){a.m=b<<12;a.h=~b&4;a.g=b<<14;a.l=b<<16;if((b^a.C)&2048)for(var c=a.Ma.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ma[c];a.Ma[c]=d}a.w=b>>14&3;c=a.C>>14&3;a.w!=c&&(a.fa[c]=a.f[6],a.f[6]=a.fa[a.w]);a.j|=2;a.C=b}function P(a,b){a.j&128||(a.m=a.h=b,a.g=0)}function Q(a,b,c){a.j&128||(a.m=a.h=a.l=b,a.g=c||0)}function Qb(a,b,c,d){a.j&128||(a.m=a.h=a.l=b,a.g=(c^b)&(d^b))}function R(a,b){a.j&128||(a.m=a.h=a.l=b,a.g=a.m^a.l>>1)}function Rb(a,b,c,d){a.j&128||(a.m=a.h=a.l=b,a.g=(c^d)&(d^b))}
function K(a,b){var c=!1;0>a.ta?a.ta=db(a):a.w||(b=4,c=!0);a.H&57344||(a.Ca=63222,a.vb=b);a.w=0;var d=a.W(b|a.ga),e=a.W(b+2&65535|a.ga);eb(a,e&-12289|a.ta>>2&12288);c&&(a.s|=4,a.f[6]=4);Sb(a,a.ta);Sb(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.ta=-1;throw b;}function Tb(a){var b=Ub(a),c=Ub(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);a.f[7]=b&65535;eb(a,c);a.j&=-17}
function lb(a,b){var c=b>>13&31;31>c?a.Da&32&&(b=a.hb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b}
function Vb(a,b,c){var d,e,f,g=0;d=b>>13;a.Da&a.pc[a.w]||(d&=7);e=a.G[a.w][d];f=(a.X[a.w][d]<<6)+(b&8191)&a.sb;f<a.Tb?f&1&&!(c&1)&&(a.s|=64,K(a,4)):(a.Da&16||253952<=f&&(f|=4186112),4186112>f&&(3932160<=f&&(f=lb(a,f&262143)),f>=a.Tb&&4186112>f&&(a.s|=32,K(a,4))));switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));
a.G[a.w][d]=e;if(4194170!==f||a.w)a.kb=a.w,a.lb=d;g&&(g&57344&&(0<=a.ta&&(g|=128),a.H&57344||(a.H=a.H|g|a.kb<<5|a.lb<<1),K(a,168)),a.H&61440||!(4191360>f||4194239<f)||(a.H|=4096,a.H&512&&(a.j|=32)));return f}function Ub(a){var b=a.W(a.f[6]|a.ga);a.f[6]=a.f[6]+2&65535;return b}function Sb(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.H&57344||(a.Ca=a.Ca<<8|246);!a.w&&c<=a.Ea&&4<c&&(c<=a.Ea-32?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.j|=4));a.Xb(c,b)}
function Wb(a,b,c,d){var e,f,g=d&8?0:a.ga;switch(b){case 0:return K(a,4),0;case 1:return 6===c&&!a.w&&d&4&&(a.f[6]<=a.Ea||65534<=a.f[6])&&(a.f[6]<=a.Ea-32||65534<=a.f[6]?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=g);e=a.W(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=g);e=a.W(e)|g;a.a-=8;break;
case 6:return e=Pb(a),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=Pb(a),e=e+a.f[c]&65535,e=a.W(e|a.ga)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!g||a.H&57344||(a.Ca=a.Ca<<8|f<<3&248|c);6==c&&!a.w&&d&4&&0>=f&&(a.f[6]<=a.Ea||65534<=a.f[6])&&(a.f[6]<=a.Ea-32?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.j|=64));return e}h.lc=function(a,b,c){return Wb(this,a,b,c)};h.mc=function(a,b,c){return Vb(this,Wb(this,a,b,c),c)};h.Pa=function(a){a&1&&(this.s|=64,K(this,4));var b=this.u;return b.b[(a&b.u)>>>b.c].Jc(a&b.h,a)};
h.Zb=function(a){return this.Pa(Vb(this,a,2))};h.Ua=function(a,b){a&1&&(this.s|=64,K(this,4));var c=this.u;c.b[(a&c.u)>>>c.c].od(a&c.h,b&65535,a)};h.pd=function(a,b){this.Ua(Vb(this,a|65536,4),b)};function Xb(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Wb(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.w=a.C>>12&3,c=a.W(d|c&a.ga),a.w=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.fa[a.C>>12&3];return c}
function Yb(a,b,c,d){a.H&57344||(a.Ca=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Wb(a,b,e,4),c&65536||(e&=65535),a.w=a.C>>12&3,e=Vb(a,e|c&65536,4),a.w=a.C>>14&3,a.Ua(e,d)):6!=e||(a.C>>2&12288)===(a.C&12288)?a.f[e]=d:a.fa[a.C>>12&3]=d}function Zb(a,b){b>>=6;var c=a.J=b&7;(b=a.I=(b&56)>>3)?(c=a.O(b,c,3),a=Wa(a.u,c)):a=a.f[c]&255;return a}function S(a,b){var c;b>>=6;var d=a.J=b&7;(b=a.I=(b&56)>>3)?c=a.Pa(a.O(b,d,2)):c=a.f[d];return c}function $b(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Wb(a,b,c,8)}
function ac(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.O(b,c,3),a=Wa(a.u,c)):a=a.f[c]&255;return a}function bc(a,b){var c,d=a.b=b&7;(b=a.c=(b&56)>>3)?c=a.Pa(a.O(b,d,2)):c=a.f[d];return c}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Db=a.O(b,e,7),c=d.call(a,c,Wa(a.u,e)),e&1&&a.a--,a=a.u,a.b[(e&a.u)>>>a.c].yb(e&a.h,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.O(b,e,6),a.Ua(e,d.call(a,c,a.Pa(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.O(b,e,5),d&1&&a.a--,a=a.u,a.b[(d&a.u)>>>a.c].yb(d&a.h,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)?a.Ua(a.O(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3}
h.ec=function(a){this.i.complete=!0;this.i.jc=!1;this.i.dc=!1;this.ja=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?K(this,168):this.j&64?K(this,4):this.j&16&&K(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.Kb&224,c=this.o.length;0<=--c;){if(0<this.o[c].ma){this.o[c].ma--;this.j|=2;break}if(this.o[c].Ab){if(!this.o[c].Ab()){this.o.splice(c,1);continue}this.o[c].Ab=null}this.o[c].Yb>b&&(b=this.o[c].Yb,a=this.o[c],this.o.splice(c,1))}b>(this.C&224)&&(this.j&4&&(this.f[7]=
this.f[7]+2&65535,this.j&=-5),a?K(this,a.fc):K(this,160))}else this.j&1&&this.j++;this.H&57344||(this.Ca=0,this.vb=this.f[7]);this.j=this.j&7|this.C&16;this.decode(Pb(this))}while(0<this.a);return this.i.complete?this.ja-this.a:void 0===this.i.complete?0:-1};u(function(){for(var a=C(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Mb(d);B(d,c)}});function ec(a,b){var c=b+a;Qb(this,c,a,b);return c&65535}function fc(a,b){var c=b+a;Qb(this,c<<8,a<<8,b<<8);return c&255}
function gc(a,b){a=b<<1;R(this,a);return a&65535}function hc(a,b){a=b<<1;R(this,a<<8);return a&255}function ic(a,b){a=b&32768|b>>1|b<<16;R(this,a);return a&65535}function jc(a,b){a=b&2048|b>>1|b<<8;R(this,a<<8);return a&255}function kc(a,b){a=b&~a;P(this,a);return a}function lc(a,b){a=b&~a;P(this,a<<8);return a}function mc(a,b){a|=b;P(this,a);return a}function nc(a,b){a|=b;P(this,a<<8);return a}function oc(a,b){a=~b|65536;Q(this,a);return a&65535}
function pc(a,b){a=~b|256;Q(this,a<<8);return a&255}function qc(a,b){a=b-a;this.j&128||(this.m=this.h=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.m=this.h=c,this.g=b&(b^c));return a&255}function sc(a,b){a=b+a;this.j&128||(this.m=this.h=a,this.g=a&(b^a));return a&65535}function tc(a,b){a=b+a;var c=a<<8;this.j&128||(this.m=this.h=c,this.g=c&(b<<8^c));return a&255}function uc(a,b){a=-b;Q(this,a,a&b&32768);return a&65535}
function vc(a,b){a=-b;Q(this,a<<8,(a&b&128)<<8);return a&255}function wc(a,b){a=b<<1|this.l>>16&1;R(this,a);return a&65535}function xc(a,b){a=b<<1|this.l>>16&1;R(this,a<<8);return a&255}function yc(a,b){a=(this.l&65536|b)>>1|b<<16;R(this,a);return a&65535}function zc(a,b){a=((this.l&65536)>>8|b)>>1|b<<8;R(this,a<<8);return a&255}function Ac(a,b){var c=b-a;Rb(this,c,a,b);return c&65535}function Bc(a,b){var c=b-a;Rb(this,c<<8,a<<8,b<<8);return c&255}
function Cc(a,b){this.j&128||(this.m=this.h=b&65280,this.g=this.l=0);return(b<<8|b>>8)&65535}function Dc(a,b){a^=b;P(this,a);return a&65535}function Ec(a){var b=bc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.l=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.l=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.l=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.m=this.h=c;this.a-=(this.c?6:7)+b}
function Fc(a){var b=bc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.l=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.l=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.m=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function W(a){a&1&&(this.l=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.m=0);this.a-=5}
function Gc(a){var b=bc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=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.h=d>>16|d,this.m=d>>16):(this.g=32768,this.h=d>>15|d,this.m=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.m=0,this.g=32768,this.l=65536,this.a-=7}var Hc=[0,7,7,10,7,11,9,13];function Ic(a){var b=this.a;a=$b(this,a);this.f[7]=a&65535;this.a=b-Hc[this.c]}
var Jc=[0,14,14,17,14,18,16,20];function Kc(a){var b=this.a,c=$b(this,a);a=a>>6&7;Sb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Jc[this.c]}var Lc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Mc=[7,13,13,17,14,18,17,21];function Nc(a){var b=bc(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.m=b>>16,this.h=this.m|b,this.g=0,this.l=-32768>b||32767<b?65536:0);this.a-=23}
function Oc(){this.a-=5}function X(a){a&1&&(this.l=65536);a&2&&(this.g=32768);a&4&&(this.h=0);a&8&&(this.m=32768);this.a-=5}function Pc(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 Qc(a){U(this,a,0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)}function Rc(a){U(this,a,S(this,a),Dc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8)}function Nb(a){Sc[a>>12].call(this,a)}
var Sc=[function(a){Tc[a>>8&15].call(this,a)},function(a){var b=S(this,a),c=this.a;P(this,dc(this,a,b));this.a=c-Lc[(this.I?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=S(this,a);a=bc(this,a);Rb(this,b-a,a,b);this.a-=this.c?4+(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){P(this,S(this,a)&bc(this,a));this.a-=this.c?4+(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a),kc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?
2:0)},function(a){U(this,a,S(this,a),mc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a),ec);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){Uc[a>>8&15].call(this,a)},function(a){Vc[a>>8&15].call(this,a)},function(a){var b=Zb(this,a);P(this,cc(this,a,b,1)<<8);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){var b=Zb(this,a)<<8;a=ac(this,a)<<8;Rb(this,b-a,a,b);this.a-=this.c?4+
(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){P(this,(Zb(this,a)&ac(this,a))<<8);this.a-=this.c?4+(this.J&&6<=this.b?1:0):(this.I?4:3)+(7==this.b?2:0)},function(a){T(this,a,Zb(this,a),lc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){T(this,a,Zb(this,a),nc);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a),Ac);this.a-=this.c?9+(this.J&&6<=this.b?1:0):(this.I?5:3)+(7==this.b?2:0)},Y],Tc=[function(a){Wc[a>>
4&15].call(this,a)},function(a){V(this,a,!0)},function(a){V(this,a,!!(this.h&65535))},function(a){V(this,a,this.h&65535?0:4)},function(a){V(this,a,!this.ya()==!(this.g&32768))},function(a){V(this,a,!this.ya()!=!(this.g&32768))},function(a){V(this,a,!!(this.h&65535)&&!this.ya()==!(this.g&32768))},function(a){V(this,a,(this.h&65535?0:4)||!this.ya()!=!(this.g&32768))},Kc,Kc,function(a){Xc[a>>6&3].call(this,a)},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)},Y,Y],Xc=[function(a){Q(this,dc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,qc);this.a-=this.c?9:3+(7==this.b?2:0)}],Yc=[function(a){U(this,a,0,uc);this.a-=this.c?11:6},function(a){U(this,a,O(this)?1:0,ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,O(this)?1:0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bc(this,
a);Q(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Zc=[function(a){U(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,gc);this.a-=this.c?9:3+(7==this.b?2:0)}],$c=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.Zb(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=Xb(this,a,0);Sb(this,a);P(this,a);this.a-=
11},function(a){var b=Ub(this),c=this.a;Yb(this,a,0,b);P(this,b);this.a=c-Mc[this.c]},function(a){P(this,dc(this,a,this.ya?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Wc=[function(a){ad[a&15].call(this,a)},Y,Y,Y,Ic,Ic,Ic,Ic,function(a){if(a&8)K(this,8);else{var b=Ub(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.j|=1),this.a-=5):K(this,8)},function(a){bd[a&15].call(this,a)},function(a){cd[a&15].call(this,a)},Qc,Qc,
Qc,Qc],ad=[function(){this.C&49152?(this.s|=128,K(this,4)):M(this);this.a-=7},function(){this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Tb(this);this.j|=this.C&16;this.a-=13},function(){K(this,12);this.a-=5},function(){K(this,16);this.a-=25},function(){this.C&49152||(Ob(this),this.u.reset());this.a-=667},function(){Tb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],bd=[Oc,function(){this.l=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.m=0;this.a-=
5},W,W,W,W,W,W,W],cd=[Oc,function(){this.l=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.m=32768;this.a-=5},X,X,X,X,X,X,X],Uc=[Nc,Nc,Gc,Gc,Ec,Ec,Fc,Fc,Rc,Rc,Y,Y,Y,Y,Pc,Pc],Vc=[function(a){V(this,a,!this.ya())},function(a){V(this,a,this.ya())},function(a){V(this,a,!O(this)&&!!(this.h&65535))},function(a){V(this,a,O(this)||(this.h&65535?0:4))},function(a){V(this,a,!(this.g&32768))},function(a){V(this,a,this.g&32768?2:0)},function(a){V(this,
a,!O(this))},function(a){V(this,a,O(this))},function(){K(this,24);this.a-=25},function(){K(this,28);this.a-=5},function(a){dd[a>>6&3].call(this,a)},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)},Y,Y],dd=[function(a){Q(this,cc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,rc);this.a-=this.c?
9:3+(7==this.b?2:0)}],ed=[function(a){T(this,a,0,vc);this.a-=this.c?11:6},function(a){T(this,a,O(this)?1:0,fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,O(this)?1:0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ac(this,a);Q(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],fd=[function(a){T(this,a,0,zc);this.a-=this.c?9+(this.Db&1):3+(7==this.b?2:0)},function(a){T(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jc);this.a-=this.c?9+(this.Db&1):3+(7==this.b?
2:0)},function(a){T(this,a,0,hc);this.a-=this.c?9:3+(7==this.b?2:0)}],gd=[Y,function(a){a=Xb(this,a,65536);Sb(this,a);P(this,a);this.a-=11},function(a){var b=Ub(this),c=this.a;Yb(this,a,65536,b);P(this,b);this.a=c-Mc[this.c]},Y];
function hd(a){v.call(this,"ROM",a,hd);this.b=null;this.m=a.addr;this.c=a.size;this.o=a.writable;this.g=a.alias;this.h=a.file;this.B=ba(this.h);if(this.h){a=this.h;var b=ca(this.B);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,f){id(c,a,b,f)})}}x(hd);hd.prototype.za=function(a,b,c,d){this.u=b;this.a=c;this.L=d;jd(this)};hd.prototype.pa=function(){this.l&&(this.L&&this.L.a(this.id,this.m,this.c,this.l),delete this.l);return!0};
hd.prototype.oa=function(){return!0};
function id(a,b,c,d){if(d)a.P("Unable to load system ROM (error "+d+": "+b+")");else{Fa(a.Eb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),g=e=0;e<f.length;e++)a.b[g++]=f[e]&255,a.b[g++]=f[e]>>8&255;else if(f=l.data)for(a.b=Array(4*f.length),g=e=0;e<f.length;e++)a.b[g++]=f[e]&255,a.b[g++]=f[e]>>8&255,a.b[g++]=f[e]>>16&255,a.b[g++]=f[e]>>24&255;else a.b=l;a.l=l.symbols;if(!a.b.length){q("Empty ROM: "+b);
return}if(1==a.b.length){q(a.b[0]);return}}catch(m){a.P("ROM data error: "+m.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]);jd(a)}}
function jd(a){if(!Ia(a))if(!a.h)D(a);else if(a.b&&a.u){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.i.error=!0;a.P(b)}else{b=a.m;if(Sa(a.u,b,a.c,a.o?1:rb)){var c;for(c=0;c<a.b.length;c++){var d=a.u,e=b+c;d.b[(e&d.u)>>>d.c].gc(e&d.h,a.b[c]&255,e)}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++){for(var f=a,d=b[c],e=f.u,g=f.c,l=[],m=f.m>>>e.c;0<g&&
m<e.b.length;)l.push(e.b[m++]),g-=e.g;e=f.u;f=f.c;g=0;for(d>>>=e.c;0<f&&d<e.b.length;){m=l[g++];if(!m)break;e.b[d++]=m;f-=e.g}}delete a.b}}D(a)}}u(function(){for(var a=C(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new hd(d);B(d,c)}});function kd(a){v.call(this,"RAM",a,kd);this.g=a.addr;this.c=a.size;this.b=!1}x(kd);h=kd.prototype;h.za=function(a,b,c,d){this.u=b;this.a=c;this.L=d;D(this)};h.pa=function(a,b){b||this.reset();return!0};h.oa=function(a){return a?this.save():!0};
h.reset=function(){!this.b&&this.c&&Sa(this.u,this.g,this.c,1)&&(this.b=!0);this.b||q("No RAM allocated")};h.save=function(){return null};h.restore=function(){return!0};u(function(){for(var a=C(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new kd(d);B(d,c)}});function ld(a){v.call(this,"Keyboard",a,ld);D(this)}x(ld);ld.prototype.Z=function(){return!1};ld.prototype.za=function(a,b,c,d){this.B=a;this.a=c;this.L=d;this.Ha=null};
u(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.l=null;this.N=a.tabSize;this.H=a.charBOL;this.m=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.l="";else{var c;a=md;b&&(void 0===c&&(c="Panel"),(c=Ha(c,this.id))&&(b=c.A[b])&&this.Z(null,a,b))}this.o=this.w=null;this.exports={connect:this.Sb,receiveData:this.Jb}}x(Z);var md="buffer";h=Z.prototype;
h.Z=function(a,b,c){var d=this;switch(b){case md:return this.A[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.Jb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Jb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
h.za=function(a,b,c,d){this.B=a;this.u=b;this.a=c;this.L=d;var e=this;this.O=ab(this.a,function(){e.b&128||!e.h.length||(e.J=e.h.shift(),e.b|=128,e.b&64&&G(e.a,40,4,48))});this.I=function(){e.c|=128;return!!(e.c&64)};Ya(b,this,nd);D(this)};
h.Sb=function(){if(!this.o){var a=Cb(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ha(b[0]);if(c!=this.jb)return;b=ha(b[1]);if(this.o=Ga(b)){var d=this.o.exports;if(d){var e=d.connect;e&&e.call(this.o);if(this.w=d.receiveData){this.status(this.Eb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.pa=function(a,b){if(!b)if(this.Sb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
h.oa=function(a){return a?this.save():!0};h.reset=function(){od(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return od(this)};function od(a){a.J=0;a.b=0;a.c=128;a.h=[];return!0}h.Jb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.h.push(a.charCodeAt(b));else this.h=this.h.concat(a);bb(this.a,this.O,50);return!0};h.Ac=function(){return this.b&65535};h.ed=function(a){this.b=this.b&-112|a&111};
h.zc=function(){this.b&=-129;0<this.h.length&&bb(this.a,this.O,50);return this.J};h.dd=function(){};h.Lc=function(){return this.c};h.rd=function(a){128==(this.c&192)&&a&64&&G(this.a,8,4,52,this.I);this.c=this.c&-70|a&69};h.Kc=function(){return 0};
h.qd=function(a){if(a&=255){this.w&&this.w.call(this.o,a);if(this.g)if(13==a)this.m=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.m&&this.m--;else{var b;b=(b=ia[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.N||8,c=a-this.m%a,this.N&&(b=" ".slice(0,c)));this.H&&!this.m&&c&&(b=String.fromCharCode(this.H)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}else if(null!=this.l){if(10==a||1024<=this.l.length)this.U(this.l),
this.l="";10!=a&&(this.l+=String.fromCharCode(a))}this.c&=-129;G(this.a,100,4,52,this.I)}};var pd={},nd=(pd[65392]=[null,null,Z.prototype.Ac,Z.prototype.ed,"RCSR"],pd[65394]=[null,null,Z.prototype.zc,Z.prototype.dd,"RBUF"],pd[65396]=[null,null,Z.prototype.Lc,Z.prototype.rd,"XCSR"],pd[65398]=[null,null,Z.prototype.Kc,Z.prototype.qd,"XBUF"],pd);u(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.i.R=!1;rd(this,b);this.H=Cb(this,"autoPower",a);this.g=0;this.W=a.busWidth||a.buswidth;this.b=sd;this.B=null;this.m=this.N=!1;this.url=Cb(this,"url")||"";(Math.random()+.1).toString(36);this.c=td(this);if(this.a=Ha("CPU",this.id)){this.L=Ha("Debugger",this.id);this.u=new Ma({id:this.Eb+".bus",busWidth:this.W},this.a,this.L);var d,e=y(this.id);if((this.h=Ha("Panel",this.id))&&this.h.Bb)for(b=0;b<e.length;b++)d=e[b],d.P=this.h.P,d.U=this.h.U,d.Bb=
this.h.Bb;this.U("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.U("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.za&&d.za(this,this.u,this.a,this.L);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.o=d:this.b=parseInt(d,10));var f;if(a=Cb(this,"state")||(f=!0,a.state))b=this.I=a,f||(this.m=!0,this.b=sd),this.b&&(this.w=new N(this,
"1.30.1"),ud(this.w)?b=null:delete this.w);!b&&this.b&&(b=vd(this))&&(this.m=!0);if(b){var g=this;p(b,null,!0,function(a,b,c){c?(g.o=null,g.m=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+ha(b):"")+")")):(g.B=b,g.N=!0);D(g)})}else D(this);this.A.power||(this.H=!0);!c&&this.H&&wd(this,this.cb)}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.O=b}function Cb(a,b,c){var d=b.toLowerCase(),d=za[b]||za[d];void 0===d&&a.O&&(d=a.O[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 N(a,"1.30.1","validate");if(ud(c)&&yd(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.P("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=qd.prototype;
h.cb=function(a){void 0===a&&(a=this.b||(this.B?1:sd));if(!this.g){this.g++;var b=!1,c=!1;this.J=!1;var d=this.w||new N(this,"1.30.1");if(-1==a)b=!0;else if(a>sd){if(ud(d,this.B)){this.l=new N(this,"1.30.1","failsafe");ud(this.l)&&(zd(this,d),a=2,Ad(this.l));this.l.set("timestamp",ka());Bd(this.l);var e=this.b&&!this.m;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=yd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ud(d,g):("error"==
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(pa("user",""),this.c=null)):this.U(f+": "+g),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.B;delete this.w}e=y(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=Cd(this,g,d,b,c));b=[d,a,c];-1!=a?wd(this,this.Ob,b):this.Ob(b)}};
function Cd(a,b,c,d,e){if(!b.i.R){b.i.R=!0;if(b.pa){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.pa(f,d)&&f&&(q("Unable to restore state for "+b.type),a.I&&!a.N?(c.clear(),a.b=sd,window&&window.location.reload()):a.J=!0,b.pa(null),e=!1)}if(!d&&b.Rb)for(a=b.Rb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
h.Ob=function(a){var b=a[0],c=0>a[1];a=a[2];this.$=!0;this.i.R=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(Cd(this,this.a,b,c,a),this.a.$a());this.J&&(zd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0};
function zd(a,b){if(la("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.url;d.user=c;d.type="bug";d.data=b;p("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 N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=ka();g.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.oa&&(c&&M(a.a),d=a.a.oa(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.R=!1,!1===d&&(e=null)));for(var l=y(a.id),m=0;m<l.length;m++){var n=l[m];n.i.R&&(n.oa&&(d=n.oa(b,c),"object"===typeof d&&f.set(n.id,
d)),c&&(n.i.R=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Ed(a,a.c,f.toString()),Bd(g)&&Bd(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.i.R=!1,b=a.A.power)&&(b.textContent="Power");a.g=0;return e}h.reset=function(){this.u&&this.u.reset&&this.u.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.u&&c.reset&&c.reset()}};h.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)}};
h.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)}};
h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.A[b]=c,c.onclick=function(){d.g||(d.i.R?Dd(d,!1,!0):wd(d,d.cb))},!0;case "reset":return this.A[b]=c,c.onclick=function(){if(d.i.R&&!d.g)if(d.b&&!d.o){var a=la("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.I?window&&window.location.reload():d.cb(sd)}else d.reset(),d.a&&d.a.$a()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.A[b]=
c,c.onclick=function(){var a=td(d,!0);if(a){var b=!!(d.b&&!d.o||d.I),c=Dd(d,b);b?Ed(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1};
function td(a,b){var c=a.c;c||((c=oa("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.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c}
function Fd(a,b){a.c=null;b=p(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&&(pa("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=p(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.P("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.P(c),pa("user",""),a.c=null)}}
h.Ta=function(a){this.a&&this.a.Ta(a);this.h&&this.h.Ta(a)};u(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],g=A(f),g=new qd(g,d,!0);B(g,f);g.H&&wd(g,g.cb)}});r.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ha("Computer",c.id))&&c.$&&!c.i.R&&c.cb(-1)}});
r.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=Ha("Computer",c.id))&&c.i.R&&Dd(c,!(!c.b||c.o),!0)}});function N(a,b,c){this.id=a.id;this.key=Gd(a,b,c);this.L=a.L;Ad(this,a.qc)}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}
N.prototype={constructor:N,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(na()){var c=JSON.stringify(a[a.id]);pa(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:na()&&(b=oa(a.key))?(a[a.id]=b,a.a=!0):!1}var Hd=0;
function Id(a,b,c,d,e,f){e("Loading "+a+"...");p(a,null,!0,function(g,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),f(l,null)):Jd(l,a,b,c,d,e,f)})}
function Jd(a,b,c,d,e,f,g){function l(a,f){if(f)g(f,null);else{c&&(Fa(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(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Kd(a,f,l):l(a,null):g("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+"...");p(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],n,t=/( [a-z]+=)(['"])(.*?)\2/g;n=t.exec(f);)m=0>m.indexOf(n[1])?m.replace(">",n[0]+">"):m.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);Kd(a,b,c)}})}else c(a,null)}
function Ld(a,b,c,d){function e(a){if(void 0===l){var b=g&&C(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ga(a))}function f(a){e("Error: "+a);m&&(--Hd||wa(!0));m=!1}var g,l,m=!0;Hd++;Ea[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=n:z.appendChild(document.createTextNode(n));t.appendChild(z)}c||
(c="/versions/pdp11/1.30.1/components.xsl");n=function(d,l){l?Id(c,null,null,!1,e,function(d,m){m?(Fa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--Hd||wa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--Hd||wa(!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,n):Jd(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(H){f(H.message)}return m}window.embedPDP11=function(a,b,c,d){wa(!1);return Ld(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})();