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.
> 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.
NORMALLY, in order to avoid problems, I use the code:
001000 112737 000110 177566 MovB #110, @#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 @#XBUF instead of just XBUF.
--
Pete Peter Turnbull
Network Manager
University of York