home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / vmsnet / pdp11 / 916 next >
Encoding:
Internet Message Format  |  1993-01-05  |  3.2 KB

  1. Xref: sparky vmsnet.pdp-11:916 comp.os.vms:20365
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!uvaarpa!concert!ais.com!bruce
  3. From: bruce@ais.com (Bruce C. Wright)
  4. Newsgroups: vmsnet.pdp-11,comp.os.vms
  5. Subject: Re: Help on RT-11 macro language
  6. Message-ID: <1993Jan5.113727.5928@ais.com>
  7. Date: 5 Jan 93 11:37:27 GMT
  8. References: <93Jan04.223305.29354@acs.ucalgary.ca> <1993Jan5.020012.13695@news.acns.nwu.edu>
  9. Followup-To: vmsnet.pdp-11
  10. Organization: Applied Information Systems, Chapel Hill, NC
  11. Lines: 67
  12.  
  13. In article <1993Jan5.020012.13695@news.acns.nwu.edu>, jweiss@casbah.acns.nwu.edu (Jerry Weiss) writes:
  14. > In article <93Jan04.223305.29354@acs.ucalgary.ca> morrow@cns.ucalgary.ca (Bill Morrow) writes:
  15. >>Hello all you old fellows,
  16. >>
  17. >>I have been forced to update some of the PDP-11 assembler acquisition
  18. >>software running on our old RT-11 system. Of course,
  19. >>there are no comments in the source, to save on disk space.
  20.  
  21. This almost _ALWAYS_ comes back to bite you eventually :-(.
  22.  
  23. >>A week ago, I knew absolutely nothing about PDP-11 macro language.
  24. >>I have been wading through the "Orange Wall", but
  25. >>I'm a bit confused by the unconditional branch instruction -
  26. >>where does this code end up after the 'BR 10$+2' step?
  27. >>
  28. >>DR3INT: 0
  29. >>    BR    10$+2        <--- branch to where ?
  30. >>    BR    20$+2
  31. >>10$:    MOV    #107,DMACSR
  32. >>    TST    ADCO        <--- here ?
  33. >>    BEQ    11$
  34. >>    MOV    #113,KWREG
  35. >>11$:    MOV    DR3INT+4,DR3INT
  36. >>    TR            <--- or here ?
  37. >>12$:    et cetera ad nauseum
  38. >>
  39. > This is definitely brain damaged Macro-11 from where I sit, but I won't make
  40. > any claims to be a Macro-11 guru.  There's not enough to make a complete
  41. > diagnosis, but here is a try.
  42.  
  43. A couple of comments.  The original author (not Jerry) appeared to have
  44. the incorrect idea that PDP-11 MACRO arguments moved from right to left,
  45. like the 80x86 or IBM-360 assemblers.  In fact the arguments move from
  46. left to right, like VAX arguments, so that in the line at 11$, DR3INT is
  47. the _target_ of the move, not the source.
  48.  
  49. Offhand this looks like it's probably a fragment from an interrupt
  50. service routine for a device driver.  The MOV #107,DMACSR is particularly
  51. suspicious - the mnemonic sounds like it's for a device control register,
  52. and the 100 would be for enabling interrupts on the device.  I don't know
  53. what the 7 would be;  it would depend on the device (most devices enable
  54. interrupts with the 100-bit and signal completion with the 200-bit, but
  55. other bits vary with the device).  Note that all the numbers are given in
  56. _octal_ unless there's a decimal point after them (unlike VAX, IBM-360,
  57. and Intel 80x86 assemblers).  So 100 (octal) = 40 (hex) = 64 (decimal).
  58.  
  59. I agree with Jerry, though, this is rather unclean code.  I can't add
  60. much to most of the rest of Jerry's comments.
  61.  
  62. >>What does 'TR' do? I can't find it in the instruction set
  63. >>or the macro language reference manual.
  64. > Got me, perhaps its a defined macro.  Check the macro or source librarys.
  65.  
  66. Another possibility is that it's a word with the value `TR' in it.  Look
  67. for anything in the source that looks like:
  68.  
  69.     TR    =    403        ; 403 is the PDP-11 opcode
  70.                     ; for BR .+10 (OCTAL)
  71.  
  72. or anything else like that;  that would put the value `TR' into the
  73. program.
  74.  
  75. Good luck (you may need it),
  76.  
  77. Bruce C. Wright
  78.