View previous topic :: View next topic
|
Author |
Message |
praveensinha Warnings : 1 New User
Joined: 02 Oct 2009 Posts: 64 Location: Hyd
|
|
|
|
why condition codes are in even only like 4,8,12,16 ???any specific reason |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
not a requirement...
just a habit |
|
Back to top |
|
|
praveensinha Warnings : 1 New User
Joined: 02 Oct 2009 Posts: 64 Location: Hyd
|
|
|
|
not clear ...... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
IBM uses 4, 8, 12,etc to designate specific levels of problem with their compilers and utilities. What IBM does, many people copy. Since a code can be anything from 0 to 4095, there is no requirement to use even numbers (much less numbers divisible by 4). However, since IBM tends to be standard, a lot of people picked up the habit of using 4, 8, 12, etc and continue it through today. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Some systems i've worked on have a standard that locally developed code must use condition codes of 1000 and greater so the only times a cc of 4, 8, etc will occur is from an IBM (or other vendor) utility. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
4:8-12 PASSAGE from Bible says,
Quote: |
There was no end to his toil,
yet his eyes were not content with his wealth.
"For whom am I toiling," he asked,
"and why am I depriving myself of enjoyment?"
This too is meaningless—
a miserable business! |
Its so synonymous to what a Software professional is,
Maybe thats why IBM chose 4,8 & 12.
BTW, really nice observation to ask this question.
P.S. - No harm intended.
Regards, |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I think this was decided a long time ago, before I started on z/OS.
But I have seen some colleagues coding some kind of branch table. That is, 4, 8, 12, 16, etc... fall on fullword boundaries and could be used to pick something out of a previously setup table; for example, the address of an appropriate message. |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
Many times it was the offset of the next instruction. The return code from a subroutine was added to the return address to find the next instruction, so it needed to be on a fullword boundary. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Wow. I didn't realize that so many people would know this bit of trivia originated with branch tables, let alone how to code one. Bravo. Have an extra beer (or Metamucil) on me |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
As I recall, reg 15 contained the RC and was used to increment a Branch instr to a branch table [B BRTBL(R15)] that, in turn, contained 4 byte branch instrs to processing routines, e.g. B RC00RTN, B RC04RTN, B RC08RTN, etc.
Don't recall the Assembler coding format at all anymore - it's been a while. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Something like:
Code: |
B *+4(R15) BRANCH DEPENDING ON RETURN CODE
B ITSZERO 00 - OK, CONTINUE
B ITS04 04 - DO THE 4 STUFF
B ITS08 08 - DO THE 8 STUFF
B ITS12 12 - DO THE 12 STUFF |
Yup, it has been a while
Nope, didn't assemble it. . .
Of course if R15 has some other value, it could get "entertaining". . . |
|
Back to top |
|
|
|