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

  1. Xref: sparky comp.os.misc:1002 comp.os.vms:20358
  2. Newsgroups: comp.os.misc,comp.os.vms
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ncar!uchinews!rover.uchicago.edu!frank
  4. From: frank@rover.uchicago.edu (Frank - Hardware Hacker - Borger)
  5. Subject: Re: Help on RT-11 macro language
  6. Message-ID: <5JAN199310241704@rover.uchicago.edu>
  7. News-Software: VAX/VMS VNEWS 1.41    
  8. Keywords: RT-11, macro
  9. Sender: news@uchinews.uchicago.edu (News System)
  10. Reply-To: frank@rover.uchicago.edu
  11. Organization: Joint Center for Radiation Therapy
  12. References: <93Jan04.223305.29354@acs.ucalgary.ca>
  13. Date: Tue, 5 Jan 1993 16:24:00 GMT
  14. Lines: 62
  15.  
  16. In article <93Jan04.223305.29354@acs.ucalgary.ca>, morrow@cns.ucalgary.ca (Bill Morrow) writes...
  17. >Hello all you old fellows,
  18. >                 (plea for help here)
  19.  
  20. >DR3INT: 0
  21.  
  22.     from the naming convention, this looks like the entry point for
  23.     an ISR (Interrupt service routine.) It gets filled in later on by
  24.     code which moves one of the following 2 instructions into the
  25.     location DRINT3: n.b. this means that the code never executes the
  26.     following 2 instructions AT THEIR CURRENT LOCATION
  27.  
  28. >    BR    10$+2        <--- branch to where ?
  29. >    BR    20$+2
  30.  
  31.     One must know that a branch instruction contains the branch code in
  32.     the upper byte, plus a word offset in the lower byte. To get the new
  33.     pc, you do the following:
  34.  
  35.     1/ Take the absolute address of the branch instruction.
  36.     2/ Add 2, (because the pc is 2 higher after reading the instruction.
  37.     3/ Add 2 times the value of the lower byte.
  38.  
  39.     So as a result, the BR    10$+2 instruction, WHEN MOVED 2 bytes further
  40.     upstream, will branch to location 10$. (Catch on? The +2 is added to
  41.     the branch instruction 2 make up for the fact that the instruction
  42.     is being moved, but the assembler doesn't know it.)
  43.  
  44. >10$:    MOV    #107,DMACSR
  45. >    TST    ADCO        <--- here ?
  46. >    BEQ    11$
  47. >    MOV    #113,KWREG
  48. >11$:    MOV    DR3INT+4,DR3INT
  49. >    TR            <--- or here ?
  50. >12$:    et cetera ad nauseum
  51.     One other point, because we are moving DRINT+4 to DR3INT, the
  52.     final adjustment+4, -2 is off by 2, so the BR 20$+2 will eventually
  53.  
  54. >While you're here, does the 'MOV' instruction at 11$ really move
  55. >the label 'DR3INT' to the same address as 10$? Why is the 
  56. >'BR 20$+2' there then?
  57.  
  58.     MOVs are simple.    MOVE DR3INT+4 moves the CONTENTS of
  59.                 location DR3INT+4
  60.  
  61.                 MOV #nnn moves a number nnn to xxx
  62.  
  63. >What does 'TR' do? I can't find it in the instruction set
  64. >or the macro language reference manual.
  65.  
  66.     There should be code in the start of the source stating items
  67.     of the form    .MACRO    TR.
  68.  
  69.     Check your manual and you should be able to do a compile with
  70.     the listing expanding the macro, so you see what it actually does.
  71.    Frank R. Borger - Physicist    __       Internet:  Frank@rover.uchicago.edu
  72. Michael Reese - Univ. of Chicago |___      Phone : 312-791-8075 fax : 567-7455
  73.   Center for Radiation Therapy   | |_) _   
  74.                                    | \|_)  By the time we've made it, we've 
  75.     "Birthplace of Softball"          |_)  had it. - Malcom Forbes
  76.