Uit Hack42
Ga naar: navigatie, zoeken
(codebuffer teruggezet in field0.txt)
 
(16 tussenliggende versies door 2 gebruikers niet weergegeven)
Regel 1: Regel 1:
== Code for the pdp8/f ==
+
== Code for the [[Digital_PDP-8f |pdp8/f]] ==
  
  
=== for this machine ===
+
=== for this exact specimen ===
  
 
this code is for the machine in the configuration we got it in.
 
this code is for the machine in the configuration we got it in.
Regel 10: Regel 10:
 
''Pasted on paper on the back of the pdp8 8/e 8/f 8/m Pocket Reference Card''
 
''Pasted on paper on the back of the pdp8 8/e 8/f 8/m Pocket Reference Card''
  
{| class="wikitable"
+
{|
 
|-
 
|-
 
! Addr !! instr !! comment
 
! Addr !! instr !! comment
Regel 68: Regel 68:
 
| 0432 || ? || writing completely gone
 
| 0432 || ? || writing completely gone
 
|}
 
|}
 +
 +
After a coredump we found in field 0 on address 0400 some more of the code. now only one address needs to be found.
 +
 +
{|
 +
|-
 +
! Addr !! instr !! comment
 +
|-
 +
| 0400 || 1230 || -
 +
|-
 +
| 0401 || 6321 || -
 +
|-
 +
| 0402 || 6321 || -
 +
|-
 +
| 0403 || 7600 || -
 +
|-
 +
| 0404 || 6322 || -
 +
|-
 +
| 0405 || 5204 || -
 +
|-
 +
| 0406 || 6324 || -
 +
|-
 +
| 0407 || 7106 || -
 +
|-
 +
| 0410 || 7006 || -
 +
|-
 +
| 0411 || 3233 || -
 +
|-
 +
| 0412 || 6322 || -
 +
|-
 +
| 0413 || 5212 || -
 +
|-
 +
| 0414 || 6324 || -
 +
|-
 +
| 0415 || 7012 || -
 +
|-
 +
| 0416 || 7012 || -
 +
|-
 +
| 0417 || 0217 || -
 +
|-
 +
| 0420 || 1233 || -
 +
|-
 +
| 0421 || 3132 || -
 +
|-
 +
| 0422 || 2332 || -
 +
|-
 +
| 0423 || 2331 || -
 +
|-
 +
| 0424 || 5204 || -
 +
|-
 +
| 0425 || 1203 || -
 +
|-
 +
| 0426 || 6321 || -
 +
|-
 +
| 0427 || 5014 || -
 +
|-
 +
| 0430 || 0401 || -
 +
|-
 +
| 0431 || 7400 || -
 +
|-
 +
| 0432 || 0000 || bad core? all fields on this adress read 0000
 +
|}
 +
 +
==== Ascii print on teletype ====
 +
This is a simple test to see if serial communication is working at least one way.
 +
On our machine, the Teletype resides not on the standard address but on address 43/44
 +
 +
<pre>
 +
0003 7001  INC AC +1
 +
0004 6446  Output char
 +
0005 6441  if flag skip next
 +
0006 5005  JMP 5
 +
0007 5003  JPM 3
 +
</pre>
 +
 +
For the hightspeed serial card on adress 03/04 use the code below
 +
 +
<pre>
 +
0003 7001  INC AC +1
 +
0004 6046  Output char
 +
0005 6041  if flag skip next
 +
0006 5005  JMP 5
 +
0007 5003  JPM 3
 +
</pre>
 +
 +
Another test is from DEC PDP8/e Maintenance Vol. 1 Processor DEC-8E-HMM1a-D-D:
 +
 +
This echos back the caracters typed on a teletype or other serial terminal.
 +
 +
<pre>
 +
0000 6032  or 6432 for the high speed interface
 +
0001 6031  or 6431 "
 +
0002 5001
 +
0003 6036  or 6436 "
 +
0004 6046  or 6446 "
 +
0005 6041  or 6441 "
 +
0006 5005
 +
0007 5001
 +
</pre>
  
 
=== code to dump the core of field 0 to a serial port ===
 
=== code to dump the core of field 0 to a serial port ===
  
 
==== Bugblue version ====
 
==== Bugblue version ====
There are some jumps because of faulty memory locations. that is why the start address is 176o.
+
There are some jumps because of faulty memory locations. that is why the start address is 176o.
 +
We know this program is highly inefficient and much nicer written if you do understand what you are doing.
 +
But as it grew we don't like to toggle the whole program again. Hence the very ugly jumps and hacks.
  
<code>
+
<pre>
            *176                    /LOCATE PROGRAM STARTING AT ADDR 200
+
0175 170176         *176                    /LOCATE PROGRAM STARTING AT ADDR 200
            CLA CLL                /CLEAR ACCUMULATOR /CLEAR AC LINK
+
0176 7300         CLA CLL                /CLEAR ACCUMULATOR /CLEAR AC LINK
            NOP // bad memory
+
0177 7000         NOP // bad memory
            DCA TMP1                /STORE THAT (0) IN TMP1
+
0200 3273         DCA TMP1                /STORE THAT (0) IN TMP1
            NOP // bad memory
+
0201 7000         NOP // bad memory
    MAIN,  NOP
+
0202 7000 MAIN,  NOP
            TAD TMP1                // load TMP1
+
0203 1273         TAD TMP1                // load TMP1
            JMS PRINTNUM            // print dit nummer
+
0204 4223         JMS PRINTNUM            // print dit nummer
            CLA CLL
+
0205 7300         CLA CLL
            TAD SPACE
+
0206 1275         TAD SPACE
            JMS TTYO                // output to tty0
+
0207 4263         JMS TTYO                // output to tty0
            TAD I TMP1              // indirect laden van TMP1
+
0210 4307         JMS LAAD                // LOAD data field (change)
            JMS PRINTNUM            // print dit nummer
+
0211 4223         JMS PRINTNUM            // print dit nummer
            TAD TMP1                // load TMP1
+
0212 1273         TAD TMP1                // load TMP1
            IAC                    // INCREMENT 1
+
0213 7001         IAC                    // INCREMENT 1
            DCA TMP1
+
0214 3273         DCA TMP1  
            TAD CR
+
0215 1277         TAD CR
            JMS TTYO                // output to tty0
+
0216 4263         JMS TTYO                // output to tty0
            CLA CLL
+
0217 7300         CLA CLL
            TAD LF
+
0220 1276         TAD LF
            JMS TTYO                // output to tty0
+
0221 4263         JMS TTYO                // output to tty0
            JMP MAIN                // tada.wav
+
0222 5202         JMP MAIN                // tada.wav
   
+
0223 7000 PRINTNUM, NOP
    PRINTNUM, NOP
+
0224 3274         DCA TMP3                // store this in tmp3
            DCA TMP3                // store this in tmp3
+
0225 1274         TAD TMP3                // get it.
            TAD TMP3                // get it.
+
0226 7010         RAR
            RAR
+
0227 7012         RTR
            RTR
+
0230 7012         RTR
            RTR
+
0231 7012         RTR
            RTR
+
0232 4302         JMS STUK
            JMS STUK
+
0233 7000         NOP
            NOP
+
0234 7000 HEEL,  NOP
    HEEL,  NOP
+
0235 7300         CLA CLL                // clear AC
                                 
+
0236 1274         TAD TMP3                // load TMP3
            CLA CLL                // clear AC
+
0237 7012         RTR
            TAD TMP3                // load TMP3
+
0240 7012         RTR
            RTR
+
0241 7012         RTR            // 6 bitwise shift
            RTR
+
0242 4257         JMS PLUS                // xor met 0070
            RTR            // 6 bitwise shift
+
0243 4263         JMS TTYO                // output to tty0
            JMS PLUS                // xor met 0070
+
0244 7300         CLA CLL                // clear AC
            JMS TTYO                // output to tty0
+
0245 1274         TAD TMP3                // load TMP3
                                 
+
0246 7010         RAR
            CLA CLL                // clear AC
+
0247 7012         RTR                // 3 bitwise shift
            TAD TMP3                // load TMP3
+
0250 4257         JMS PLUS                // xor met 0070
            RAR
+
0251 4263         JMS TTYO                // output to tty0
            RTR                // 3 bitwise shift
+
0252 7300         CLA CLL                // clear AC
            JMS PLUS                // xor met 0070
+
0253 1274         TAD TMP3                // load TMP3
            JMS TTYO                // output to tty0
+
0254 4257         JMS PLUS                // xor met 0070
                                 
