Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CVD Assembler Instruction

85 views
Skip to first unread message

Axel Pieper

unread,
Aug 8, 2003, 2:45:52 AM8/8/03
to
Dave,
you could use a SLL R8,1
and then a SRL R8,1
to get the sign bit turned off


kind regards
Axel Pieper
VSE-Design,Development + Service
E-mail:PIE...@DE.IBM.COM


industrynews@daps
co.com To: "VSE Discussion List" <vs...@Lehigh.EDU>
Sent by: cc:
owner-vse-l@Lehig Subject: Re: CVD Assembler Instruction
h.EDU


07.08.2003 22:16
Please respond to
vse-l

Actually, I left out testing to see if the sign bit was on in the first
place (my macros):

IF R8,(MINUS,ICM,B'1111'),BINARY4
N R8,=X'7FFFFFFF' <===
CVD R8,PACKED8
AP PACKED8,=P'2147483648'
ELSE
CVD R8,PACKED8
ENDIF

but my real question is the instruction pointed at above.
Is there a better choice for turning off the sign bit?

Sincerely,

Dave Clark
dcl...@dapsco.com

DAPSCO Information Systems
3110 Kettering Boulevard
Dayton, Ohio 45439
(937) 294-5331

The Family

unread,
Aug 8, 2003, 5:04:21 AM8/8/03
to
If you see this post, better call security, I'm not authorized
to post to VSE-L.

OK, so tell me why this won't work....

"overlooking any/all syntax, this is just quasi pseudo"


LA 1,2(,0) divisor
L 2,="data" dividend
SRDL 2,32(0) prepare dividend
DR 2,1 dividend/divisor
CVD 1,divisor format divisor
CVD 2,remainder format remainder
CVD 3,dividend format dividend
MP dividend,divisor dividend*divisor
AP dividend,remainder join remainder
UNPK "somewhere",dividend prepare result

Thanks - Gary


"Axel Pieper" <PIE...@de.ibm.com> wrote in message
news:OF57F2FE42.36D3AAAC...@de.ibm.com...

indust...@dapsco.com

unread,
Aug 8, 2003, 11:11:25 AM8/8/03
to

> you could use a SLL R8,1
> and then a SRL R8,1

Axel,

I thought of that, but I wasn't sure if using two instructions (and 8 bytes
of program storage) was better than using the single N instruction (and 4
bytes of program storage). I don't know much about cycle times, so you
would have to tell me. ;-)

indust...@dapsco.com

unread,
Aug 8, 2003, 11:11:32 AM8/8/03
to

Oops, the single N instruction would also use 8 bytes of program
storage (the additional four bytes are to store the hex constant). So,
storage is the same... ...don't know about cycle times. ;-)

Tony Thigpen

unread,
Aug 8, 2003, 11:16:51 AM8/8/03
to
One accesses memory (which may be in paged-out storage), the other only the
register.
Which do you think would be faster?

Tony Thigpen.
Thigpen Enterprises, Inc.
Developers of VSE2PDF
http://www.vse2pdf.com


-----Original Message-----
From: owner...@Lehigh.EDU [mailto:owner...@Lehigh.EDU]On Behalf Of
indust...@dapsco.com
Sent: Friday, August 08, 2003 11:13 AM
To: VSE Discussion List
Subject: Re: CVD Assembler Instruction

indust...@dapsco.com

unread,
Aug 8, 2003, 1:22:25 PM8/8/03
to

Axel,

Ok, my last guess on this subject... I've thought it through and I
think the two shift instructions would be more efficient because there
would be no additional data fetch involved. The single N instruction must
fetch the four bytes of data in order to process the AND. So, thanks for
helping me to think it through. ;-)

indust...@dapsco.com

unread,
Aug 8, 2003, 1:22:25 PM8/8/03
to

> One accesses memory (which may be in paged-out storage),
> the other only the register.

Yep, thought of that afterwards. Thanks, Tony.

Axel Pieper

unread,
Aug 9, 2003, 7:09:28 AM8/9/03
to
Hi Dave,
I do it the same way, for exactly that reason.
I you are running in 31-bit mode, you could of
course have used a <LA R8,0(,R8)> instead.

