home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky vmsnet.pdp-11:916 comp.os.vms:20365
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!uvaarpa!concert!ais.com!bruce
- From: bruce@ais.com (Bruce C. Wright)
- Newsgroups: vmsnet.pdp-11,comp.os.vms
- Subject: Re: Help on RT-11 macro language
- Message-ID: <1993Jan5.113727.5928@ais.com>
- Date: 5 Jan 93 11:37:27 GMT
- References: <93Jan04.223305.29354@acs.ucalgary.ca> <1993Jan5.020012.13695@news.acns.nwu.edu>
- Followup-To: vmsnet.pdp-11
- Organization: Applied Information Systems, Chapel Hill, NC
- Lines: 67
-
- In article <1993Jan5.020012.13695@news.acns.nwu.edu>, jweiss@casbah.acns.nwu.edu (Jerry Weiss) writes:
- > 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.
-
- This almost _ALWAYS_ comes back to bite you eventually :-(.
-
- >>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
- >>
- >
- > This is definitely brain damaged Macro-11 from where I sit, but I won't make
- > any claims to be a Macro-11 guru. There's not enough to make a complete
- > diagnosis, but here is a try.
-
- A couple of comments. The original author (not Jerry) appeared to have
- the incorrect idea that PDP-11 MACRO arguments moved from right to left,
- like the 80x86 or IBM-360 assemblers. In fact the arguments move from
- left to right, like VAX arguments, so that in the line at 11$, DR3INT is
- the _target_ of the move, not the source.
-
- Offhand this looks like it's probably a fragment from an interrupt
- service routine for a device driver. The MOV #107,DMACSR is particularly
- suspicious - the mnemonic sounds like it's for a device control register,
- and the 100 would be for enabling interrupts on the device. I don't know
- what the 7 would be; it would depend on the device (most devices enable
- interrupts with the 100-bit and signal completion with the 200-bit, but
- other bits vary with the device). Note that all the numbers are given in
- _octal_ unless there's a decimal point after them (unlike VAX, IBM-360,
- and Intel 80x86 assemblers). So 100 (octal) = 40 (hex) = 64 (decimal).
-
- I agree with Jerry, though, this is rather unclean code. I can't add
- much to most of the rest of Jerry's comments.
-
- >>What does 'TR' do? I can't find it in the instruction set
- >>or the macro language reference manual.
- >
- > Got me, perhaps its a defined macro. Check the macro or source librarys.
-
- Another possibility is that it's a word with the value `TR' in it. Look
- for anything in the source that looks like:
-
- TR = 403 ; 403 is the PDP-11 opcode
- ; for BR .+10 (OCTAL)
-
- or anything else like that; that would put the value `TR' into the
- program.
-
- Good luck (you may need it),
-
- Bruce C. Wright
-