Article View: comp.arch
Article #12877Bit operations on 68K
From: alexande
Date: Thu, 22 Jan 1987 17:38
Date: Thu, 22 Jan 1987 17:38
29 lines
1846 bytes
1846 bytes
In article <112@lmi-angel.UUCP> wsr@lmi-angel.UUCP (Wolfgang Rupprecht) writes:
>Look at the BSET, BCLR, BTST (bit set, clear and test) instructions.
>If you do a:
>
> BSET.L d0, somelocation
>
>with #31 in d0, you have set the MSB (byte 0!) of the long-word.
This is not completely correct. There is no BSET.L instruction, only BSET.
It works on a destination that is either a 32-bit register, or a byte from
memory. Here is what the Motorola book says about BSET:
If a data register is the destination, then the bit numbering is
modulo 32, allowing bit manipulation on all bits in a data register.
If a memory location is the destination, a byte is read
from that location, the bit operation is performed using
the bit number modulo 8, and the byte written back to
the location with zero referring to the least-significant bit.
I didn't take the manual's word for it. I tried it on a Motorola VME/10.
>This is *LOW* endian.
Yes, as far as bit numbering goes. No, as far as byte numbering goes.
That's the inconsistency in the 68K architecture.
--
Mark Alexander ...{hplabs,ucbvax!decvax}!decwrl!pyramid!amdahl!drivax!alexande
"This then is my story. I have reread it. It has bits of marrow
sticking to it, and blood, and beautiful bright-green flies." --Nabokov
Technical Details
Message-ID:
<816@drivax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!ames!amdahl!drivax!alexandeReferences:
<760@orcisi.UUCP> <112@lmi-angel.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!ames!amdahl!drivax!alexande From: alexande@drivax.UUCP Newsgroups: comp.arch,comp.sys.m68k Subject: Bit operations on 68K Message-ID: <816@drivax.UUCP> Date: Thu, 22-Jan-87 12:38:24 EST Article-I.D.: drivax.816 Posted: Thu Jan 22 12:38:24 1987 Date-Received: Mon, 26-Jan-87 01:48:04 EST References: <760@orcisi.UUCP> <112@lmi-angel.UUCP> Reply-To: alexande@drivax.UUCP (Mark Alexander) Organization: Kludges 'R' Us, Inc. Lines: 29