lan...@listperfect.com

unread,
Aug 11, 2003, 10:00:30 AM8/11/03
to

The optimal way to accomplish what you want:

LR R8,BINARY4
LPR R8,R8
CVD R8,PACKED8

============================================================


-----Original Message-----
From: owner...@Lehigh.EDU [mailto:owner...@Lehigh.EDU]On Behalf Of
indust...@dapsco.com
Sent: Thursday, August 07, 2003 3:51 PM
To: VSE Discussion List
Subject: Re: CVD Assembler Instruction


For my own knowledge... Did I get this right?

LR R8,BINARY4
N R8,=X'7FFFFFFF'


CVD R8,PACKED8
AP PACKED8,=P'2147483648'

Is there a better instruction choice?

Sincerely,

Dave Clark
dcl...@dapsco.com

DAPSCO Information Systems
3110 Kettering Boulevard
Dayton, Ohio 45439
(937) 294-5331

-------------------------------------------------------------------------
This E-mail was scanned for viruses by HF MailScan


-------------------------------------------------------------------------
This E-mail was scanned for viruses by HF MailScan

John Mycroft

unread,
Aug 11, 2003, 10:31:12 AM8/11/03
to
Nope

The LPR will load the positive version of R8 into R8. So, if R8
contains FFFFFFFF, the LPR will change it to 1, not to 7FFFFFFF. Not at
all what was wanted!

For my money, I'd go for the SLL & SRL any old day.

Cheers - John Mycroft
jo...@agands.com
www.agands.com

lan...@listperfect.com

unread,
Aug 11, 2003, 11:27:28 AM8/11/03
to
Then I really misunderstood his problem. I was under
the impression he wanted the absolute value of the
two's complement number he was loading into R8.
Instead, he is looking for the absolute value of a
negative number in true form (as was employed on
the 709X machines 40+ years ago). To get the true
form value, he should use either:


LR R8,BINARY4
N R8,=XL4'7FFFFFFF'
CVD R8,PACKED8
or

LR R8,BINARY4
SLL R8,1
SRL R8,1
CVD R8,PACKED8

I am curious. What is the origin of this value?

==================================================


Nope

Sincerely,

Dave Clark
dcl...@dapsco.com

-------------------------------------------------------------------------

indust...@dapsco.com

unread,
Aug 11, 2003, 11:37:20 AM8/11/03
to

> I am curious. What is the origin of this value?

Lance,

I can't answer for the original question, but I can tell you that IBM
sometimes uses 32-bit (unsigned) binary numbers internally (for example, in
the VSAM Catalog statistics). I have been able to handle these in COBOL
easily enough -- by moving four bytes from the catalog record to the last
four bytes of an eight-byte redefined storage area.

I haven't done it before, so I'll ask... How well does assembler
handle conversion of a binary double-word to a packed-decimal number?

John Mycroft

unread,
Aug 11, 2003, 12:02:50 PM8/11/03
to
I'm going to regret this but here's my prod at a complete answer.

Either

L R8,BINARY4
SLA R8,1 Sets the cond code to 1 if there is a
top bit
SRL R8,1
CVD R8,PACKED8
BNO DONE If no overflow, we're done
AP PACKED8,=P'2147483648'
DONE DS 0H

I've always said that people who set the condition code and then don't
test it until several instructions later are asking for trouble but what
the heck.

Option 2
SLR R8,R8
L R9,BINARY4
CVDG R8,PACKED16

Don't ya love those 64 bit instructions?

John Ford

unread,
Aug 11, 2003, 12:11:36 PM8/11/03
to
----- Original Message -----
From: <indust...@dapsco.com>
To: "VSE Discussion List" <vs...@Lehigh.EDU>
Sent: Monday, August 11, 2003 10:35 AM
Subject: RE: CVD Assembler Instruction


>


> > I am curious. What is the origin of this value?
>
> Lance,
>
> I can't answer for the original question, but I can tell you
that IBM
> sometimes uses 32-bit (unsigned) binary numbers internally (for
example, in
> the VSAM Catalog statistics). I have been able to handle these in
COBOL
> easily enough -- by moving four bytes from the catalog record to the
last
> four bytes of an eight-byte redefined storage area.
>
> I haven't done it before, so I'll ask... How well does
assembler
> handle conversion of a binary double-word to a packed-decimal
number?