+
0255 4263         JMS TTYO                // output to tty0
            CLA CLL                // clear AC
+
0256 5623         JMP I PRINTNUM
            TAD TMP3                // load TMP3
+
0257 7000 PLUS,  NOP
            JMS PLUS                // xor met 0070
+
0260 0300 AND AND7
            JMS TTYO                // output to tty0
+
0261 1272         TAD    PLUS60
            JMP I PRINTNUM
+
0262 5657         JMP  I  PLUS
                                   
+
0263 7000 TTYO,  NOP                    /TTY OUTPUT ROUTINE. THE FIRST WORD OF
    PLUS,  NOP
+
0264 6446         6446                    /WRITE AC TO THE OUTPUT DEVICE (TTY)
            AND     AND7
+
0265 6441         6441                    /IF TTY IS READY, SKIP NEXT INSTRUCTION.
            TAD    PLUS60
+
0266 5265         JMP .-1                /TTY IS NOT READY, SO CHECK AGAIN
            JMP  I  PLUS
+
0267 7200         CLA                    /CLEAR AC
   
+
0270 7000         NOP // Memory broken
    TTYO,  NOP                    /TTY OUTPUT ROUTINE. THE FIRST WORD OF
+
0271 5663         JMP I TTYO              /RETURN TO CALLER
                                    /A SUBROUTINE MUST BE EMPTY (0) BECAUSE
+
0272 0060 PLUS60, 60
                                    /THE JMS INSTRUCTION INSERTS THE RETURN
+
0273 0000 TMP1,  0
                                    /ADDR IN THIS WORD.
+
0274 0000 TMP3,  0
            6446                    /WRITE AC TO THE OUTPUT DEVICE (TTY)
+
0275 0040 SPACE,  40
            6441                    /IF TTY IS READY, SKIP NEXT INSTRUCTION.
+
0276 0012 LF,    12
            JMP .-1                /TTY IS NOT READY, SO CHECK AGAIN
+
0277 0015 CR,    15
            CLA                    /CLEAR AC
+
0300 0007 AND7,  7
            NOP // Memory broken
+
0301 7000         NOP // Memory broken
            JMP I TTYO              /RETURN TO CALLER
+
0302 7000 STUK, NOP
   
+
0303 7012         RTR            // 9 bitwise shift
    PLUS60, 60
+
0304 4257         JMS PLUS                // xor met 0070
    TMP1,  0
+
0305 4263         JMS TTYO                // output to tty0
    TMP3,  0
+
0306 5234 JMP HEEL
    SPACE,  40
+
0307 7000 LAAD, NOP
    LF,    12
+
0310 1273         TAD TMP1
    CR,    15
+
0311 1001         TAD 1
    AND7,  7
+
0312 7450         SNA
            NOP // Memory broken
+
0313 7402         HLT
    STUK, NOP
+
0314 6211         6201 10                // CDF 10
            RTR            // 9 bitwise shift
+
0315 1673         TAD I TMP1              // indirect laden van TMP1
            JMS PLUS                // xor met 0070
+
0316 6210         6210  0                // CDF 0
            JMS TTYO                // output to tty0
+
0317 5707         JMP I LAAD
    JMP HEEL
+
$
    $
+
</pre>
</code>
 
  
 
==== Rick Murphy version ====
 
==== Rick Murphy version ====

Huidige versie van 20 mei 2015 om 17:32

Code for the pdp8/f

for this exact specimen

this code is for the machine in the configuration we got it in.

OS8/SYKES Bootstrap Loader

Pasted on paper on the back of the pdp8 8/e 8/f 8/m Pocket Reference Card

Addr instr comment
0400 1230 -
0401 6321 -
0402 6321 -
0403 7600 -
0404 6322 -
0405 5204 -
0406 6324 -
0407 7106 -
0410 7006 -
0411 3233 -
0412 6322 -
0413 5212 -
0414 6324 -
0415 7012 -
0416 7012 -
0417 0217 -
0420 1233 -
0421 3132 -
0422 2332 very faint..
0423 2331 barely readable
0424 5204 -
0425 1203 -
0426 6321 -
0427 5014 faint could be 5017
0430 0401 faint.
0431 ? writing completely gone
0432 ? writing completely gone

After a coredump we found in field 0 on address 0400 some more of the code. now only one address needs to be found.

Addr instr comment
0400 1230 -
0401 6321 -
0402 6321 -
0403 7600 -
0404 6322 -
0405 5204 -
0406 6324 -
0407 7106 -
0410 7006 -
0411 3233 -
0412 6322 -
0413 5212 -
0414 6324 -
0415 7012 -
0416 7012 -
0417 0217 -
0420 1233 -
0421 3132 -
0422 2332 -
0423 2331 -
0424 5204 -
0425 1203 -
0426 6321 -
0427 5014 -
0430 0401 -
0431 7400 -
0432 0000 bad core? all fields on this adress read 0000

Ascii print on teletype

This is a simple test to see if serial communication is working at least one way. On our machine, the Teletype resides not on the standard address but on address 43/44

0003 7001   INC AC +1
0004 6446   Output char
0005 6441   if flag skip next
0006 5005   JMP 5
0007 5003   JPM 3

For the hightspeed serial card on adress 03/04 use the code below

0003 7001   INC AC +1
0004 6046   Output char
0005 6041   if flag skip next
0006 5005   JMP 5
0007 5003   JPM 3

Another test is from DEC PDP8/e Maintenance Vol. 1 Processor DEC-8E-HMM1a-D-D:

This echos back the caracters typed on a teletype or other serial terminal.

0000 6032   or 6432 for the high speed interface
0001 6031   or 6431 "
0002 5001
0003 6036   or 6436 "
0004 6046   or 6446 "
0005 6041   or 6441 "
0006 5005
0007 5001

code to dump the core of field 0 to a serial port

Bugblue version

There are some jumps because of faulty memory locations. that is why the start address is 176o. We know this program is highly inefficient and much nicer written if you do understand what you are doing. But as it grew we don't like to toggle the whole program again. Hence the very ugly jumps and hacks.

0175 170176	        *176                    /LOCATE PROGRAM STARTING AT ADDR 200
0176 7300	        CLA CLL                 /CLEAR ACCUMULATOR /CLEAR AC LINK
0177 7000	        NOP // bad memory
0200 3273	        DCA TMP1                /STORE THAT (0) IN TMP1
0201 7000	        NOP // bad memory
0202 7000	MAIN,   NOP
0203 1273	        TAD TMP1                // load TMP1
0204 4223	        JMS PRINTNUM            // print dit nummer
0205 7300	        CLA CLL
0206 1275	        TAD SPACE
0207 4263	        JMS TTYO                // output to tty0
0210 4307	        JMS LAAD                // LOAD data field (change)
0211 4223	        JMS PRINTNUM            // print dit nummer
0212 1273	        TAD TMP1                // load TMP1
0213 7001	        IAC                     // INCREMENT 1
0214 3273	        DCA TMP1 
0215 1277	        TAD CR
0216 4263	        JMS TTYO                // output to tty0
0217 7300	        CLA CLL
0220 1276	        TAD LF
0221 4263	        JMS TTYO                // output to tty0
0222 5202	        JMP MAIN                // tada.wav
0223 7000	PRINTNUM, NOP
0224 3274	        DCA TMP3                // store this in tmp3
0225 1274	        TAD TMP3                // get it.
0226 7010	        RAR
0227 7012	        RTR
0230 7012	        RTR
0231 7012	        RTR
0232 4302	        JMS STUK
0233 7000	        NOP
0234 7000	HEEL,   NOP
0235 7300	        CLA CLL                 // clear AC
0236 1274	        TAD TMP3                // load TMP3
0237 7012	        RTR
0240 7012	        RTR
0241 7012	        RTR             // 6 bitwise shift
0242 4257	        JMS PLUS                // xor met 0070
0243 4263	        JMS TTYO                // output to tty0
0244 7300	        CLA CLL                 // clear AC
0245 1274	        TAD TMP3                // load TMP3
0246 7010	        RAR
0247 7012	        RTR                 // 3 bitwise shift
0250 4257	        JMS PLUS                // xor met 0070
0251 4263	        JMS TTYO                // output to tty0
0252 7300	        CLA CLL                 // clear AC
0253 1274	        TAD TMP3                // load TMP3
0254 4257	        JMS PLUS                // xor met 0070
0255 4263	        JMS TTYO                // output to tty0
0256 5623	        JMP I PRINTNUM
0257 7000	PLUS,   NOP
0260 0300		AND	AND7
0261 1272	        TAD     PLUS60
0262 5657	        JMP   I  PLUS
0263 7000	TTYO,   NOP                     /TTY OUTPUT ROUTINE. THE FIRST WORD OF
0264 6446	        6446                    /WRITE AC TO THE OUTPUT DEVICE (TTY)
0265 6441	        6441                    /IF TTY IS READY, SKIP NEXT INSTRUCTION.
0266 5265	        JMP .-1                 /TTY IS NOT READY, SO CHECK AGAIN
0267 7200	        CLA                     /CLEAR AC
0270 7000	        NOP // Memory broken
0271 5663	        JMP I TTYO              /RETURN TO CALLER
0272 0060	PLUS60, 60
0273 0000	TMP1,   0
0274 0000	TMP3,   0
0275 0040	SPACE,  40
0276 0012	LF,     12
0277 0015	CR,     15
0300 0007	AND7,   7
0301 7000	        NOP // Memory broken
0302 7000	STUK, NOP
0303 7012	        RTR             // 9 bitwise shift
0304 4257	        JMS PLUS                // xor met 0070
0305 4263	        JMS TTYO                // output to tty0
0306 5234	JMP HEEL
0307 7000	LAAD, NOP
0310 1273	        TAD TMP1
0311 1001	        TAD 1
0312 7450	        SNA
0313 7402	        HLT
0314 6211	        6201 10                 // CDF 10
0315 1673	        TAD I TMP1              // indirect laden van TMP1
0316 6210	        6210  0                 // CDF 0
0317 5707	        JMP I LAAD
	$

