MACRO-11 help

From: Jerome H. Fine <jhfinepw4z_at_compsys.to>
Date: Mon Sep 16 21:16:01 2002

>Pete Turnbull wrote:

> > On Sep 16, 19:47, Jerome H. Fine wrote:
> > >Patrick Finnegan wrote:
> > > I'm trying to get some assembly code to run on my 11/23 by entering it in
>
> > > at the ODT, and it seems like I'm having trouble with device I/O
> > > addresses.
> > > Below is a listing of the assembled code I'm trying - I got the I/O
> > > address out of a PDP-11 assembly programming book I got from the library.
>
> > > Most likely the book was written with a UNIBUS -11 in mind, not a QBUS
> > > one... is that a problem?
> No, the console address is the same on all -11s. It's not the address, but
> the addressing mode you've used.

Jerome Fine replies:

I agree! I should have answered this as well.

> > > 7 001000 012767 000110 177566' MOV #110,XBUF
> > Jerome Fine replies:
> > I see the string 177564' for XSR and 177566' for XBUF, but the
> > listing does not have the actual value. Depending on the translation, that
>
> > could be the problem.

By translation, I meant what MACRO-11 places in the OBJ file as
opposed to what Patrick used when he entered 177566' by hand
using ODT - notice that the ' character makes 177566' VERY
different from just 177566 by itself - which is what happens when
_at_#XBUF is used instead of XBUF by itself.

> > NORMALLY, in order to avoid problems, I use the code:
> > 001000 112737 000110 177566 MovB #110, _at_#XBUF
> > which forces the output to 177566 no matter what address is used for the
> > instruction. Note that I also output ONLY a byte.
> Pat is using PC-relative addressing -- probably inadvertantly. The 67 in
> that opcode 012767 means mode 6, PC-relative, so the address actually used
> is the address of the instruction word, plus 4 (for the increment of the
> PC), plus the value given. It's like an indexed address, but using the PC
> as the index register, and it'll be 1010 bytes off. As Jerome points out,
> the correct way is to specify an absolute address, address mode 3, by
> typing _at_#XBUF instead of just XBUF.

I understand your answer. Under normal situations (when MACRO-11
source is translated and the actual code is placed into an OBJ file which
is then LINKed), both ways are acceptable. BUT, Patrick was setting up
the program via ODT (see line four). If Patrick did not realize what the '
character in the string 177566' meant, perhaps he just put 177566 instead
so that the three word instruction became:
001000 Mov #110,XBUF 012767 000110 177566
which, of course, is NOT what Patrick intended. However
001000 MovB #110,_at_#XBUF 112737 000110 177566
is correct and does the job.

So it is not that the first method is incorrect, but for some it might be
confusing.

My personal opinion is that the MACRO-11 program should make the
situation plain, but unfortunately I suspect that MACRO-11 will never
be modified by the present owners.

Sincerely yours,

Jerome Fine
--
If you attempted to send a reply and the original e-mail
address has been discontinued due a high volume of junk
e-mail, then the semi-permanent e-mail address can be
obtained by replacing the four characters preceding the
'at' with the four digits of the current year.
Received on Mon Sep 16 2002 - 21:16:01 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:35:39 BST