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