Pretty well, by referring to the register as a 64-bit register, opcode
CVDG.

http://tinyurl.com/jnqc

-jcf


John Ford

unread,
Aug 11, 2003, 12:27:16 PM8/11/03
to
----- Original Message -----
From: "John Ford" <zj...@ChezFord.com>
To: <vs...@Lehigh.EDU>
Sent: Monday, August 11, 2003 11:09 AM
Subject: Re: CVD Assembler Instruction

I should have mentioned that I think you need to have a "z" processor
to use the 64-bit instructions, and a HLASM version that suppports it.
So you may have to put in a request to your boss for a z/900 so you
can use CVDG instead of writing a routine. ;-)

-jcf (again)

John Ford

unread,
Aug 11, 2003, 12:50:10 PM8/11/03
to
----- Original Message -----
From: "John Mycroft" <mycr...@hypercon.net>
To: "VSE Discussion List" <vs...@Lehigh.EDU>
Sent: Sunday, August 10, 2003 7:03 PM
Subject: RE: CVD Assembler Instruction

> I'm going to regret this but here's my prod at a complete answer.
>
> Either
>
> L R8,BINARY4
> SLA R8,1 Sets the cond code to 1 if there is a
> top bit
> SRL R8,1
> CVD R8,PACKED8
> BNO DONE If no overflow, we're done
> AP PACKED8,=P'2147483648'
> DONE DS 0H
>
> I've always said that people who set the condition code and then
don't
> test it until several instructions later are asking for trouble but
what
> the heck.
>
> Option 2
> SLR R8,R8
> L R9,BINARY4
> CVDG R8,PACKED16
>
> Don't ya love those 64 bit instructions?

In the processors that support 64-bit, EACH register is 64 bits, so
you don't have to mess with even/odd pairs. If there's a "G" in the
opcode, it operates on all 64 bits. Otherwise, it operates on bits
32-63 as if it were a 32 bit register.

-jcf


BTW - my email client messed up and sent my previous two posts out of
order.

indust...@dapsco.com

unread,
Aug 11, 2003, 1:42:53 PM8/11/03
to

> How well does assembler handle conversion of a
> binary double-word to a packed-decimal number?

So, I guess my answer is -- at VSE/ESA 2.3 on an MP3000 -- it doesn't.
;-)
I'd basically have to do something similar to what COBOL does for this
situation
(this is for the hi-allocated and hi-used RBA values in the VSAM catalog
rec):

* WORK AREA FOR BYTE-ENCODED NUMBERS
01 DOUBLE-WORD PIC S9(18) BINARY.
01 EIGHT-BYTES REDEFINES DOUBLE-WORD.
03 FILLER PIC X(4).
03 FULL-WORD PIC S9(9) BINARY.
03 FOUR-BYTES REDEFINES FULL-WORD.
05 HI-MSB PIC X.
05 THREE-BYTES.
07 HI-LSB PIC X.
07 HALF-WORD PIC S9(4) BINARY.
07 TWO-BYTES REDEFINES HALF-WORD.
09 LO-MSB PIC X.
09 ONE-BYTE PIC X.

01 EDITTED-NUMBER PIC BZZZ,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9-.
01 WRK-AREA REDEFINES EDITTED-NUMBER.
05 WRK-FIELD PIC X(25).

MOVE LOW-VALUES TO EIGHT-BYTES.
MOVE CAT-D-HARBADS TO FOUR-BYTES.
MOVE DOUBLE-WORD TO EDITTED-NUMBER.

John Mycroft

unread,
Aug 11, 2003, 1:53:00 PM8/11/03
to
>>>>In the processors that support 64-bit, EACH register is 64 bits, so
you don't have to mess with even/odd pairs.

I knew I'd regret it!

John Ford

