Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

bit order or byte order for asm370
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

Report this thread to moderator Post Follow-up to this message
Old Post
Victor Zhang
12-01-04 01:55 PM


Re: bit order or byte order for asm370
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Binyamin Dissen
12-01-04 01:55 PM


Re: bit order or byte order for asm370
"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/



Report this thread to moderator Post Follow-up to this message
Old Post
Michel Castelein
12-01-04 08:56 PM


Re: bit order or byte order for asm370
"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




Report this thread to moderator Post Follow-up to this message
Old Post
Sven Pran
12-01-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASM370 archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:11 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.