Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: jeuck@unix.SRI.COM (Philip Jeuck)
Subject: Re: PDP-11 movb instruction
Date: 30 Jun 89 15:51:42 GMT	[thread overview]
Message-ID: <597@unix.SRI.COM> (raw)
In-Reply-To: 3054@rti.UUCP

In article <3054@rti.UUCP> bcw@rti.UUCP (Bruce Wright) writes:
>In article <377@mountn.dec.com>, coburn@clo.dec.com (John T. Coburn) writes:
>> In article <2592@blake.acs.washington.edu>, erf@blake.acs.washington.edu (John Firestone) writes...
>> >If a MOVB instruction writes the low byte of a word-oriented device
>> >register, what does the high byte get set to?
>> 
>> The high byte would be unchanged if the device register allows byte access. 
>> Otherwise the result would be undefined.
>
>I think officially this is true - but in practice, essentially all 
>implementations of the PDP-11 architecture will sign extend the byte to 
>either all 0's or all 1's depending on the setting of bit 7.
>
>						Bruce C. WrighT

From the PDP11 Processor Handbook (digital 1981 - I know it's a little
old but so am I):

"MOVB - same as MOV. The MOVB to a register (unique among byte
instructions) extends the most significant bit of the low-order byte
(sign extension) into the high byte of the selected register.
Otherwise, MOVB operates on bytes exactly as MOV operates on words."

From my experience, MOVB does not sign extend on memory or I/O
addresses; it does when the destinantion is a register (as the quote
states).  Only some warped I/O implementations from nonDEC vendors
would require special precautions.

Phil Jeuck
jeuck@unix.sri.com


  reply	other threads:[~1989-06-30 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-06-29  1:59 PDP-11 movb instruction John T. Coburn
1989-06-30  2:15 ` Bruce Wright
1989-06-30 15:51   ` Philip Jeuck [this message]
1989-07-02  4:41     ` Bruce Wright
  -- strict thread matches above, loose matches on Subject: below --
1989-06-28 22:06 John Firestone
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox