Re: Learning ED instruction - need some help



High Level Assembler(HLASM) for MVS & VM & VSE

Re: Learning ED instruction - need some help

Postby fast_learner » Mon Aug 27, 2012 1:42 am

It seems I am discovering very simple mistakes in my questions every time I visit it. I have corrected the mistake, pls refer the below question for the correct version ::
The 2 typo'd posts have been removed.

Question::

Given X DC PL3'1234' and MASK DC XL6'402020202020', show the value of WK6 or WK4 after each of the following, pls note that each step is an individual step and and there is no co-relation between them :

1. MVC WK6,MASK
ED WK6,X
2. MVC WK4,MASK
ED WK4,X+1

WK6 DS CL6
WK4 DS CL4

I have reached to the below solution for each step, can you pls confirm if that is correct ::

1. MVC WK6,MASK
ED WK6,X

WK6 = x'402020202020' - after MVC instruction
WK6 = x'4040F1F2F3F4' - after ED instruction

2. MVC WK4,MASK
ED WK4,X+1
WK4 = x'40202020' - after MVC instruction
WK4 = x'40F2F3F4' - after ED instruction

Can you pls confirm if my outputs of WK6 and WK4 are correct. I am especially concerned for WK4 output.
fast_learner
 
Posts: 9
Joined: Wed Aug 22, 2012 9:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Learning ED instruction - need some help

Postby steve-myers » Mon Aug 27, 2012 5:27 am

This is not an appropriate place for a tutorial, but I'll try.
  • There are three classes of characters in an ED instruction “mask:”
    • A fill character, always the first character in the “mask.” The fill character replaces digit select and text characters.
    • Two types of digit select characters.
      • A regular digit select character, X'20'.
      • A significance start digit select character, X'21'.
      The ED instruction replaces digit select characters with an EBCDIC numeric character or the fill character. An EBCDIC numeric character is used if the corresponding packed decimal digit is non-zero, or a preceding digit select character inserted a number. The fill character is used if the corresponding packed decimal digit is 0. The significance start digit select character sets a switch that implied a non-zero packed decimal digit has been encountered
    • A text character. Text characters are replaced with the fill character if significance has not been established.
I do not use ED very often in my own work, so I've never memorized the hexadecimal codes for many common text characters like comma (,). I construct my edit mask using compound DC statements like

EDMASK DC 0C'bNN,NNN',C'b',X'2020',C',',X'202120'

The lower case b is really a blank, because blanks do not display well here.

The 0C'bNN,NNN' part is a simplified mask that describes the real mask.

C'b' is the fill character.

X'2020',C',',X'202120' is the digit select characters and an imbedded text character.

An important detail is most real world edit "masks" contain an odd number of digit select characters because all real packed decimal characters contain an odd number of digits.

So

ED EDMASK,=PL3'99999'' generates C'b99,999'
ED EDMASK,=PL3'1024' generates C'bb1,024'
ED EDMASK,=PL3'0' generates C'bbbbbb0'

Text characters that follow the last digit select character are replaced with the fill character if the packed decimal sign is a preferred or alternate +.

Historically there have been two simplified mainframe simulators for PCs.
  • PC370 - PC370 is a 16-bit MS-DOS application. It should run in Windows XP, but not Vista or Win 7.
  • z390.org - z390 is a Java application. Its principal author appears to be the primary author of PC370.
I can't vouch for either product.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Re: Learning ED instruction - need some help

Postby dick scherrer » Mon Aug 27, 2012 7:45 am

Hello,

There is also
http://www.hercules-390.org/
While this is an excellent product, you should have a very deep understanding of how mvs works before attempting to install/run this at home. Also, you have to install an Operating System because Herculs emulates the hardware. Available to Hercules is an older release of MVS - 3.8 IIRC. With this you can do Many things.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Learning ED instruction - need some help

Postby fast_learner » Mon Aug 27, 2012 1:57 pm

Thanks for your reply Steve and Dick.

Can I request you to confirm just one more aspect of my understanding?

Given X DC PL3'1234' and MASK DC XL6'402020202020'

MVC WK4,MASK
ED WK4,X+1

where WK4 is defined as below,

WK4 DS CL4

I wanted to confirm my understanding of explicit displacement of X+1 with the second operand of ED instruction.

After ED WK4,X+1 in above command, will WK4 hold x'40F2F3F4'.

Can you pls suggest?

I am trying to get an emulator for assembler in the meanwhile and I am also referring to the links/emulators names as mentioned above.

Requesting other registered users as well to comment.
fast_learner
 
Posts: 9
Joined: Wed Aug 22, 2012 9:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Learning ED instruction - need some help

Postby enrico-sorichetti » Mon Aug 27, 2012 2:03 pm

I am trying to get an emulator for assembler in the meanwhile

why waste time reinventing the wheel ???
http://www.z390.org/
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post