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