For Programmers: Free Programming Magazines  


Home > Archive > ASM370 > December 2004 > bit order or byte order for asm370









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author bit order or byte order for asm370
Victor Zhang

2004-12-01, 8:55 am

Hello all,
ON mainframe world,how bit is numberred in a byte and how byte is
numberred in a word?
It seems the bit or byte is number from left to right,and left is the
most significant bit/byte, and when store a word in a memory location,
will high order of the byte be stored in low memory address or high
memory address?

In intel world,bit is numberred from right to left, and low byte of a
word is stored in high memory address, I think in mainframe world, it
is opposite,right?

Regards
Victor
Binyamin Dissen

2004-12-01, 8:55 am

On 1 Dec 2004 00:40:30 -0800 zsl263@263.sina.com (Victor Zhang) wrote:

:>ON mainframe world,how bit is numberred in a byte and how byte is
:>numberred in a word?

There is no absolute standard, but in general starting from the leftmost
(lowest address) bit or byte with zero.

:>It seems the bit or byte is number from left to right,and left is the
:>most significant bit/byte, and when store a word in a memory location,
:>will high order of the byte be stored in low memory address or high
:>memory address?

Low.

:>In intel world,bit is numberred from right to left, and low byte of a
:>word is stored in high memory address, I think in mainframe world, it
:>is opposite,right?

Not absolutely sure how stored by Intel.

--
Binyamin Dissen <bdissen@dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
Michel Castelein

2004-12-01, 3:56 pm


"Victor Zhang" <zsl263@263.sina.com> wrote in message
news:50b0b5bf.0412010040.400c27ad@posting.google.com...
> Hello all,
> ON mainframe world,how bit is numberred in a byte and how byte is
> numberred in a word?
> It seems the bit or byte is number from left to right,and left is the
> most significant bit/byte, and when store a word in a memory location,
> will high order of the byte be stored in low memory address or high
> memory address?
>
> In intel world,bit is numberred from right to left, and low byte of a
> word is stored in high memory address, I think in mainframe world, it
> is opposite,right?
>
> Regards
> Victor


In the mainframe world, bits and bytes are numbered from left to right,
starting with 0.
e.g. the 64-bit program status word (PSW) consists of bits 0-63.
BTW, the term PSW is confusing, it is actually a double word (2 x 32 bits).
1 byte = 8 bits; 1 word = 32 bits.

Mainframes (S/360, S/370, S/390, zSeries), Sun computers, most RISC
machines, etc. are "big-endians": for integers (i.e. fixed-point) and for
floating-point objects, the most significant byte is stored first.
Intel processors are "little-endians": the least significant byte is stored
first.

Hope this helps.

Michel
------------------------------------------------------------
Michel Castelein
MVS, OS/390, and z/OS System Engineer & Education Consultant
Home page http://www.geocities.com/michelcastelein/


Sven Pran

2004-12-01, 3:56 pm


"Victor Zhang" <zsl263@263.sina.com> wrote in message
news:50b0b5bf.0412010040.400c27ad@posting.google.com...
> Hello all,
> ON mainframe world,how bit is numberred in a byte and how byte is
> numberred in a word?
> It seems the bit or byte is number from left to right,and left is the
> most significant bit/byte, and when store a word in a memory location,
> will high order of the byte be stored in low memory address or high
> memory address?
>
> In intel world,bit is numberred from right to left, and low byte of a
> word is stored in high memory address, I think in mainframe world, it
> is opposite,right?


IBM addressing structure: The memory is composed of bytes each
8 bits wide, the bits within each byte are numbered left to right from
0 to 7 and bit 0 is the most significant bit.

The bytes are numbered left to right from 0 to the highest numbered
byte.

When addressing a group of bytes you always (except for one single
exception) refer to the byte in the group with the lowest byte address,
this byte will in general contain the most significant bits of an integer
variable or the leftmost character in a character string.

(The exception is the MVCIN instruction: "Move characters inverse").

Intel numbers both bits within each byte and the bytes themselves
from right to left so that the highest numbered bit will be the most
significant bit within a byte and the highest numbered byte will be the
most significant byte within a group. However, test strings are also
within Intel stored with the leftmost character in the lowest numbered
byte, and when displaying bytes it is always customary to show them
left to right with the lower numbered byte to the left.

Like for IBM a group of bytes with Intel is always referred to by the
address of the lowest numbered byte within the group. With Intel this
will be the least significant byte of an integer regardless of its size
but it will still be the leftmost character in a text string.

regards Sven



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com