home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / folklore / computer / 16349 < prev    next >
Encoding:
Text File  |  1992-11-17  |  7.0 KB  |  135 lines

  1. Path: sparky!uunet!caen!zaphod.mps.ohio-state.edu!cs.utexas.edu!gateway
  2. From: Shawn_E_Switenky@engr.usask.ca (Shawn E Switenky)
  3. Newsgroups: alt.folklore.computers
  4. Subject: PDP-11 Program - Please help me!
  5. Date: 17 Nov 1992 21:18:33 -0600
  6. Organization: UTexas Mail-to-News Gateway
  7. Lines: 123
  8. Sender: daemon@cs.utexas.edu
  9. Message-ID: <9211180313.AA10527@skul.USask.CA>
  10. NNTP-Posting-Host: cs.utexas.edu
  11.  
  12. Hi All,
  13.  
  14. I've got a strange problem.  For an upcoming demonstration by our local DEC 
  15. people of their new Alpha machines, they borrowed a PDP-11/20 for the display,   
  16. so the could say something like, 'Remember how easy it was going from the
  17. PDP-11 to the VAX?  Well it will be even easier to go from VAX to ALPHA!'
  18.  
  19. I managed to get a working PDP-11/20, but it only has 4K of core and no  
  20. I/O devices except for the console.  I sat down and wrote a short program 
  21. which would have one light move back and forth on the display.  A scanning 
  22. eyeball, like a Cylon Centurion or the KITT on the Knight Rider.
  23.  
  24. I don't have any kind of software for me to generate programs with.  So
  25. I had to assemble my code to machine code myself.  Now, I have never done
  26. this before, but I figured how hard could it be?  Well once I figured out 
  27. the numbers and entered it into the PDP's memory from the front console
  28. switches, I loaded in the start address and pushed start.  As with all 
  29. first program runs, it performed nothing like I expected it to.  I wrote it 
  30. to run in an endless loop, but after about a second, the processor halts.
  31.  
  32. I love playing around with older computers, but aside from plugging in an
  33. occasional bootstrap, I've never had to resort to loading in a program this
  34. way.  Debugging this program has got me stumped.  I'm not familiar with 
  35. using the console to debug a program, only entering in programs.
  36.  
  37. I've got a feeling my problem lies in one or more of the following areas:
  38.         1) I've calculated my branch offsets incorrectly.
  39.         2) I've got an addressing mode coded in binary incorrectly.
  40.         3) I can't just plug something into the display register this way.
  41.         4) I've got JMP figured out wrong.
  42.         5) Something like a stack hides out in the same area as my program.
  43.         6) I'm forgetting something obvious.
  44.                                             
  45. So what I need to ask of someone is to help me debug my program.  If anyone can
  46. run some macro assembler and generate a binary image, I would sure appreciate
  47. the help.  If anyone sees any problems with following code or implementation, 
  48. again please let me know.  The Alpha presentation is this Friday, Nov. 20,
  49. so I am also in a hurry.  Thanks in advance!
  50.  
  51. Here's my code:
  52.  
  53.         START:  MOV #1, R0              ; R0 holds eyeball value
  54.                 MOV #177570, R1         ; R1 holds the address of the console 
  55.                                         ; display register
  56.                 MOV #10000, R2          ; R2 holds the delay value
  57.                 MOV R2, R3              ; R3 is the counter for the delay
  58.                 MOV START, R4           ; R4 holds the address for LEFT label
  59.         
  60.         LEFT:   MOV R0, (R1)            ; Move the contents of R0 to the console 
  61.                                         ; display register
  62.                 ROL R0                  ; Rotate Right the value in R0
  63.         LCOUNT: DEC R3                  ; Decrement the counter 
  64.                 BNE LCOUNT              ; Loop if the counter value is not zero
  65.                 MOV R2, R3              ; Reset counter
  66.                 BCC LEFT                ; If the EYEBALL bit is not in Carry, 
  67.                                         ; the branch to LEFT
  68.  
  69.         RIGHT:  ROR R0                  ; Rotate Left the value in R0
  70.                 MOV R0, (R1)            ; Move the contents of R0 to the console
  71.                                         ; display register
  72.         RCOUNT: DEC R3                  ; Decrement the counter  
  73.                 BNE RCOUNT              ; Loop if the counter value is not zero
  74.                 MOV R2, R3              ; Reset counter
  75.                 BCC RIGHT               ; If the EYEBALL bit is not in Carry, 
  76.                                         ; the branch to RIGHT
  77.  
  78.                 JMP LEFT                ; Start all over again
  79.  
  80. The value of START is 1000 binary.  Here is my binary version of the above 
  81. program:
  82.                                      OCTAL          MSB - BIT POSITION - LSB
  83.                                     _______             ________________
  84.                                                         1111110000000000
  85.                                                         5432109876543210
  86.                                                         ________________
  87.         START:  MOV #1, R0           012700             0001010111000000                  
  88.                                      000001             0000000000000001                                                        
  89.                                                         
  90.                 MOV #177570, R1      012701             0001010111000001
  91.                                      177570             1111111101111000
  92.                                         
  93.                 MOV #10000, R2       012702             0001010111000010
  94.                                      010000             0001000000000000
  95.  
  96.                 MOV R2, R3           010203             0001000010000011
  97.  
  98.                 MOV START, R4        012704             0001010111000100
  99.                                      000010             0000000000001000
  100.         
  101.         LEFT:   MOV R0, (R1)         010011             0001000000001001
  102.                                         
  103.                 ROL R0               006100             0000110001000000
  104.  
  105.         LCOUNT: DEC R3               005303             0000101011000011
  106.  
  107.                 BNE LCOUNT           001373             0000001011111011
  108.  
  109.                 MOV R2, R3           010203             0001000010000011
  110.  
  111.                 BCC LEFT             103767             1000011111110111
  112.                                                                         
  113.         RIGHT:  ROR R0               006000             0000110000000000
  114.  
  115.                 MOV R0, (R1)         010011             0001000000001001
  116.                                         
  117.         RCOUNT: DEC R3               005303             0000101011000011
  118.  
  119.                 BNE RCOUNT           001373             0000001011111011
  120.  
  121.                 MOV R2, R3           010203             0001000010000011
  122.  
  123.                 BCC RIGHT            103767             1000011111110111
  124.                                         
  125.  
  126.                 JMP LEFT             000104             0000000001000100
  127.  
  128.  
  129. +------------------------------------------+--------------------------------+
  130. | Shawn E. Switenky                        |                                |
  131. | Internet: Shawn_E_Switenky@engr.usask.ca | Real Computers Use Kilowatts!  |
  132. | Compu$erve: 72460, 2604                  |                                |
  133. +------------------------------------------+--------------------------------+
  134. 
  135.