unread,
Aug 11, 2003, 2:11:44 PM8/11/03
to
----- Original Message -----
From: "John Mycroft" <mycr...@hypercon.net>
To: "VSE Discussion List" <vs...@Lehigh.EDU>
Sent: Sunday, August 10, 2003 7:03 PM
Subject: RE: CVD Assembler Instruction

> I'm going to regret this

That's why we're here, John. ;-)

> but here's my prod at a complete answer.
> Either
>
> L R8,BINARY4
> SLA R8,1 Sets the cond code to 1 if there is a
> top bit
> SRL R8,1
> CVD R8,PACKED8
> BNO DONE If no overflow, we're done
> AP PACKED8,=P'2147483648'
> DONE DS 0H

Terrific solution! But, something kept bugging me about that SLA. I
went to POPs and figured out what it was. When R8 is > 3FFFFFFF, an
overflow will occur (because the bit moving into position 0 is
different than the bit shifting out), and your code will think it
needs the adjustment. Instead, we can do...

L R8,BINARY4
ALR R8,R8 double it to shift; set cond code according to carry
SRL R8,1
CVD R8,PACKED8
BC B'1100',DONE if no carry, we done


AP PACKED8,=P'2147483648'
DONE DS 0H

> I've always said that people who set the condition code and then
don't
> test it until several instructions later are asking for trouble

Amen!

> but what the heck.

I've done it, too... I feel so DIRTY. :-(

<snip2eof>

-jcf

John Ford

unread,
Aug 11, 2003, 3:56:28 PM8/11/03
to
----- Original Message -----
From: "Tony Thigpen" <to...@vse2pdf.com>
To: "VSE Discussion List" <vs...@Lehigh.EDU>
Sent: Friday, August 08, 2003 10:11 AM
Subject: RE: CVD Assembler Instruction

> One accesses memory (which may be in paged-out storage), the other
only the
> register.
> Which do you think would be faster?

Actually, I think N R8,=X'7FFFFFFF' would be faster. I don't think
the difference in register access vs. storage access makes up the
difference, even considering instruction overlap in the CPU pipeline.
There's a good chance that the =X'7FFFFFFF' is already cached,
especially if the programmer makes the assembler put it close to the
instructions. Even if it isn't cached, subsequent instructions
(probably) will need that area soon, so the fetch of that storage to
cache will happen anyway.

I don't think the paged-out situation is very likely, and again, the
programmer can further reduce this chance by putting the literal
constant close to the code. Plus, just as with the cache situation, if
the =X'7FFFFFFF' causes a page fault, you'd probably be getting one
soon, anyway.

Just my little theory. My mileage may vary.

-jcf

John Ford

unread,
Aug 11, 2003, 4:43:48 PM8/11/03
to
----- Original Message -----
From: "John Ford" <zj...@ChezFord.com>
To: "VSE Discussion List" <vs...@Lehigh.EDU>
Sent: Monday, August 11, 2003 1:11 PM
Subject: Re: CVD Assembler Instruction

> ----- Original Message -----
> From: "John Mycroft" <mycr...@hypercon.net>
> To: "VSE Discussion List" <vs...@Lehigh.EDU>
> Sent: Sunday, August 10, 2003 7:03 PM
> Subject: RE: CVD Assembler Instruction
>
>
> > I'm going to regret this
>
> That's why we're here, John. ;-)
>

John,

Now that I think about it, I have to be careful what I say to/about
you, now. I don't have that little "body of water" buffer between us
anymore!

By the way, welcome to America. But what's this "Rugby" thing you keep
chattering about, anyway? :-O

Good to have you here,
-jcf

John Mycroft

unread,
Aug 11, 2003, 11:05:06 PM8/11/03
to
Gday, John

Be as rude to / about me as you like. I understand that freedom of speech
is a jealously guarded right here, a fact that I'm very glad about. I'll
also promise never to put chunks of code in emails again where I do
something stupid with an SLA instruction!

All is almost right with the world regarding rugby - I've found a cable
carrier (Charter) who carries a fair bit though I'd love to find one that
carries more. We're staying with my mother in law at the moment and, for
some odd reason, she doesn't subscribe to the rugby channel. I refuse to
be drawn into a discussion on the relative merits of rugby / American
football and cricket / baseball. I've also discovered that not all American
beer is disgusting - Saranac's India Pale Ale is the best drop I've had in
years, even better than Monteiths Original (just to wind Allan Petersonn
up).

