# convert hex to decimal - ala IBM Maniframe Assembly Language

Dan McGarigle dmcgarigle at socal.rr.com
Sun Jun 24 09:43:02 CEST 2007

```In re: http://mail.python.org/pipermail/python-list/2006-March/371757.html

Dear Peter Maas

The Intel 80xxx architecture is horrible when compared to an IBM S/360, or
S/370, or S/390 or Z machines.

IBM mainframes performance is measured in Millions Of Instructions executed
per second, and not on some clock speed,

But rather, how many millions of completed instructions are executed in
1-second. Numbers like 428 are common MIPS rates.

That's 428,000,000 instructions completed by the CPU per second. I can't
relate to how many instructions get executed per second on a 2.8Ghz CPU
because I can't find out how many cycles each Intel instruction takes..

I really don't care how fast a clock goes. I care about how many
instructions are executed per second.

As for converting a number from Hex to Decimal we do it this way, with one
(1) CVD instruction, on IBM mainframes.

START 0                                    Tell the
assembler to start this program at relative location zero ( 0 ).

HEX2DEC BALR  6,0                                  Start the program
USING *,6                                 Tell the assembler to use Register
6 as the base of this program

B         Step01                           Branch to Step01
to get started

Hexword   DS   F                                        Define a storage
area of a 4-byte word.

Outarea    DS   PL8                                     Define a storage
area for an 8-byte packed decimal number, max = 999,999,999,999,999

* This is a comment
i.e. 999 trillion, 999 billion, 999 million, 999 thousand, 999 ones.

Visible      DS   CL15                                   Define a storage
area for a 15-byte displayable characters area.

Step01   EQU   *

L         R5,Hexword                         Put the 4-byte
hexadecimal number into General Purpose Register 5.

CVD    R5, Outarea                         Tell the CPU to
convert the 4-byte number into a 15 digit signed number in displayable
characters

UNPK  Visible(15),Outarea(8)           Make the 15-digit number
displayable

OI        Visible+14,X'F0"                  Correct the sign of
the last digit.

operating system

END                                               Define the
end of the program to the assembler

Of course you didn't need to know any of this, except that I am sick of
hearing how "great" the Intel architecture is.

Phooey !

IBM had INTEL beat into the ground in 1967, (way before the 8088 existed)
and has not looked back since.

Thanks for accepting a rant from a stranger.

Dan McGarigle   ( 36 years an IBM mainframe programmer and proud of it,
thank you ! )

El Segundo, CA

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070624/b7d9f0b2/attachment.html>
```