Rick Murphy version

Here's a dump program. It'll dump a field from (by default) location 0 to 7777. This is set up to dump field 1; change the CDF at location 206 to whatever field you want (CDF 20 is 6221; CDF 30 is 6231, etc.) Starting location is in PTR at 0221.

Note that OS/8 usually outputs ASCII with mark parity. That will confuse most modern systems. This code outputs with space parity. Tested on SIMH. Updates to avoid bad memory locations need to be made, of course.

        0200                 *200             //start address
000200  1221         LOOP,   TAD     PTR     // Get the address
000201  4226                 JMS     PRINT   // Print the address
000202  1222                 TAD     COLON   // Output a space after the address

000203  4255                 JMS     TTYO
000204  1223                 TAD     SPACE
000205  4255                 JMS     TTYO
000206  6211                 CDF     10      // Field 1
000207  1621                 TAD I   PTR     // Get the value
000210  6201                 CDF     0       // Restore field
000211  4226                 JMS     PRINT   // Print it
000212  1224                 TAD     CR
000213  4255                 JMS     TTYO
000214  1225                 TAD     LF
000215  4255                 JMS     TTYO
000216  2221                 ISZ     PTR     // Bump the pointer
000217  5200                 JMP     LOOP
000220  7402                 HLT             // Done

000221  0000         PTR,    0               // Start address
000222  0072         COLON,  ":
000223  0040         SPACE,  "
000224  0015         CR,     15              // Octal CR value[B
000225  0012         LF,     12

000226  0000         PRINT,  .-.             // Print a word
000227  3252                 DCA     SAVE    // Word being printed - address or value
000230  1252                 TAD     SAVE
000231  7104                 CLL RAL         // Push one bit into the Link
000232  3252                 DCA     SAVE
000233  4240                 JMS     TTYNUM  // Print one octal digit at a time
000234  4240                 JMS     TTYNUM
000235  4240                 JMS     TTYNUM
000236  4240                 JMS     TTYNUM
000237  5626                 JMP I   PRINT

000240  0000         TTYNUM, .-.
000241  1252                 TAD     SAVE
000242  7004                 RAL
000243  7006                 RTL             // High order digit to low order word
000244  3252                 DCA     SAVE    // Save state
000245  1252                 TAD     SAVE
000246  0253                 AND     SEVEN
000247  1254                 TAD     ZERO
000250  4255                 JMS     TTYO
000251  5640                 JMP I   TTYNUM
000252  0000         SAVE,   0
000253  0007         SEVEN,  7
000254  0060         ZERO,   "0

000255  0000         TTYO,   .-.
000256  6046                 6046
000257  6041                 6041
000260  5257                 JMP     .-1
000261  7200                 CLA
000262  5655                 JMP I   TTYO