Cheers- John

Imholte, John , Cincinnati, OH

unread,
Aug 13, 2003, 8:07:34 AM8/13/03
to
If we are talking bottled beer Sam Adams is the absolute best that I have
tasted.
My wife read about it in a mystery novel and mentioned it to me and I have
never
looked back.

Don't worry about posting something that is not completely correct I learn
from either.

And welcome to the states!

-----Original Message-----
From: John Mycroft [mailto:mycr...@hypercon.net]
Sent: Monday, August 11, 2003 11:05 PM
To: VSE Discussion List

Subject: Re: CVD Assembler Instruction

Ron.P...@ttc.ca

unread,
Aug 13, 2003, 10:34:19 AM8/13/03
to
Rolling Rock is crisp & clean (and gathers no moss).
Brewed in glass lined kettles.

> -----Original Message-----
> From: Imholte, John (Cincinnati, OH) [SMTP:jimh...@unisource.ca]
>
> If we are talking bottled beer Sam Adams is the absolute best that I have
> tasted.
>

> -----Original Message-----
> From: John Mycroft [mailto:mycr...@hypercon.net]
>

> I've also discovered that not all American
> beer is disgusting - Saranac's India Pale Ale is the best drop I've had in
> years, even better than Monteiths Original (just to wind Allan Petersonn
> up).
>


______________________________________________________________________
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon, this information by persons or entities other than the intended recipient or delegate is strictly prohibited. If you received this in error, please contact the sender and delete the material from any computer. The integrity and security of this message cannot be guaranteed on the Internet. The Sender accepts no liability for the content of this e-mail, or for the consequences of any actions taken on the basis of the information provided. The recipient should check this e-mail and any attachments for the presence of viruses. The sender accepts no liability for any damage caused by any virus transmitted by this e-mail. This disclaimer is the property of the TTC and must not be altered or circumvented in any manner.


Phil Payne

unread,
Aug 13, 2003, 12:16:54 PM8/13/03
to
> If we are talking bottled beer Sam Adams is the absolute best that I have
> tasted. My wife read about it in a mystery novel and mentioned it to me
> and I have never looked back.

Hmm.

