Re: A92: learning assembly - real simple question
[Prev][Next][Index][Thread]
Re: A92: learning assembly - real simple question
At 17:19 1998-07-29 -0400, you wrote:
>
>In a message dated 7/29/98 4:58:27 PM Eastern Daylight Time,
>ADAMMAN106@aol.com writes:
>
>> sorry, but I don't know any 68K. but say D1 (which I'll assume for the
>> purposes of this is a longword (32 bit) register) was 0xFEDCBA98, then the
>> result of clr.w D1 would be FEDC0000
>> I couldn't tell you how to clear the upper word, sorry
>>
>> ~Adamman
>but having 8 bits (FEDCBA98 has 8 digits/characters) that would make it a
>byte, right?
>
No.
A bit is the smallest piece of information in a computer and can only take
on two vales: 0 or 1. In its position x one bit represents the value 2^x,
where x ranges from 0 to 31 for a longword. Now divide these bits into
groups of 8 and you have four bytes. If you divide the 32 bits into groups
of four you get a sequence of numbers that can have the values 0 (bits =
0000) to 15 (bits = 1111). This is called the hexadecimal system and is
written with the numbers 0-9 and the characters A-F to get an "alphabet" of
16 different characters.
It follows that a byte is represented by two digits, a word by four digits
and a longword by eight digits. So in the example above the digits FEDC are
the upper word and BA98 the lower.
(Note: I may have gone a tad (ok, a *lot*) overboard here, but I wanted to
make sure you understood. Please accept my apologies if I explained what
you already knew as obvious).
Niklas Brunlid - http://www.efd.lth.se/~e96nbr
PQF Quote follows:
Voodoo is a very interesting religion for the whole family, even those
members of it who are dead.
-- (Terry Pratchett & Neil Gaiman, Good Omens)
References: