Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!husc6!unix!jeuck From: jeuck@unix.SRI.COM (Philip Jeuck) Newsgroups: comp.sys.dec Subject: Re: PDP-11 movb instruction Summary: From the manual (oh no not real info) Message-ID: <597@unix.SRI.COM> Date: 30 Jun 89 15:51:42 GMT References: <377@mountn.dec.com> <3054@rti.UUCP> Reply-To: jeuck@unix.UUCP (Philip Jeuck) Organization: SRI International, Menlo Park, CA Lines: 30 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