Merge branch 'master' into gh-pages

This commit is contained in:
Jeff Parsons 2017-03-31 16:58:57 -07:00
commit aa0d48aa40
68 changed files with 2079 additions and 16410 deletions

View file

@ -8,7 +8,7 @@ machines:
type: pdp10
config: /devices/pdp10/machine/ka10/test/debugger/machine.xml
debugger: true
commands: a 30724 /apps/pdp10/diags/klad/dakaa/DAKAA.MAC
commands: a 30724 /apps/pdp10/diags/ka10/dakaa/DAKAA.MAC
---
A few weeks ago, I finished my first cut of the *core* PDP-10 instructions in PDPjs. Most of my remaining work
@ -49,9 +49,9 @@ Any machine that includes the PDPjs Debugger (like the machine below) now includ
{% include machine.html id="testka10" %}
The above machine uses the Debugger's assemble ('a') command to assemble DEC's "DAKAA" diagnostic
[KA10 Basic Instruction Diagnostic](/apps/pdp10/diags/klad/dakaa/) and load the resulting code at address 30724:
[KA10 Basic Instruction Diagnostic](/apps/pdp10/diags/ka10/dakaa/) and load the resulting code at address 30724:
a 30724 /apps/pdp10/diags/klad/dakaa/DAKAA.MAC
a 30724 /apps/pdp10/diags/ka10/dakaa/DAKAA.MAC
The Debugger invokes the MACRO-10 mini-assembler whenever the target address is followed by an argument ending with ".MAC".
@ -206,8 +206,8 @@ now, since I'm holding off on all floating-point support for as long as possible
Much more work is needed to make the MACRO-10 "Mini-Assembler" a general-purpose assembler, but it's already proved itself
useful in assembling the following tests:
- [KA10 Basic Instruction Diagnostic #1](/apps/pdp10/diags/klad/dakaa/)
- [KA10 Basic Instruction Diagnostic #4](/apps/pdp10/diags/klad/dakad/)
- [KA10 Basic Instruction Diagnostic #1](/apps/pdp10/diags/ka10/dakaa/)
- [KA10 Basic Instruction Diagnostic #4](/apps/pdp10/diags/ka10/dakad/)
- [Assorted MACRO-10 Mini-Assembler Tests](/apps/pdp10/tests/macro10/)
However, there's "*assembling*" and then there's "*assembling correctly*". One early problem I had to immediately

View file

@ -8,19 +8,19 @@ machines:
type: pdp10
config: /devices/pdp10/machine/ka10/test/debugger/machine.xml
debugger: true
commands: a 30724 /apps/pdp10/diags/klad/dakaa/DAKAA.MAC
commands: a 30724 /apps/pdp10/diags/ka10/dakaa/DAKAA.MAC
---
Now that the PDPjs MACRO-10 Mini-Assembler is [limping along](/blog/2017/03/21/), it's time to start assembling some
of DEC's PDP-10 "Basic Instruction" diagnostics and loading them into a test machine. The first diagnostic I tried was
[KA10 Basic Instruction Diagnostic #1 (MAINDEC-10-DAKAA)](/apps/pdp10/diags/klad/dakaa/), which has been loaded into
[KA10 Basic Instruction Diagnostic #1 (MAINDEC-10-DAKAA)](/apps/pdp10/diags/ka10/dakaa/), which has been loaded into
the machine below.
{% include machine.html id="testka10" %}
Here were the results of my first run attempt:
>> a 30724 /apps/pdp10/diags/klad/dakaa/DAKAA.MAC
>> a 30724 /apps/pdp10/diags/ka10/dakaa/DAKAA.MAC
starting PCjs MACRO-10 Mini-Assembler...
loading DAKAA.MAC
CPU will not be auto-started (click Run to start)
@ -54,13 +54,13 @@ Here were the results of my first run attempt:
035057: 000000 000000 UUO 0,0 ;history=1
Happily, this was a good outcome, because 035057 is the end of the test. If you look at the diagnostic's
[listing file](/apps/pdp10/diags/klad/dakaa/DAKAA.LST.txt), this is what you would normally see at address 035057:
[listing file](/apps/pdp10/diags/ka10/dakaa/DAKAA.LST.txt), this is what you would normally see at address 035057:
035057 254 00 0 00 030057 ENDXX: JRST BEGEND ;LOOP PROGRAM
I had similar success with [Diagnostic #2 (MAINDEC-10-DAKAB)](/apps/pdp10/diags/klad/dakab/).
I had similar success with [Diagnostic #2 (MAINDEC-10-DAKAB)](/apps/pdp10/diags/ka10/dakab/).
Problems started to crop up in [Diagnostic #3 (MAINDEC-10-DAKAC)](/apps/pdp10/diags/klad/dakac/):
Problems started to crop up in [Diagnostic #3 (MAINDEC-10-DAKAC)](/apps/pdp10/diags/ka10/dakac/):
CAME [0,-1] ;PASS TEST IF C(AC)=0,,-1
@ -68,9 +68,9 @@ Based on the comment, it's clear what they really meant was either "[0,,-1]" or
desired result, which means that even when the assembler parses an mnemonic-less instruction like "0,-1", it must still truncate
the second (address) operand. Once I generated the appropriate value (000000,777777), the test passed.
And I had several failures running [Diagnostic #4 (MAINDEC-10-DAKAD)](/apps/pdp10/diags/klad/dakad/):
And I had several failures running [Diagnostic #4 (MAINDEC-10-DAKAD)](/apps/pdp10/diags/ka10/dakad/):
>> a 30724 /apps/pdp10/diags/klad/dakad/DAKAD.MAC
>> a 30724 /apps/pdp10/diags/ka10/dakad/DAKAD.MAC
starting PCjs MACRO-10 Mini-Assembler...
loading DAKAD.MAC
1986 words loaded at 030724-034625

View file

@ -9,4 +9,4 @@ DEC PDP-10 Diagnostics
PCjs has archived the following PDP-10 diagnostics:
- [KLAD Diagnostics](klad/)
- [KA10 Diagnostics](ka10/)

View file

@ -1,14 +1,61 @@
---
layout: page
title: PDP-10 KLAD Diagnostics
permalink: /apps/pdp10/diags/klad/
title: PDP-10 KA10 Diagnostics
permalink: /apps/pdp10/diags/ka10/
---
PDP-10 KLAD Diagnostics
PDP-10 KA10 Diagnostics
-----------------------
PCjs has archived selected files from
[PDP-10 KLAD Diagnostics Sources](http://pdp-10.trailing-edge.com/klad_sources/index.html), including:
PCjs has archived selected KA10 diagnostic source files from the
[PDP-10 KLAD Diagnostics Sources](http://pdp-10.trailing-edge.com/klad_sources/index.html) and turned them into
stand-alone PDP-10 diagnostics, using the new PCjs [MACRO-10 Mini-Assembler](/modules/pdp10/lib/macro10.js).
A complete list of supported diagnostics is provided [below](#list-of-ka10-diagnostics).
I've also experimented with assembling these diagnostics from the original (unmodified) source files. For example,
you can go to the [DAKAK Diagnostic](dakak/) page and try the following command:
a 'dakakt.mac;../param.klm;../fixed.klm;dakakm.mac;../uuoerr.klm;../stor.klm'
and while the MACRO-10 assembly process works:
loading dakakt.mac
loading param.klm
loading fixed.klm
loading dakakm.mac
loading uuoerr.klm
loading stor.klm
6301 words loaded at 000137-044630, start address 030000
00=000000000000 01=000000000000 02=000000000000 03=000000000000
04=000000000000 05=000000000000 06=000000000000 07=000000000000
10=000000000000 11=000000000000 12=000000000000 13=000000000000
14=000000000000 15=000000000000 16=000000000000 17=000000000000
PC=030000 RA=00000000 EA=000000 PS=000000 OV=0 C0=0 C1=0 ND=0 PD=0
030000: 254020 027776 JRST @27776
there are additional modules that must be loaded into the machine as well, which are not yet supported. So it's best
to assemble the modified files that I've placed inside each diagnostic's folder. For the [DAKAK Diagnostic](dakak/),
that's **DAKAK.MAC**:
>> a dakak.mac
loading dakak.mac
5849 words loaded at 000137-044133, start address 030621
00=000000000000 01=000000000000 02=000000000000 03=000000000000
04=000000000000 05=000000000000 06=000000000000 07=000000000000
10=000000000000 11=000000000000 12=000000000000 13=000000000000
14=000000000000 15=000000000000 16=000000000000 17=000000000000
PC=030621 RA=00000000 EA=000000 PS=000000 OV=0 C0=0 C1=0 ND=0 PD=0
030621: 254000 030622 JRST 30622
If the machine is able to run to the end of the diagnostic (which can be located by looking at the diagnostic's original
MACRO-10 listing file) without stopping on an UUO opcode, then you can assume it passed.
List of KA10 Diagnostics
------------------------
The following list of KA10 Diagnostics is not comprehensive. It's simply a list of thosr diagnostics we have archived and
tested with PDPjs so far.
- [KA10 Basic Instruction Diagnostic #1 (MAINDEC-10-DAKAA)](dakaa/)
- TEST OF JUMP, JUMPA AND SKIPX INSTRUCTIONS

View file

@ -0,0 +1,171 @@
SUBTTL *SPCCPU* SPECIAL BASIC CPU PROCESSOR CONTROL, 26-FEB-76
;NEW DEFINITIONS USED BY THE KL10 SUBROUTINE PACKAGE
AC0= 0
DIAGNOS=30000 ;PDP-10 DIAGNOSTIC START ADDRESS
DDT= 10000 ;PDP-10 DDT START ADDRESS
DIAMON= 20000 ;PDP-10 DIAMON LOADER START ADDRESS
DONG11= 1B22 ;11 DOORBELL (FROM THE 10)
;DTE20 DEVICE CODES
DTE== 200 ;DTE0
DTE0== 204
DTE1== 204
DTE2== 210
DTE3== 214
;KL10 EPT COMMUNICATION AREA
$STD= 440 ;PDP-10 DIAGNOSTIC START ADDRESS
$DDT= 441 ;PDP-10 DDT START ADDRESS
$STL= 442 ;PDP-10 LOADER START ADDRESS
$STM= 443 ;PDP-10 MONITOR START ADDRESS
$DTFLG= 444 ;DTE20 OPERATION COMPLETE FLAG
$DTCLK= 445 ;DTE20 CLOCK INTERRUPT FLAG
$DTCI= 446 ;DTE20 CLOCK INTERRUPT INSTRUCTION
$DTT11= 447 ;DTE20 10 TO 11 ARGUMENT
$DTF11= 450 ;DTE20 11 TO 10 ARGUMENT
$DTCMD= 451 ;DTE20 TO 11 COMMAND WORD
$DTSEQ= 452 ;DTE20 OPERATION SEQUENCE NUMBER
$DTOPR= 453 ;DTE20 OPERATIONAL DTE #
$DTCHR= 454 ;DTE20 LAST TYPED CHARACTER
$DTMTD= 455 ;DTE20 MONITOR TTY OUTPUT COMPLETE FLAG
$DTMTI= 456 ;DTE20 MONITOR TTY INPUT FLAG
$DTSWR= 457 ;DTE20 CONSOLE SWITCH REGISTER
;SPECIAL "FIXED" REASSIGNMENTS
$$LOC=. ;SAVE CURRENT LOCATION
LOC 30000
$$BEGIN:JRST $$START ;SETUP SPECIAL START
JRST $$START ;"DIAMON" CHAIN START ADDRESS
LOC 440
$STD: JRST BEGIN ;SETUP FOR "STD"
LOC 443
$STM: JRST $SPEC ;SIMPLE RUN CONTROL
LOC 30057
$BEGEND:JRST $SPBEND ;SETUP SPECIAL "BEGEND"
;SPECIAL MUUO, TRAP & PAGE FAIL SETUP
LOC 420
$$420: HALT . ;KI10 PAGE FAIL
$$421: JFCL ;OVERFLOW
$$422: HALT . ;PUSHDOWN OVERFLOW
$$423: HALT . ;TRAP 3
$$424: 0 ;MMUO
$$425: 0 ;MMUO PC
$$426: 0 ;KI10-PAGE FAIL, KL10-PROCESS CONTEXT
$$427: HALT .
$$430: 427 ;MMUO NEW PC'S
$$431: 427
$$432: 427
$$433: 427
$$434: 427
$$435: 427
$$436: 427
$$437: 427
LOC 500
$$500: 0 ;KL10 PAGE FAIL WORD
$$501: 0 ;KL10 PAGE FAIL PC
$$502: 503 ;KL10 PAGE FAIL NEW PC
$$503: HALT .
LOC $$LOC ;RESET CURRENT LOCATION
;SPECIAL STARTUP SEQUENCE
$$START:SETZM USER
JSP 0,.+1 ;IN USER MODE ?
TLNE 0,USERF
SETOM USER ;YES, SET CONTROL WORD
SKIPN MONFLG ;SPECIAL USER MODE ?
SETZM USER ;YES, RUN AS EXEC
SKIPE USER
JRST START ;USER MODE, DON'T NEED CPU TYPE
$STKIL: SKIPN MONTEN ;LOADED BY "DIAMON" ?
SETOM ITRCNT ;NO, RUN FOREVER
SETZM KLTYP
SETZM KLFLG ;ASSUME KI10
MOVE 1,[1,,1]
BLT 1,1 ;HOPE THIS WORKS
CAMN 1,[1,,1] ;IF AC NE 1,,1 AFTER BLT, KL10
JRST START ;KI10, NO ADDITIONAL SETUP
$STKL: CONO APR,10040 ;SET BBD NOT BIT
CONI APR,0
CONO APR,20040 ;CLEAR BBD NOT BIT
TRNN 0,40 ;IF SET, KL10
AOS KLTYP ;IF NOT, BBD
SETZM $DTFLG
SETZM $DTCLK
MOVE $DTOPR ;GET DTE #
ORM $$DTE0 ;INSERT IN DTE I/O INSTS
ORM $$DTE1
ORM $$DTE2
ORM $$DTE3
SETOM KLFLG ;SET KL10 CONTROL FLAG
JRST START
$SPEC: MOVE [JRST STARTA] ;SIMPLE RUN CONTROL
MOVEM $SPB1
JRST START
;SPECIAL "BEGEND" ROUTINE
$SPBEND:AOS PASCNT ;INCREMENT PASS COUNT
SOS ITRCNT ;DECREMENT ITERATION COUNT
$SPB1: SKIPN USER
JRST $SPBEX ;EXEC MODE
$SPBUS: SKIPE ITRCNT ;USER MODE, COMPLETED ?
JRST STARTA ;NO, KEEP RUNNING
SKIPN MONTEN ;DONE, LOADED BY "DIAMON" ?
EXIT ;NO, RETURN TO MONITOR
JRST @RETURN ;YES, RETURN TO "DIAMON"
$SPBEX: SKIPE KLFLG
JRST $SPBKL ;KL10 & EXEC
DATAO PI,ITRCNT ;KI10 & EXEC, DISPLAY ITER COUNT
SKIPE ITRCNT
JRST STARTA ;NOT COMPLETED YET
JRST @RETURN ;DONE
$SPBKL: SKIPN ITRCNT
JRST $SPKLD ;KL10, EXEC & COMPLETED
SKIPGE MONCTL
JRST STARTA ;"DIAMON" CONTROL
MOVEI 0,404 ;NOTIFY PDP-11 OF END OF PASS
MOVEM 0,$DTCMD
SETZM $DTFLG
SKIPN KLTYP
$$DTE0: CONO DTE,DONG11
SKIPE KLTYP
$$DTE1: CONO DTE,10000
SKIPN $DTFLG ;WAIT TILL 11 RESPONDS
JRST .-1
JRST STARTA ;KEEP RUNNING
;SPECIAL KL10 COMPLETED ROUTINE
$SPKLD: SKIPE MONTEN
JRST @RETURN ;LOADED BY "DIAMON"
MOVEI 0,403 ;NOTIFY PDP-11 OF COMPLETION
MOVEM 0,$DTCMD
SETZM $DTFLG
SKIPN KLTYP
$$DTE2: CONO DTE,DONG11
SKIPE KLTYP
$$DTE3: CONO DTE,10000
SKIPN $DTFLG ;SHOULD NEVER HAPPEN
JRST .-1 ;11 NEVER RETURNS ON END OF PROGRAM
HALT BEGIN ;IF IT DOES, HALT.

View file

@ -0,0 +1,21 @@
SUBTTL *STOR* RESERVED STORAGE, JULY 19,1977
;PROGRAM LITERALS
XLIST
IFNDEF $LPAPER,<LIST>
LIT
LIST
ENDSLD: 0
IFDEF DEBUG,<
PATCH: BLOCK DEBUG ;PATCHING AREA
>
;PROGRAM VARIABLES
VAR
IFDEF PGMEND,<
END: 0
END BEGIN >

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #1
permalink: /apps/pdp10/diags/klad/dakaa/
permalink: /apps/pdp10/diags/ka10/dakaa/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,17 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #1* (MAINDEC-10-DAKAA) test code h
[DAKAAM.MAC](DAKAAM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakaam.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
This diagnostic "IS THE FIRST IN A SERIES OF PDP-10 KA10 PROCESSOR DIAGNOSTICS. IT IS THE MOST BASIC OF THE PROCESSOR DIAGNOSTICS.
THIS DIAGNOSTIC ASSUMES THE HALT INSTRUCTION AND THE COMPUTER CONSOLE TO BE OPERATIVE. IT MAKES NO FURTHER ASSUMPTIONS EXCEPT
THAT IT IS LOADED INTO MEMORY CORRECTLY."
Resources for this test include:
- [Instructions](#dakaatxt)
- [History](#dakaahst)
- [Source Code](#dakaamac)
- [MACRO-10 Listing](DAKAA.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakaa/DAKAA.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakaa/DAKAA.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #2
permalink: /apps/pdp10/diags/klad/dakab/
permalink: /apps/pdp10/diags/ka10/dakab/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #2* (MAINDEC-10-DAKAB) test code h
[DAKABM.MAC](DAKABM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakabm.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic tests "MOVE, COMPARE, TEST, HALF WORD AND BOOLE. IT ALSO TESTS THE ADDERS USING ADD AND COMPARE INSTRUCTIONS."
Resources for this diagnostic include:
- [Instructions](#dakabtxt)
- [History](#dakabhst)
- [Source Code](#dakabmac)
- [MACRO-10 Listing](DAKAB.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakab/DAKAB.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakab/DAKAB.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #3
permalink: /apps/pdp10/diags/klad/dakac/
permalink: /apps/pdp10/diags/ka10/dakac/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #3* (MAINDEC-10-DAKAC) test code h
[DAKACM.MAC](DAKACM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakacm.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic tests "LOGICAL TEST, HALF WORD INSTRUCTIONS AND THE ADDER."
Resources for this diagnostic include:
- [Instructions](#dakactxt)
- [History](#dakachst)
- [Source Code](#dakacmac)
- [MACRO-10 Listing](DAKAC.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakac/DAKAC.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakac/DAKAC.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #4
permalink: /apps/pdp10/diags/klad/dakad/
permalink: /apps/pdp10/diags/ka10/dakad/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #4* (MAINDEC-10-DAKAD) test code h
[DAKADM.MAC](DAKADM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakadm.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS REGISTER ADDRESSING, JFCL, AR FLAGS, AOS, SOS, JRST, AOBJX, JSP, XCT, INDIRECT AND INDEXED ADDRESSING."
Resources for this diagnostic include:
- [Instructions](#dakadtxt)
- [History](#dakadhst)
- [Source Code](#dakadmac)
- [MACRO-10 Listing](DAKAD.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakad/DAKAD.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakad/DAKAD.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #5
permalink: /apps/pdp10/diags/klad/dakae/
permalink: /apps/pdp10/diags/ka10/dakae/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #5* (MAINDEC-10-DAKAE) test code h
[DAKAEM.MAC](DAKAEM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakaem.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS THE FWT, ADD/SUB, PC CHANGE AND COMPARE INSTRUCTIONS."
Resources for this diagnostic include:
- [Instructions](#dakaetxt)
- [History](#dakaehst)
- [Source Code](#dakaemac)
- [MACRO-10 Listing](DAKAE.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakae/DAKAE.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakae/DAKAE.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #6
permalink: /apps/pdp10/diags/klad/dakaf/
permalink: /apps/pdp10/diags/ka10/dakaf/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #6* (MAINDEC-10-DAKAF) test code h
[DAKAFM.MAC](DAKAFM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakafm.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS THE BOOLE, HWT AND TEST INSTRUCTIONS."
Resources for this diagnostic include:
- [Instructions](#dakaftxt)
- [History](#dakafhst)
- [Source Code](#dakafmac)
- [MACRO-10 Listing](DAKAF.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakaf/DAKAF.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakaf/DAKAF.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #7
permalink: /apps/pdp10/diags/klad/dakag/
permalink: /apps/pdp10/diags/ka10/dakag/
machines:
- id: testka10
type: pdp10
@ -17,13 +17,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #7* (MAINDEC-10-DAKAG) test code h
[DAKAGM.MAC](DAKAGM.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakagm.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS THE PUSH, POP, XCT AND BASIC SHIFT ROTATE INSTRUCTIONS."
Resources for this diagnostic include:
- [Instructions](#dakagtxt)
- [History](#dakaghst)
- [Source Code](#dakagmac)
- [MACRO-10 Listing](DAKAG.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakag/DAKAG.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakag/DAKAG.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #8
permalink: /apps/pdp10/diags/klad/dakah/
permalink: /apps/pdp10/diags/ka10/dakah/
machines:
- id: testka10
type: pdp10
@ -18,13 +18,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #8* (MAINDEC-10-DAKAH) test code h
[DAKAHT.MAC](DAKAHT.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakaht.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS THE PI SYSTEM, INTERRUPTS, LUUO'S AND INPUT/OUTPUT."
Resources for this diagnostic include:
- [Instructions](#dakahtxt)
- [History](#dakahhst)
- [Source Code](#dakahmac)
- [MACRO-10 Listing](DAKAH.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakah/DAKAH.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakah/DAKAH.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #9
permalink: /apps/pdp10/diags/klad/dakai/
permalink: /apps/pdp10/diags/ka10/dakai/
machines:
- id: testka10
type: pdp10
@ -18,13 +18,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #9* (MAINDEC-10-DAKAI) test code h
[DAKAIT.MAC](DAKAIT.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakait.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS THE SHIFTING AND ROTATING INSTRUCTIONS."
Resources for this diagnostic include:
- [Instructions](#dakaitxt)
- [History](#dakaihst)
- [Source Code](#dakaimac)
- [MACRO-10 Listing](DAKAI.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakai/DAKAI.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakai/DAKAI.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,7 +1,7 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #10
permalink: /apps/pdp10/diags/klad/dakaj/
permalink: /apps/pdp10/diags/ka10/dakaj/
machines:
- id: testka10
type: pdp10
@ -18,13 +18,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #10* (MAINDEC-10-DAKAJ) test code
[DAKAJT.MAC](DAKAJT.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakajt.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "CONTINUES TESTING THE SHIFT AND ROTATE INSTRUCTIONS."
Resources for this diagnostic include:
- [Instructions](#dakajtxt)
- [History](#dakajhst)
- [Source Code](#dakajmac)
- [MACRO-10 Listing](DAKAJ.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakaj/DAKAJ.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakaj/DAKAJ.SEQ.txt)
{% include machine.html id="testka10" %}

View file

@ -1,13 +1,13 @@
---
layout: page
title: PDP-10 KA10 Basic Instruction Diagnostic #11
permalink: /apps/pdp10/diags/klad/dakak/
permalink: /apps/pdp10/diags/ka10/dakak/
machines:
- id: testka10
type: pdp10
config: /devices/pdp10/machine/ka10/test/debugger/machine.xml
debugger: true
commands: a &apos;dakakt.mac;../param.klm;../fixed.klm;dakakm.mac;../uuoerr.klm&apos;
commands: a dakak.mac
---
PDP-10 KA10 Basic Instruction Diagnostic #11
@ -18,13 +18,15 @@ The *PDP-10 KA10 Basic Instruction Diagnostic #11* (MAINDEC-10-DAKAK) test code
[DAKAKT.MAC](DAKAKT.MAC.txt) [[original](http://pdp-10.trailing-edge.com/klad_sources/01/klad.sources/dakakt.mac.html)]
for use with the [PDP-10 Test Machine with Debugger](/devices/pdp10/machine/ka10/test/debugger/) below.
Resources for this test include:
This diagnostic "TESTS THE MULTIPLY INSTRUCTION AND THE MULTIPLY ALGORITHM."
Resources for this diagnostic include:
- [Instructions](#dakaktxt)
- [History](#dakakhst)
- [Source Code](#dakakmac)
- [MACRO-10 Listing](DAKAK.LST.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/klad/dakak/DAKAK.SEQ.txt)
- [Additional Information](http://archive.pcjs.org/apps/pdp10/diags/ka10/dakak/DAKAK.SEQ.txt)
{% include machine.html id="testka10" %}
@ -38,6 +40,23 @@ This command:
will automatically read the [DAKAK.MAC](DAKAK.MAC.txt) source file (a slightly modified copy of [DAKAKM.MAC](DAKAKM.MAC.txt)),
assemble it, and then load the binary image at the location specified in the file.
To assemble the diagnostic using the original DEC source files:
a 'dakakt.mac;../param.klm;../fixed.klm;dakakm.mac;../uuoerr.klm;../stor.klm'
The quotes (either single or double) are required to prevent the PDPjs Debugger from interpreting the filenames as
separate commands, because a semicolon is the Debugger's normal command separator.
If you want a machine to automatically assemble and load those files on startup, you can add the following machine configuration
setting in the page's Front Matter:
commands: a &apos;dakakt.mac;../param.klm;../fixed.klm;dakakm.mac;../uuoerr.klm;../stor.klm&apos;
However, in this case, you *must* use `&apos;` as the quoting sequence, because of the way these settings are encoded into
JavaScript parameters; e.g.:
embedPDP10(...,'{commands:"a &apos;dakakt.mac;../param.klm;../fixed.klm;dakakm.mac;../uuoerr.klm;../stor.klm&apos;"}');
---
DAKAK.TXT

View file

@ -1,572 +0,0 @@
;MAINDEC-10-DFKCA
DECVER=002
MCNVER=000
XLIST
DEFINE NAME (MCNVER,DECVER),<
TITLE DFKCA KL10 ADVANCED INSTRUCTION DIAGNOSTIC #1, VERSION MCNVER,DECVER >
LIST
LALL
NAME \MCNVER,\DECVER
XALL
;COPYRIGHT 1975
;DIGITAL EQUIPMENT CORPORATION
;MARLBORO, MASS. 01752
;JOHN R. KIRCHOFF
LOC 137
MCNVER,,DECVER
NOSYM
SUBTTL DIAGNOSTIC PARAMETERS
;OPERATOR DEFINITIONS
OPDEF ER1 [1B8]
OPDEF ER2 [2B8]
OPDEF ER3 [3B8]
OPDEF ER4 [4B8]
OPDEF ER5 [5B8]
OPDEF ER6 [6B8]
OPDEF ER7 [7B8]
OPDEF ER10 [10B8]
OPDEF ER11 [11B8]
OPDEF ER12 [12B8]
OPDEF ER13 [13B8]
LUUO1==ERRMES
LUUO2==ERRMES
LUUO3==ERRMES
LUUO4==ERRMES
LUUO5==ERRMES
LUUO6==ERRMES
LUUO7==ERRMES
LUUO10==ERRMES
LUUO11==ERRMES
LUUO12==ERRMES
LUUO13==ERRMES
;SUBROUTINE ASSEMBLY DEFINITIONS
DEBUG=100
EXCASB=1
USRASB=1
KI10=1
KL10=1
KL10P0=1
PGMEND=1
ERDIAG=1
KLOLD=1
MODDVU=BEGIN
MODDVL=BEGIN
;MACROS
DEFINE SAVEAC (A,B)<
MOVEI AC+2,.
MOVEM AC+2,TESTPC ;SETUP SUBTEST PC
MOVEI AC+2,<AC+2>&17 ;INFORM ERROR ROUTINE WHICH
MOVEM AC+2,ERRLOP# ;AC IS USED FOR ITERATION>
;BEGIN ASSEMBLY PARAMETERS
SADR1=BEGIN
SADR2=RESRT1
SADR3=RENTR1
SADR4=BEGIN
SADR5=BEGIN
SADR6=BEGIN
SADR7=HALT BEGIN
SADR8=HALT BEGIN
SADR9=HALT BEGIN
SADR10=HALT BEGIN
SADR11=HALT BEGIN
PAREA1=0
PAREA2=0
PAREA3=SIXBIT/DFKCA/
PAREA4=SIXBIT/LPT/
PAREA5=0
PAREA6=0
ITERAT=1000
DEFINE DMVE (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVE INSTRUCTION
;FIRST, AC, AC+1 ARE PRELOADED WITH DATA OTHER THAN THE TEST WORDS.
;THEN, THE DATA SPECIFIED BY [XWD A,B] AND [XWD C,D] IS MOVED
;FROM MEMORY TO AC, AC+1 VIA THE DMOVE INSTRUCTION.
;C(AC) AND C(AC+1) ARE THEN COMPARED WITH THE TEST WORDS
;[XWD A,B] AND [XWD C,D], RESPECTIVELY. THE TEST PASSES IF THESE
;COMPARISONS AGREE.
Q'L'0: MOVE AC+5,[XWD A,B] ;INITIALIZE TEST WORDS
MOVE AC+6,[XWD C,D] ;FOR COMPARISON
MOVE AC,[XWD 707070,707070]
MOVE AC+1,[XWD 070707,070707] ;INITIALIZE AC,AC+1
DMOVE AC,[XWD A,B ;*MOVE DOUBLE WORD A,B ; C,D
XWD C,D] ;FROM MEMORY TO AC, AC+1
CAME AC,<AC+5>&17 ;WAS AC LOADED CORRECTLY?
ER3 AC,L'1 ;FAIL IF CONTENTS(AC) NOT = A,B
CAME AC+1,<AC+6>&17 ;WAS AC+1 LOADED CORRECTLY?
ER4 AC+1,L'2 ;FAIL IF CONTENTS(AC+1) NOT = C,D
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVE17 (L,T,A,B,C,D) <
;THIS MACRO TESTS THE DMOVE INSTRUCTION
;FIRST, AC, AC+1 ARE PRELOADED WITH DATA OTHER THAN THE TEST WORDS.
;THEN, THE DATA SPECIFIED BY [XWD A,B] AND [XWD C,D] IS MOVED
;FROM MEMORY TO AC, AC+1 VIA THE DMOVE INSTRUCTION.
;C(AC) AND C(AC+1) ARE THEN COMPARED WITH THE TEST
;WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'T'0: MOVEM AC,%SV17# ;SAVE AC17
Q'L'0: MOVE AC+5,[XWD A,B] ;INITIALIZE TEST WORDS
MOVE AC+6,[XWD C,D] ;FOR COMPARISON
MOVE AC,[XWD 707070,707070]
MOVE AC+1,[XWD 070707,070707] ;INITIALIZE AC,AC+1
DMOVE AC,[XWD A,B ;*MOVE DOUBLE WORD A,B ; C,D
XWD C,D] ;FROM MEMORY TO AC, AC+1
Q'T'3: CAMN AC,<AC+5>&17 ;WAS AC LOADED CORRECTLY?
JRST .+4 ;HERE IF NO ERROR
MOVEM AC,AC-1 ;STORE INCORRECT RESLUTS
MOVE AC,%SV17 ;RESTORE P
ER3 AC-1,L'1 ;FAIL IF CONTENTS(AC) NOT = A,B
CAMN AC+1,<AC+6>&17 ;WAS AC+1 LOADED CORRECTLY?
JRST .+4 ;HERE IF NO ERROR
MOVEM AC+1,AC-1 ;STORE INCORRECT WORD
MOVE AC,%SV17 ;RESTORE P
ER4 AC-1,L'2
MOVE AC,%SV17 ;RESTORE AC UNCONDITIONALLY
JUMPL SAC,Q'T'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVN (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVN INSTRUCTION
;FIRST, AC, AC+1 ARE PRELOADED WITH DATA OTHER THAN THE TEST WORDS.
;THEN, THE NEGATIVE (TWOS COMPLEMENT) OF THE DATA SPECIFIED BY
;[XWD A,B] AND [XWD C,D] IS MOVED FROM MEMORY TO AC, AC+1 VIA
;THE DMOVN INSTRUCTION. C(AC) AND C(AC+1) ARE THEN COMPARED
;WITH THE NEGATIVE (TWOS COMPLEMENT) OF THE TEST
;WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'L'0: DMOVE AC,[XWD 707070,707070
XWD 070707,070707] ;INITIALIZE AC,AC+1
SETCM AC+5,[XWD A,B] ;INITIALIZE TEST WORDS FOR COMPARISON
IFIDN <C,D><0,0>,<
SETZ AC+6,
ADDI AC+5,1 >
IFIDN <C,D><400000,0>,<
SETZ AC+6,
ADDI AC+5,1 >
IFDIF <C,D><0,0>,<
IFDIF <C,D><400000,0>,<
MOVN AC+6,[XWD C,D]
TLZ AC+6,1B18 ;CLEAR SIGN BIT OF LOW ORDER WORD >>
DMOVN AC,[XWD A,B ;*MOVE NEGATIVE OF DOUBLE WORD A,B ;
XWD C,D] ;C,D FROM MEMORY TO AC, AC+1
CAME AC,<AC+5>&17 ;WAS AC LOADED CORRECTLY?
ER3 AC,L'1 ;FAIL IF CONTENTS(AC) NOT = COMPLEMENT OF A,B
CAME AC+1,<AC+6>&17 ;WAS AC+1 LOADED CORRECTLY?
ER4 AC+1,L'2 ;FAIL IF CONTENTS(AC+1) NOT = MINUS C,D
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVN17 (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVN INSTRUCTION
;FIRST, AC, AC+1 ARE PRELOADED WITH DATA OTHER THAN THE TEST WORDS.
;THEN, THE NEGATIVE (TWOS COMPLEMENT) OF THE DATA SPECIFIED BY
;[XWD A,B] AND [XWD C,D] IS MOVED FROM MEMORY TO AC, AC+1 VIA
;THE DMOVN INSTRUCTION. C(AC) AND C(AC+1) ARE THEN COMPARED
;WITH THE NEGATIVE (TWOS COMPLEMENT) OF THE TEST
;WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'L'0: MOVEM AC,%SV17 ;SAVE P
DMOVE AC,[XWD 707070,707070
XWD 070707,070707] ;INITIALIZE AC,AC+1
SETCM AC+5,[XWD A,B] ;INITIALIZE TEST WORDS FOR COMPARISON
IFIDN <C,D><0,0>,<
SETZ AC+6,
ADDI AC+5,1 >
IFIDN <C,D><400000,0>,<
SETZ AC+6,
ADDI AC+5,1 >
IFDIF <C,D><0,0>,<
IFDIF <C,D><400000,0>,<
MOVN AC+6,[XWD C,D]
TLZ AC+6,1B18 ;CLEAR SIGN BIT OF LOW ORDER WORD >>
DMOVN AC,[XWD A,B ;*MOVE NEGATIVE OF DOUBLE WORD A,B ;
XWD C,D] ;C,D FROM MEMORY TO AC, AC+1
CAMN AC,<AC+5>&17 ;WAS AC LOADED CORRECTLY?
JRST .+4 ;HERE IF TESTS OK
MOVEM AC,AC-1 ;SAVE BAD WORD
MOVE AC,%SV17 ;RESTORE P
ER3 AC-1,L'1 ;FAIL IF CONTENTS(AC) NOT = COMPLEMENT OF A,B
CAMN AC+1,<AC+6>&17 ;WAS AC+1 LOADED CORRECTLY?
JRST .+4 ;HERE IF TESTS OK
MOVEM AC,AC-1
MOVE AC,%SV17 ;RESTORE P
ER4 AC+1,L'2 ;FAIL IF CONTENTS(AC+1) NOT = MINUS C,D
MOVE AC,%SV17 ;RESTORE P UNCODITIONALLY
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVNF (L,A,B,C,D,KIEF,KIUF,KLEF,KLUF) <
;**KI10**
;THIS MACRO VERIFIES THAT THE DMOVN INSTRUCTION DOES NOT SET OVERFLOW
;OR CARRY FLAGS ON THE KI10. FIRST, OVFL AND CRY0,1 FLAGS ARE CLEARED;
;THEN,DMOVN IS EXECUTED. NEXT, OVFL AND CRY0,1 FLAGS ARE EXAMINED.
;IF ANY OF THESE FLAGS ARE SET, THE TEST FAILS.
;**KL10**
;THIS MACRO VERIFIES THAT THE DMOVN INSTRUCTION DOES SET OVERFLOW
;OR CARRY FLAGS ON THE KL10. FIRST, OVFL AND CRY0,1 FLAGS ARE CLEARED;
;THEN,DMOVN IS EXECUTED. NEXT, OVFL AND CRY0,1 FLAGS ARE EXAMINED.
;IF THE PROPER FLAGS ARE NOT SET, THE TEST FAILS.
Q'L'0: JFCL 17,.+1 ;CLEAR OVFL AND CRY0,1 FLAGS
DMOVN AC+1,[XWD A,B ;*DMOVN TEST
XWD C,D]
JSP AC,.+1 ;READ FLAGS
Q'L'1: TLZ AC,027777 ;CLEAR EXTRA JUNK
TLNE AC,USERF ;IN USER MODE ?
JRST Q'L'4 ;YES
SKIPE KLFLG ;KL10 ?
JRST Q'L'3 ;YES
;KI10 EXEC MODE
CAME AC,[KIEF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF OVFL OR CRY0,1 FLG SET
Q'L'2: JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH
JRST Q'L'6
;KL10 EXEC MODE
Q'L'3: CAME AC,[KLEF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF FLAGS NOT SET
JRST Q'L'2
;KL10/KI10 USER MODE
Q'L'4: SKIPE KLFLG ;KL10 ?
JRST Q'L'5 ;YES
;KI10 USER MODE
CAME AC,[KIUF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF ANY FLAGS SET
JRST Q'L'2
;KL10 USER MODE
Q'L'5: CAME AC,[KLUF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF FLAGS NOT SET
JRST Q'L'2
Q'L'6: JRST .+1>
DEFINE DMVM (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVEM INSTRUCTION
;FIRST, TSTWD, TSTWD+1 ARE PRELOADED WITH DATA OTHER THAN THE
;TEST WORDS AND AC,AC+1 ARE LOADED WITH THE TEST WORDS.
;THEN, THE DATA SPECIFIED BY [XWD A,B] AND [XWD C,D] IS MOVED
;FROM AC, AC+1 TO MEMORY (TSTWD, TSTWD+1) VIA
;THE DMOVEM INSTRUCTION. C(TSTWD) AND C(TSTWD+1) ARE THEN
;COMPARED WITH THE TEST WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'L'0: DMOVE AC,[XWD 707070,707070
XWD 070707,070707] ;INITIALIZE TEST WORDS
MOVEM AC,TSTWD ;TSTWD, TSTWD+1 ARE IN MEMORY JUST
MOVEM AC+1,TSTWD+1 ;AFTER THE FINAL TEST OF THIS PROGRAM
DMOVE AC,[XWD A,B
XWD C,D] ;INITIALIZE AC,AC+1
DMOVEM AC,TSTWD ;*MOVE DOUBLE WORD FROM AC, AC+1
;TO MEMORY (TSTWD, TSTWD+1)
DMOVE AC,TSTWD ;PUT RESULTS OF TEST IN AC,AC+1 FOR COMPARISON
CAME AC,[XWD A,B] ;WAS TSTWD LOADED CORRECTLY?
ER5 AC,L'1 ;FAIL IF CONTENTS(TSTWD) NOT = A,B
CAME AC+1,[XWD C,D] ;WAS TSTWD+1 LOADED CORRECTLY?
ER6 AC+1,L'2 ;FAIL IF CONTENTS(TSTWD+1) NOT = C,D
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVNM (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVNM INSTRUCTION
;FIRST, TSTWD, TSTWD+1 ARE PRELOADED WITH DATA OTHER THAN THE
;TEST WORDS AND AC, AC+1 ARE LOADED WITH THE TEST WORDS.
;THEN, THE NEGATIVE (TWOS COMPLEMENT) OF THE DATA SPECIFIED BY
;[XWD A,B] AND [XWD C,D] IS MOVED FROM AC, AC+1 TO MEMORY
;(TSTWD, TSTWD+1) VIA THE DMOVNM INSTRUCTION.
;C(TSTWD) AND C(TSTWD+1) ARE THEN COMPARED WITH THE
;NEGATIVE (TWOS COMPLEMENT) OF THE TEST
;WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'L'0: DMOVE AC,[XWD 707070,707070
XWD 070707,070707]
DMOVEM AC,TSTWD ;INITIALIZE TEST WORDS
DMOVE AC,[XWD A,B
XWD C,D] ;INITIALIZE AC,AC+1
DMOVN AC+5,[XWD A,B
XWD C,D] ;SET-UP TO CHECK RESULTS
DMOVNM AC,TSTWD ;*MOVE NEGATIVE OF DOUBLE WORD FROM AC, AC+1
;TO MEMORY (TSTWD, TSTWD+1)
DMOVE AC,TSTWD ;PUT TEST RESULTS IN AC,AC+1
CAME AC,<AC+5>&17 ;WAS TSTWD LOADED CORRECTLY?
ER5 AC,L'1 ;FAIL IF CONTENTS(TSTWD) NOT = COMPLEMENT OF A,B
CAME AC+1,<AC+6>&17 ;WAS TSTWD+1 LOADED CORRECTLY?
ER6 AC+1,L'2 ;FAIL IF CONTENTS(TSTWD) NOT = MINUS C,D
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVM17 (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVEM INSTRUCTION
;FIRST, TSTWD, TSTWD+1 ARE PRELOADED WITH DATA OTHER THAN THE
;TEST WORDS AND AC,AC+1 ARE LOADED WITH THE TEST WORDS.
;THEN, THE DATA SPECIFIED BY [XWD A,B] AND [XWD C,D] IS MOVED
;FROM AC, AC+1 TO MEMORY (TSTWD, TSTWD+1) VIA THE DMOVEM INSTRUCTION.
;C(TSTWD) AND C(TSTWD+1) ARE THEN COMPARED WITH THE TEST
;WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'L'0: MOVEM AC,%SV17 ;SAVE AC17 CAUSE IT HAS PDP
DMOVE AC,[XWD 707070,707070
XWD 070707,070707] ;INITIALIZE TEST WORDS
MOVEM AC,TSTWD ;TSTWD, TSTWD+1 ARE IN MEMORY JUST
MOVEM AC+1,TSTWD+1 ;AFTER THE FINAL TEST OF THIS PROGRAM
DMOVE AC,[XWD A,B
XWD C,D] ;INITIALIZE AC,AC+1
DMOVEM AC,TSTWD ;*MOVE DOUBLE WORD FROM AC, AC+1
;TO MEMORY (TSTWD, TSTWD+1)
DMOVE AC,TSTWD ;PUT RESULTS OF TEST IN AC,AC+1 FOR COMPARISON
CAMN AC,[XWD A,B] ;WAS TSTWD LOADED CORRECTLY?
JRST .+4 ;HERE IF TESTS OK
MOVEM AC,AC-1 ;SAVE BAD WORD
MOVE AC,%SV17 ;RESTORE P
ER5 AC-1,L'1 ;FAIL IF CONTENTS(TSTWD) NOT = A,B
CAMN AC+1,[XWD C,D] ;WAS TSTWD+1 LOADED CORRECTLY?
JRST .+4 ;HERE IF TESTS OK
MOVEM AC,AC-1 ;SAVE BAD WORD
MOVE AC,%SV17 ;RESTORE P
ER6 AC+1,L'2 ;FAIL IF CONTENTS(TSTWD+1) NOT = C,D
MOVE AC,%SV17 ;RESTORE AC UNCONDITIONALLY
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVNM17 (L,A,B,C,D) <
;THIS MACRO TESTS THE DMOVNM INSTRUCTION
;FIRST, TSTWD, TSTWD+1 ARE PRELOADED WITH DATA OTHER THAN THE
;TEST WORDS AND AC, AC+1 ARE LOADED WITH THE TEST WORDS.
;THEN, THE NEGATIVE (TWOS COMPLEMENT) OF THE DATA SPECIFIED BY
;[XWD A,B] AND [XWD C,D] IS MOVED FROM AC, AC+1 TO MEMORY
;(TSTWD, TSTWD+1) VIA THE DMOVNM INSTRUCTION.
;C(TSTWD) AND C(TSTWD+1) ARE THEN COMPARED WITH THE
;NEGATIVE (TWOS COMPLEMENT) OF THE TEST
;WORDS [XWD A,B] AND [XWD C,D], RESPECTIVELY.
;THE TEST PASSES IF THESE COMPARISONS AGREE.
Q'L'0: DMOVE AC,[XWD 707070,707070
XWD 070707,070707]
DMOVEM AC,TSTWD ;INITIALIZE TEST WORDS
DMOVE AC,[XWD A,B
XWD C,D] ;INITIALIZE AC,AC+1
DMOVN AC+5,[XWD A,B
XWD C,D] ;SET-UP TO CHECK RESULTS
DMOVNM AC,TSTWD ;*MOVE NEGATIVE OF DOUBLE WORD FROM AC, AC+1
;TO MEMORY (TSTWD, TSTWD+1)
DMOVE AC,TSTWD ;PUT TEST RESULTS IN AC,AC+1
CAMN AC,<AC+5>&17 ;WAS TSTWD LOADED CORRECTLY?
JRST .+4
MOVEM AC,AC-1 ;SAVE BAD WORD
MOVE AC,%SV17 ;RESTORE P
ER5 AC-1,L'1 ;FAIL IF CONTENTS(TSTWD) NOT = COMPLEMENT OF A,B
CAMN AC+1,<AC+6>&17 ;WAS TSTWD+1 LOADED CORRECTLY?
JRST .+4 ;HERE IF TESTS OK
MOVEM AC,AC-1 ;SAVE BAD WORD
MOVE AC,%SV17
ER6 AC+1,L'2 ;FAIL IF CONTENTS(TSTWD) NOT = MINUS C,D
MOVE AC,%SV17
JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH>
DEFINE DMVNMF (L,A,B,C,D,KIEF,KIUF,KLEF,KLUF) <
;**KI10**
;THIS MACRO VERIFIES THAT THE DMOVN INSTRUCTION DOES NOT SET OVERFLOW
;OR CARRY FLAGS ON THE KI10. FIRST, OVFL AND CRY0,1 FLAGS ARE CLEARED;
;THEN,DMOVN IS EXECUTED. NEXT, OVFL AND CRY0,1 FLAGS ARE EXAMINED.
;IF ANY OF THESE FLAGS ARE SET, THE TEST FAILS.
;**KL10**
;THIS MACRO VERIFIES THAT THE DMOVN INSTRUCTION DOES SET OVERFLOW
;OR CARRY FLAGS ON THE KL10. FIRST, OVFL AND CRY0,1 FLAGS ARE CLEARED;
;THEN,DMOVN IS EXECUTED. NEXT, OVFL AND CRY0,1 FLAGS ARE EXAMINED.
;IF THE PROPER FLAGS ARE NOT SET, THE TEST FAILS.
Q'L'0: JFCL 17,.+1 ;CLEAR OVFL AND CRY0,1 FLAGS
DMOVE AC,[XWD A,B
XWD C,D] ;SETUP INITIAL
DMOVNM AC,TSTWD ;*DMOVNM TEST
JSP AC,.+1 ;READ FLAGS
Q'L'1: TLZ AC,027777 ;CLEAR EXTRA JUNK
TLNE AC,USERF ;IN USER MODE ?
JRST Q'L'4 ;YES
SKIPE KLFLG ;KL10 ?
JRST Q'L'3 ;YES
;KI10 EXEC MODE
CAME AC,[KIEF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF OVFL OR CRY0,1 FLG SET
Q'L'2: JUMPL SAC,Q'L'0 ;LOOP ON ERROR SWITCH
JRST Q'L'6
;KL10 EXEC MODE
Q'L'3: CAME AC,[KLEF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF FLAGS NOT SET
JRST Q'L'2
;KL10/KI10 USER MODE
Q'L'4: SKIPE KLFLG ;KL10 ?
JRST Q'L'5 ;YES
;KI10 USER MODE
CAME AC,[KIUF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF ANY FLAGS SET
JRST Q'L'2
;KL10 USER MODE
Q'L'5: CAME AC,[KLUF,,Q'L'1]
ER13 AC,L'1 ;FAIL IF FLAGS NOT SET
JRST Q'L'2
Q'L'6: JRST .+1>
DEFINE DFA (T,A,B,C,D,E,F,G,H,I,M,K,L) <
R'T'00: DMOVE AC,[A,,B
C,,D]
DFAD AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,R'T'00 ;LOOP ON ERROR SWITCH>
DEFINE DFS (T,A,B,C,D,E,F,G,H,I,M,K,L) <
R'T'00: DMOVE AC,[A,,B
C,,D]
DFSB AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,R'T'00 ;LOOP ON ERROR SWITCH>
DEFINE DFM (T,A,B,C,D,E,F,G,H,I,M,K,L) <
R'T'00: DMOVE AC,[A,,B
C,,D]
DFMP AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,R'T'00 ;LOOP ON ERROR SWITCH>
DEFINE DFD (T,A,B,C,D,E,F,G,H,I,M,K,L) <
R'T'00: DMOVE AC,[A,,B
C,,D]
DFDV AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,R'T'00 ;LOOP ON ERROR SWITCH>
DEFINE DFARP (T,A,B,C,D,E,F,G,H,I,M,K,L) <
DMOVE AC,[A,,B
C,,D]
DFAD AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T
CAME AC+1,[K,,L]
ER4 AC+1,T
JUMPL AC+4,.-^D6 ;LOOP ON ERROR SWITCH>
DEFINE SDFA (T,A,B,C,D,E,F,G,H,I,M,K,L) <
S'T'00: DMOVE AC,[A,,B
C,,D]
DFAD AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,S'T'00 ;LOOP ON ERROR SWITCH>
DEFINE SDFS (T,A,B,C,D,E,F,G,H,I,M,K,L) <
S'T'00: DMOVE AC,[A,,B
C,,D]
DFSB AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,S'T'00 ;LOOP ON ERROR SWITCH>
DEFINE SDFM (T,A,B,C,D,E,F,G,H,I,M,K,L) <
S'T'00: DMOVE AC,[A,,B
C,,D]
DFMP AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,S'T'00 ;LOOP ON ERROR SWITCH>
DEFINE SDFMKL (T,A,B,C,D,E,F,G,H,I,M,K,L,KL1,KL2,KL3,KL4) <
S'T'00: DMOVE AC,[A,,B
C,,D]
DFMP AC,[E,,F
G,,H]
SKIPE KLFLG
JRST S'T'05
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
S'T'06: JUMPL AC+4,S'T'00 ;LOOP ON ERROR SWITCH
JRST S'T'07
S'T'05: CAME AC,[KL1,,KL2]
ER3 AC,T'01
CAME AC+1,[KL3,,KL4]
ER4 AC+1,T'01
JRST S'T'06
S'T'07: JRST .+1 >
DEFINE SDFD (T,A,B,C,D,E,F,G,H,I,M,K,L) <
S'T'00: DMOVE AC,[A,,B
C,,D]
DFDV AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
JUMPL AC+4,S'T'00 ;LOOP ON ERROR SWITCH>
DEFINE SDFDKL (T,A,B,C,D,E,F,G,H,I,M,K,L,KL1,KL2,KL3,KL4) <
S'T'00: DMOVE AC,[A,,B
C,,D]
DFDV AC,[E,,F
G,,H]
SKIPE KLFLG
JRST S'T'05
CAME AC,[I,,M]
ER3 AC,T'01
CAME AC+1,[K,,L]
ER4 AC+1,T'01
S'T'06: JUMPL AC+4,S'T'00 ;LOOP ON ERROR SWITCH
JRST S'T'07
S'T'05: CAME AC,[KL1,,KL2]
ER3 AC,T'01
CAME AC+1,[KL3,,KL4]
ER4 AC+1,T'01
JRST S'T'06
S'T'07: JRST .+1 >
DEFINE SDFARP (T,A,B,C,D,E,F,G,H,I,M,K,L) <
DMOVE AC,[A,,B
C,,D]
DFAD AC,[E,,F
G,,H]
CAME AC,[I,,M]
ER3 AC,T
CAME AC+1,[K,,L]
ER4 AC+1,T
JUMPL AC+4,.-^D6 ;LOOP ON ERROR SWITCH>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -2536,8 +2536,14 @@ class DebuggerPDP10 extends Debugger {
if (!nWords) {
this.println("no data");
} else {
this.println(nWords + " words loaded at " + this.toStrBase(addrLo) + '-' + this.toStrBase(addrHi));
if (addrStart != null) this.cpu.setPC(addrStart);
var sStart = "start address ";
if (addrStart != null) {
this.cpu.setPC(addrStart);
sStart += this.toStrBase(addrStart);
} else {
sStart += "unspecified";
}
this.println(nWords + " words loaded at " + this.toStrBase(addrLo) + '-' + this.toStrBase(addrHi) + ", " + sStart);
this.updateStatus();
}
}
@ -2614,10 +2620,7 @@ class DebuggerPDP10 extends Debugger {
* assembling (multiple files must be separated by semicolons), along with any option letters that were included
* with the "a" command; for example, if "ap" was specified, then "p" will be passed to Macro10 as an option.
*
* Macro10 options include:
*
* p: preprocess the specified resource(s) without assembling them
* l: generate listing information (TODO)
* See the Macro10 component for a list of supported options.
*
* When assembling a file, the target address determines the initial location counter for the assembly process,
* but that can always be overridden by a LOC (or RELOC) pseudo-op in the file. The target address will also be

View file

@ -125,6 +125,11 @@ class Macro10 {
* parseExpression(), etc). This is NOT a subclass of Component, so Component services are not part
* of this class.
*
* Supported options include:
*
* 'p': print the preprocessed resource(s) without assembling them
* 'l': print lines as they are parsed
*
* @this {Macro10}
* @param {string} sURL (the URL(s) of the resource to be assembled)
* @param {number|null} addrLoad (the absolute address to assemble the code at, if any)
@ -264,6 +269,7 @@ class Macro10 {
this.iURL = 0;
this.asURLs = sURL.split(';');
this.anLines = []; // keeps track of the number of lines per file
this.loadNextResource();
}
@ -281,7 +287,7 @@ class Macro10 {
}
var macro10 = this;
var sURL = this.asURLs[this.iURL++];
var sURL = this.asURLs[this.iURL];
this.println("loading " + Str.getBaseName(sURL));
@ -311,10 +317,31 @@ class Macro10 {
sText += s;
}
match = sText.match(/&[a-z]+;/i);
if (match) macro10.warning("unrecognized HTML entity: " + match[0]);
if (match) macro10.warning("unrecognized HTML entity '" + match[0] + "'");
}
macro10.asLines = macro10.asLines.concat(sText.split(/(\r?\n)/));
/*
* For a file containing N lines, split() will return an array of N*2+1 entries, with every even entry
* containing the characters, if any, preceding a line-ending, and every odd entry (including the final
* entry) containing a line-ending.
*
* If, for some reason, split() doesn't do that, then we try to warn and patch things up as best we can.
*/
var asLines = sText.split(/(\r?\n)/);
if (asLines.length & 1) {
s = asLines.pop();
if (s) {
macro10.warning("unexpected line '" + s + "'");
asLines.push(s);
asLines.push("");
}
} else {
macro10.warning("unexpected number of lines (" + asLines.length + ")");
}
macro10.asLines = macro10.asLines.concat(asLines);
macro10.anLines[macro10.iURL] = (asLines.length >> 1);
macro10.iURL++;
setTimeout(function() {
macro10.loadNextResource();
@ -361,7 +388,7 @@ class Macro10 {
var macro10 = this;
/*
* If the "preprocess" option is set, then just return the plain text we retrieved.
* If the "preprocess" option is set, then print everything without assembling.
*/
if (this.sOptions.indexOf('p') >= 0) {
this.println(this.asLines.join(""));
@ -371,7 +398,16 @@ class Macro10 {
var a = this.dbg.resetVariables();
try {
for (let i = 0; i < this.asLines.length; i += 2) {
this.nLine++;
/*
* If the "line" option is set, then print all the lines as they are parsed.
*/
if (this.sOptions.indexOf('l') >= 0) {
this.println(this.getLineRef() + ": " + this.asLines[i]);
}
/*
* Since, at this early stage, I'm not sure whether all the resources I'm interested in
* assembling have had their original CR/LF line endings preserved (eg, some files may have
@ -379,6 +415,7 @@ class Macro10 {
* are in the array (stored in every OTHER entry) and insert my own uniform CR/LF sequences.
*/
if (!this.parseLine(this.asLines[i] + '\r\n')) break;
/*
* When an END statement is encountered, addrStart will change from null to either undefined
* or a starting address.
@ -387,11 +424,11 @@ class Macro10 {
}
if (this.nMacroDef) {
this.error("open block from line " + this.tblMacros[this.sMacroDef].nLine);
this.error("open block", this.tblMacros[this.sMacroDef].nLine);
}
if (this.stackScopes.length) {
this.error("open scope from line " + this.stackScopes[0].nLine);
this.error("open scope", this.stackScopes[0].nLine);
}
/*
@ -480,7 +517,7 @@ class Macro10 {
/*
* This is more of an assert(), because it should never happen, regardless of input.
*/
this.error("missing definition for variable: " + name);
this.error("missing definition for variable '" + name + "'");
continue;
}
this.parseText(macro.sText);
@ -492,7 +529,7 @@ class Macro10 {
this.aFixups.forEach(function processFixup(sValue, nLocation){
let value = macro10.parseExpression(sValue, undefined, nLocation);
if (value === undefined) {
macro10.error("unable to parse expression: " + sValue);
macro10.error("unable to parse expression '" + sValue + "'");
return;
}
value += macro10.aWords[nLocation];
@ -527,7 +564,7 @@ class Macro10 {
this.nMacroDef++;
sLine = sLine.substr(i+1);
} else {
this.error("expected " + this.sOperator + " definition: " + sLine);
this.error("expected " + this.sOperator + " definition in '" + sLine + "'");
}
}
if (this.nMacroDef > 1) {
@ -546,7 +583,7 @@ class Macro10 {
while (fParse) {
var matchLine = sLine.match(this.reLine);
if (!matchLine || matchLine[5] && matchLine[5].slice(0, 1) != ';') {
this.error("failed to parse line: " + sLine);
this.error("failed to parse line '" + sLine + "'");
return false;
}
fParse = false;
@ -639,6 +676,10 @@ class Macro10 {
this.defASCII(sRemainder);
break;
case Macro10.PSEUDO_OP.BLOCK:
this.defBLOCK(sOperands);
break;
case Macro10.PSEUDO_OP.END:
this.defEND(sOperands);
break;
@ -661,6 +702,7 @@ class Macro10 {
case Macro10.PSEUDO_OP.IFG:
case Macro10.PSEUDO_OP.IFL:
case Macro10.PSEUDO_OP.IFN:
case Macro10.PSEUDO_OP.IFNDEF:
case Macro10.PSEUDO_OP.IRP:
case Macro10.PSEUDO_OP.IRPC:
case Macro10.PSEUDO_OP.OPDEF:
@ -728,7 +770,6 @@ class Macro10 {
*/
parseMacro(name, sOperands)
{
var i;
var macro = this.tblMacros[name];
if (!macro) return false;
@ -738,9 +779,16 @@ class Macro10 {
* the operands and merge their bits with the OPDEF's bits.
*/
if (macro.nOperand == Macro10.MACRO_OP.OPDEF) {
var nLocation = this.nLocation;
this.parseText(macro.sText);
if (nLocation < this.nLocation) {
/*
* An OPDEF invokation *may* have operands, but it's not required to.
*/
if (!sOperands) return true;
this.pushScope();
this.parseText(sOperands);
var w = this.aWords[0];
@ -759,7 +807,11 @@ class Macro10 {
return true;
}
}
this.error("OPDEF '" + name + "' error: " + sOperands);
/*
* Either the OPDEF didn't generate any data OR the OPDEF's operands failed to evaluate.
*/
this.error("OPDEF '" + name + "' (" + sOperands + ") failed");
return false;
}
var macroPrev = this.macroCall;
@ -782,13 +834,8 @@ class Macro10 {
var sOperator = name.substr(1);
switch(sOperator) {
case Macro10.PSEUDO_OP.IFDEF:
if (macro.nOperand) {
this.parseText(macro.sText);
}
break;
case Macro10.PSEUDO_OP.IFE:
case Macro10.PSEUDO_OP.IFNDEF:
if (!macro.nOperand) {
this.parseText(macro.sText);
}
@ -807,6 +854,7 @@ class Macro10 {
break;
case Macro10.PSEUDO_OP.IFN:
case Macro10.PSEUDO_OP.IFDEF:
if (macro.nOperand) {
this.parseText(macro.sText);
}
@ -814,7 +862,7 @@ class Macro10 {
case Macro10.PSEUDO_OP.IRP:
case Macro10.PSEUDO_OP.IRPC:
for (i = 0; i < macro.aValues.length; i++) {
for (let i = 0; i < macro.aValues.length; i++) {
this.parseText(macro.sText, macro.aParms, [macro.aValues[i]], []);
}
break;
@ -903,29 +951,6 @@ class Macro10 {
}
}
/**
* error(sError)
*
* @this {Macro10}
* @param {string} sError
*/
error(sError)
{
throw new Error("error" + (this.nLine? " at line " + Str.toDec(this.nLine) : "") + ": " + sError);
}
/**
* warning(sWarning)
*
* @this {Macro10}
* @param {string} sWarning
*/
warning(sWarning)
{
this.println("warning" + (this.nLine? " at line " + Str.toDec(this.nLine) : "") + ": " + sWarning);
}
/**
* getExpression(sOperands, sDelim)
*
@ -955,7 +980,7 @@ class Macro10 {
cNesting++;
} else if (ch == '>') {
if (--cNesting < 0) {
this.error("missing bracket(s): " + sOperands);
this.error("missing bracket(s) in '" + sOperands + "'");
break;
}
}
@ -964,7 +989,7 @@ class Macro10 {
sOperand = sOperands.substr(0, i);
}
else if (cNesting > 0) {
this.error("extra bracket(s): " + sOperands);
this.error("extra bracket(s) in '" + sOperands + "'");
}
return sOperand;
}
@ -998,9 +1023,18 @@ class Macro10 {
/*
* The SIXBIT (and presumably ASCII; not sure about ASCIZ) pseudo-ops can also be used in expressions
* (or at least assignments), so we check for those in the given expression and convert them to quoted
* sequences that the debugger's parseExpression() understands.
* sequences that the Debugger's parseExpression() understands.
*/
sOperand = sOperand.replace(/SIXBIT\s*(\S)(.*?)\1/g, "'$2'").replace(/ASCII\s*(\S)(.*?)\1/g, '"$2"');
var sOperator = "";
var sOperands = sOperand;
if (match = sOperand.match(/^([^\s]+)\s+(.+?)\s*$/)) {
sOperator = match[1];
sOperands = match[2];
}
result = this.dbg.parseInstruction(sOperator, sOperands, nLocation, true);
if (result < 0) {
/*
* Check for the "period" syntax that MACRO-10 uses to represent the value of the current location.
* The Debugger's parseInstruction() method understands that syntax, but its parseExpression() method
@ -1014,7 +1048,8 @@ class Macro10 {
*/
result = this.dbg.parseExpression(sOperand.replace(/\.([^0-9]|$)/g, this.dbg.toStrBase(nLocation, -1) + "$1"), fPass1);
if (result === undefined) {
this.error("error parsing expression: " + sOperand);
this.error("unable to parse expression '" + sOperand + "'");
}
}
} else {
var wLeft = match[1]? this.parseExpression(match[1], fPass1, nLocation) : 0;
@ -1058,7 +1093,7 @@ class Macro10 {
}
}
if (cNesting < 0) {
this.error("missing bracket(s): " + sOperands);
this.error("missing bracket(s) in '" + sOperands + "'");
}
if (iBegin >= 0) {
sLiteral = sOperands.substr(iBegin, iEnd - iBegin);
@ -1090,6 +1125,27 @@ class Macro10 {
return aDefaults;
}
/**
* getLineRef(nLine)
*
* @this {Macro10}
* @param {number|undefined} [nLine]
* @return {string}
*/
getLineRef(nLine = this.nLine)
{
var iURL = 0;
while (nLine > this.anLines[iURL]) {
nLine -= this.anLines[iURL];
if (iURL < this.asURLs.length - 1) {
iURL++;
} else {
break;
}
}
return Str.getBaseName(this.asURLs[iURL] + " line " + nLine);
}
/**
* getReserved(sOperands)
*
@ -1337,7 +1393,7 @@ class Macro10 {
*/
match = sOperands.match(/([A-Z$%.][0-9A-Z$%.]*)\s*(\([^)]*\)|)\s*,?\s*(<|)([\s\S]*)/i);
if (!match) {
this.error("unrecognized " + sOperator + ": " + sOperands);
this.error("unrecognized " + sOperator + " in '" + sOperands + "'");
return sOperands;
}
name = match[1];
@ -1362,7 +1418,7 @@ class Macro10 {
this.chMacroClose = ']';
match = sOperands.match(/([A-Z$%.][0-9A-Z$%.]*)\s*(\[)([\s\S]*)/i);
if (!match) {
this.error("unrecognized " + sOperator + ": " + sOperands);
this.error("unrecognized " + sOperator + " in '" + sOperands + "'");
return sOperands;
}
name = match[1];
@ -1377,7 +1433,7 @@ class Macro10 {
this.chMacroClose = ']';
name = '?' + Str.toDec(++this.nLiteral, 5);
if (this.tblMacros[name] !== undefined) {
this.error("literal symbol redefined: " + name);
this.error("literal symbol '" + name + "' redefined");
}
match = [sOperands[0], sOperands.substr(1)];
nOperand = Macro10.MACRO_OP.LITERAL;
@ -1395,14 +1451,14 @@ class Macro10 {
}
match = sOperands.match(/([A-Z$%.][0-9A-Z$%.]*)\s*,\s*(<|)([\s\S]*)/i);
if (!match) {
this.error("unrecognized " + sOperator + ": " + sOperands);
this.error("unrecognized " + sOperator + " operands '" + sOperands + "'");
return sOperands;
}
for (i = 0; i < this.macroCall.aParms.length; i++) {
if (match[1] == this.macroCall.aParms[i]) break;
}
if (i == this.macroCall.aParms.length) {
this.error("invalid " + sOperator + " parameter: " + match[1]);
this.error("invalid " + sOperator + " parameter '" + match[1] + "'");
return sOperands;
}
name = '?' + sOperator;
@ -1421,7 +1477,7 @@ class Macro10 {
*/
var sOperand = this.getExpression(sOperands);
if (!sOperand) {
this.error("missing " + sOperator + " expression: " + sOperands);
this.error("missing " + sOperator + " expression '" + sOperands + "'");
return sOperands;
}
sOperands = sOperands.substr(sOperand.length + 1);
@ -1429,7 +1485,7 @@ class Macro10 {
match = sOperands.match(/\s*(<|)([\s\S]*)/i);
name = '?' + sOperator;
if (sOperator == Macro10.PSEUDO_OP.IFDEF) {
if (sOperator == Macro10.PSEUDO_OP.IFDEF || sOperator == Macro10.PSEUDO_OP.IFNDEF) {
nOperand = this.isDefined(sOperand)? 1 : 0;
} else {
/*
@ -1503,16 +1559,22 @@ class Macro10 {
{
name = name.toUpperCase().substr(0, 6);
if ((nType & Macro10.SYMTYPE.LABEL) && this.tblSymbols[name] !== undefined) {
this.error("label " + name + " redefined");
this.error("label '" + name + "' redefined");
return;
}
var sUndefined = null;
if (typeof value == 'string') {
var v = this.parseExpression(value);
/*
* We now pass true to parseExpression() to allow at least one undefined symbol to exist in the expression,
* which we will record alongside the variable.
*/
var v = this.parseExpression(value, true);
if (v === undefined) {
this.error("parseExpression(" + value + ")");
this.error("parseExpression(" + value + ") failed");
return;
}
value = v;
sUndefined = this.dbg.sUndefined;
}
var sym = this.tblSymbols[name];
if (sym) {
@ -1522,7 +1584,25 @@ class Macro10 {
} else {
this.tblSymbols[name] = {name, value, nType, nLine: this.nLine};
}
this.dbg.setVariable(name, value);
this.dbg.setVariable(name, value, sUndefined);
}
/**
* defBLOCK()
*
* Processes the BLOCK pseudo-op.
*
* @this {Macro10}
* @param {string} sOperands
*/
defBLOCK(sOperands)
{
var w = this.parseExpression(sOperands);
if (w !== undefined && this.dbg.sUndefined == null && w >= 0 && w <= 0o777777) {
this.nLocation += w; // while (w--) this.genWord(0);
} else {
this.error("unrecognized BLOCK expression '" + sOperands + "'");
}
}
/**
@ -1540,7 +1620,7 @@ class Macro10 {
} else {
this.addrStart = this.parseExpression(sOperands, true);
if (this.addrStart === undefined) {
this.error("unrecognized expression: " + sOperands);
this.error("unrecognized END expression '" + sOperands + "'");
}
}
}
@ -1559,7 +1639,7 @@ class Macro10 {
if (w !== undefined) {
this.genWord(w, this.dbg.sUndefined);
} else {
this.error("unrecognized expression: " + sOperands);
this.error("unrecognized EXP expression '" + sOperands + "'");
}
}
@ -1602,23 +1682,14 @@ class Macro10 {
*/
defWord(sOperator, sSeparator, sOperands)
{
var w = -1;
var sExp = (sOperator + sSeparator + sOperands).trim();
if (sOperands.indexOf(",,") < 0) {
var nLocation = this.nLocationScope >= 0? this.nLocationScope : this.nLocation;
w = this.dbg.parseInstruction(sOperator, sOperands, nLocation, true);
}
if (w < 0) {
w = this.parseExpression(sExp, true);
}
var w = this.parseExpression(sExp, true);
if (w !== undefined) {
this.genWord(w, this.dbg.sUndefined);
} else {
this.error("unrecognized expression: " + sExp);
this.error("unrecognized word expression '" + sExp + "'");
}
}
@ -1698,6 +1769,31 @@ class Macro10 {
return w;
}
/**
* error(sError, nLine)
*
* @this {Macro10}
* @param {string} sError
* @param {number} [nLine]
* @throws {Error}
*/
error(sError, nLine)
{
throw new Error("error in " + this.getLineRef(nLine) + ": " + sError);
}
/**
* warning(sWarning, nLine)
*
* @this {Macro10}
* @param {string} sWarning
* @param {number} [nLine]
*/
warning(sWarning, nLine)
{
this.println("warning in " + this.getLineRef(nLine) + ": " + sWarning);
}
/**
* println(s)
*
@ -1723,6 +1819,7 @@ Macro10.SYMTYPE = {
Macro10.PSEUDO_OP = {
ASCII: "ASCII",
ASCIZ: "ASCIZ",
BLOCK: "BLOCK",
DEFINE: "DEFINE",
END: "END",
EXP: "EXP",
@ -1731,10 +1828,11 @@ Macro10.PSEUDO_OP = {
IFG: "IFG",
IFL: "IFL",
IFN: "IFN",
IFNDEF: "IFNDEF",
IRP: "IRP",
IRPC: "IRPC",
LALL: "LALL",
LITERAL: "LITERAL", // this is a pseudo-pseudo-op, used for internal purposes
LITERAL: "LITERAL", // this is a pseudo-pseudo-op, for internal use only
LIST: "LIST",
LOC: "LOC",
NOSYM: "NOSYM",

View file

@ -151,9 +151,9 @@ class Debugger extends Component
/*
* aVariables is an object with properties that grow as setVariable() assigns more variables;
* each property corresponds to one variable, where the property name is the variable name (ie,
* a string beginning with a letter or underscore, followed by zero or more additional letters,
* digits, or underscores) and the property value is the variable's numeric value. See doVar()
* and setVariable() for details.
* a string beginning with a non-digit, followed by zero or more symbol characters and/or digits)
* and the property value is the variable's numeric value. See doVar() and setVariable() for
* details.
*
* Note that parseValue() parses variables before numbers, so any variable that looks like a
* unprefixed hex value (eg, "a5" as opposed to "0xa5") will trump the numeric value. Unprefixed
@ -1019,7 +1019,20 @@ class Debugger extends Component
value = this.getRegValue(iReg);
} else {
value = this.getVariable(sValue);
if (value == null) {
if (value != null) {
var sUndefined = this.getVariableFixup(sValue);
if (sUndefined) {
if (!this.sUndefined) {
this.sUndefined = sUndefined;
} else {
if (!fQuiet) {
this.println(sValue + " has too many undefined values (" + sUndefined + ',' + this.sUndefined + ")");
fQuiet = true;
}
value = undefined;
}
}
} else {
/*
* A feature of MACRO-10 is that any single-digit number is automatically interpreted as base-10.
*/
@ -1119,11 +1132,11 @@ class Debugger extends Component
printVariable(sVar)
{
if (sVar) {
return this.printValue(sVar, this.aVariables[sVar]);
return this.printValue(sVar, this.aVariables[sVar].value);
}
var cVariables = 0;
for (sVar in this.aVariables) {
this.printValue(sVar, this.aVariables[sVar]);
this.printValue(sVar, this.aVariables[sVar].value);
cVariables++;
}
return cVariables > 0;
@ -1149,7 +1162,19 @@ class Debugger extends Component
*/
getVariable(sVar)
{
return this.aVariables[sVar];
return this.aVariables[sVar] && this.aVariables[sVar].value;
}
/**
* getVariableFixup(sVar)
*
* @this {Debugger}
* @param {string} sVar
* @return {string|undefined}
*/
getVariableFixup(sVar)
{
return this.aVariables[sVar] && this.aVariables[sVar].sUndefined;
}
/**
@ -1165,15 +1190,16 @@ class Debugger extends Component
}
/**
* setVariable(sVar, value)
* setVariable(sVar, value, sUndefined)
*
* @this {Debugger}
* @param {string} sVar
* @param {number} value
* @param {string|null} [sUndefined]
*/
setVariable(sVar, value)
setVariable(sVar, value, sUndefined)
{
this.aVariables[sVar] = value;
this.aVariables[sVar] = {value, sUndefined};
}
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long