home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / misc / 1005 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  3.2 KB

  1. Xref: sparky comp.os.misc:1005 comp.os.vms:20413
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!rutgers!cmcl2!rlgsc.com!gezelter
  3. From: gezelter@rlgsc.com
  4. Newsgroups: comp.os.misc,comp.os.vms
  5. Subject: Re: Help on RT-11 macro languagereply
  6. Message-ID: <1993Jan5.093033.305@rlgsc.com>
  7. Date: 5 Jan 93 14:30:33 GMT
  8. References: <93Jan04.223305.29354@acs.ucalgary.ca>
  9. Organization: Robert Gezelter Software Consultant, Flushing, NY
  10. Lines: 71
  11.  
  12. In article <93Jan04.223305.29354@acs.ucalgary.ca>, morrow@cns.ucalgary.ca (Bill Morrow) writes:
  13. > Hello all you old fellows,
  14. > I have been forced to update some of the PDP-11 assembler acquisition
  15. > software running on our old RT-11 system. Of course,
  16. > there are no comments in the source, to save on disk space.
  17. > A week ago, I knew absolutely nothing about PDP-11 macro language.
  18. > I have been wading through the "Orange Wall", but
  19. > I'm a bit confused by the unconditional branch instruction -
  20. > where does this code end up after the 'BR 10$+2' step?
  21. > DR3INT: 0
  22. >     BR    10$+2        <--- branch to where ?
  23. >     BR    20$+2
  24. > 10$:    MOV    #107,DMACSR
  25. >     TST    ADCO        <--- here ?
  26. >     BEQ    11$
  27. >     MOV    #113,KWREG
  28. > 11$:    MOV    DR3INT+4,DR3INT
  29. >     TR            <--- or here ?
  30. > 12$:    et cetera ad nauseum
  31. > My intuitive guess is that it ends up at 'TST ADCO',
  32. > but the manual seems to be telling me it branches to
  33. > the indicated address.
  34. > While you're here, does the 'MOV' instruction at 11$ really move
  35. > the label 'DR3INT' to the same address as 10$? Why is the 
  36. > 'BR 20$+2' there then?
  37. > What does 'TR' do? I can't find it in the instruction set
  38. > or the macro language reference manual.
  39. > Thanks for the help.
  40. > -- 
  41. > __________________________________________________________
  42. > Bill Morrow                    voice: (403) 220-6275
  43. > Clinical Neurosciences         fax: (403) 283-4740
  44. > University of Calgary          e-mail: morrow@cns.ucalgary.ca
  45. -- 
  46. Bill,
  47.  
  48. It appears that you have encountered a bit of a "curse", self 
  49. modifying code.
  50.  
  51. First, the MOV located at 10$ will assemble into a three word (6 
  52. byte) sequence, so the BR 10$+2 would branch into the middle of 
  53. an instruction. However, from the code fragment that you 
  54. included, it would appear that those branch instructions are 
  55. being used as "sources" for the move instruction.
  56.  
  57. The instruction:
  58. > 11$:    MOV    DR3INT+4,DR3INT
  59. moves the CONTENTS of DR3INT+4 (which I believe is the assembled 
  60. value of BR 20$+2) to location DR3INT (which is the word set to 
  61. 0).
  62.  
  63. In general, it is important to read this type of code in extreme 
  64. detail, as things are often not what they seem.
  65.  
  66. I hope that this information is helpful. If I can be of further 
  67. assistance, please feel free to contact me.
  68.  
  69. - Bob
  70. +--------------------------------------------------------------------------+
  71. | Robert "Bob" Gezelter                       E-Mail:  gezelter@rlgsc.com  |
  72. | Robert Gezelter Software Consultant         Voice:   +1 718 463 1079     |
  73. | 35-20 167th Street, Suite 215               Fax:       (on Request)      |
  74. | Flushing, New York  11358-1731                                           |
  75. | United States of America                                                 |
  76. +--------------------------------------------------------------------------+
  77.