Budweiser Budvar (the real Czech stuff)
Newcastle Brown Ale (as a substitute, Mann's Brown Ale)
Worthington White Shield

There's a shop in St Ives, Cambridgeshire, with around 300 different bottled beers. The
Belgian Trappist monks do a decent drop, for instance.

--
Phil Payne
http://www.isham-research.com
+44 7785 302 803
+49 173 6242039

Mark...@mainline.com

unread,
Aug 13, 2003, 12:19:22 PM8/13/03
to

Anchor Steam
Fat Tire Ale - Micro Brew from Colorado

Mark D Pace
Senior Systems Engineer
Mainline Information Systems
1700 Summit Lake Drive
Tallahassee, FL. 32317
mark...@mainline.com
Office: 850.219.5184
Fax: 888.221.9862
http://www.mainline.com


This e-mail and files transmitted with it are confidential, and are
intended solely for the use of the individual or entity to whom this e-mail
is addressed. If you are not the intended recipient, or the employee or
agent responsible to deliver it to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you are not one of the named
recipient(s) or otherwise have reason to believe that you received this
message in error, please immediately notify sender by e-mail, and destroy
the original message. Thank You.

This e-mail and files transmitted with it are confidential, and are
intended solely for the use of the individual or entity to whom this e-mail
is addressed. If you are not the intended recipient, or the employee or
agent responsible to deliver it to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you are not one of the named
recipient(s) or otherwise have reason to believe that you received this
message in error, please immediately notify sender by e-mail, and destroy
the original message. Thank You.


John Mycroft

unread,
Aug 12, 2003, 10:31:38 PM8/12/03
to
Hi, Phil, Mark, John

It's certainly been a minor culture shock for an ex-pat Brit / Kiwi to wind
up in the US of A. Thanks for all the tips about beer but I have been doing
a little research on my own. Delighted to hear that Mann's Brown is still
available - my first job was at Mann's Brewery in Whitechapel, writing 1440
Autocoder and, yes, sampling the beer. As for White Worthington, that was
what we used to drink if we were determined to feel bad next day (e.g. after
break-up with girlfriend). The trick was to swirl the bottle before pouring
the last half inch - that way you got all the grunge that did its worst to
your innards.

As a public service, I offer the following :-
For Brits travelling to the US, drink Saranac IPA, Fat Tire, Anchor Steam,
Highland IPA (NC). More commonly available is Sam Adams. If you must drink
light beer, Sam Adams Light tastes like beer.
For Brits travelling to NZ - drink Monteiths Original
For Monteiths drinkers travelling to the US - behave like a Brit
For anyone travelling to Australia - take your own or give up drinking.
For Germans travelling to the US - you have to tell the barmen not to put
lumps of fruit in your Heffeweisen.

One question that perplexes me - as Burd, Brud Lard, Curse and Curse Lard
are so (adjective deleted to avoid legal action), why are they the only
"beers" that are universally available in the US?

Cheers - John Mycroft
jo...@agands.com

www.agands.com - usually to be found in beautiful NC

PS - I'm currently in Jacksonville, FL, the only place in the world where I
have not been able to drink the tapwater without gagging.


Frank M. Ramaekers Jr.

unread,
Aug 13, 2003, 2:12:56 PM8/13/03
to
Yeah, Sam is my first choice and a close 2nd is Fat Tire.

Frank M. Ramaekers Jr. Redman Consulting Svc. Inc. Tel 303-375-2471
Senior IT Systems Specialist 9458 S. Johnson Street Fax 303-371-2089
MCP, MCP+I, MCSE & RHCE Littleton, CO 80127 eFax 512-857-0781

> -----Original Message-----
> From: owner...@Lehigh.EDU [mailto:owner...@Lehigh.EDU] On Behalf Of

Doug Bryce

unread,
Aug 13, 2003, 10:25:39 PM8/13/03
to
At the time of the first WAVV in Fort Mitchell ('99?), there was a small
brewery in behind the Drawbridge Estates hotel. Is it still running?
(Can't remember its name, and don't have the website address any more)

Doug

Allan.P...@hdsnz.com

unread,
Aug 13, 2003, 10:57:07 PM8/13/03
to
Of course John .....


I am a SPEIGHTs drinker ..... (XXX , Pale , Pilsener , Distinction , Porter
, Dark) , when I can get off these antibiotics .....

My children export (from Dunedin) to me in Auckland , some ale that has been
fermented in ex Wilson's distillery whiskey barrels ... looking forward to
this....and of course getting the cup back from the Aussies this weekend
.....


Allan

Mark...@mainline.com

unread,
Aug 14, 2003, 8:22:46 AM8/14/03
to

Even more amazing to me is that Curse Lard and Swiller Lard are the 2 most
popular *cough*beers*cough* (hard to call those beers) in America.

Jacksonville, Eh. I used to live there. Now I am 2 hours west in
Tallahassee, FL.

John Mycroft

unread,
Aug 14, 2003, 10:07:40 PM8/14/03
to
Gday, Allan

I, too, used to be a Speights drinker - they have the best ads on NZ
television for one thing. But then I discovered Monteiths (also from the
South Island) so I forsook Speights in favour of Monteiths Original &
Pilsener and their Bock in the winter.

But then, shock horror, they started brewing it in Auckland. That's like
Glenfiddich deciding to make their scotch with Jacksonville water.

So I emigrated!

Good on yer, mate.

John

PS - The All Blacks by 15 points and not all from Carlos's boot, either.


Allan.P...@hdsnz.com

unread,
Aug 15, 2003, 7:59:55 PM8/15/03
to
Otago 6 Auckland 3 in the NPC opener .... go the blue & golds

I do like the Monteiths Summer Ale

I "import" my Speights from Dunedin ....

Allan

-----Original Message-----
From: John Mycroft [mailto:mycr...@hypercon.net]
Sent: Friday, 15 August 2003 2:08 p.m.
To: VSE Discussion List

0 new messages