View previous topic :: View next topic |
Author |
Message |
Pudah Beginner
Joined: 20 Jun 2003 Posts: 27 Topics: 8 Location: East of the Rock, West of the Hard Place
|
Posted: Sat Aug 14, 2004 11:04 am Post subject: Convert hex to character |
|
|
I have searched the forum but haven't been able to find this topic covered.
Say I have a field XL1'D3'. I want to convert it to CL2'D3'. Is there a way to do this in assembler? |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Sat Aug 14, 2004 3:30 pm Post subject: |
|
|
I think this will do it. Try it, and let us know:
Code: |
MVC OUTFIELD(1),INFIELD
MVC OUTFIELD+1(1),INFIELD
TR OUTFIELD(1),TABLE1
TR OUTFIELD+1(1),TABLE2
INFIELD DC X'D3'
OUTFIELD DS CL2
TABLE1 DC 16C'0',16C'1',16C'2',16C'3'
DC 16C'4',16C'5',16C'6',16C'7'
DC 16C'8',16C'9',16C'A',16C'B'
DC 16C'C',16C'D',16C'E',16C'F'
TABLE2 DC 16C'0123456789ABCDEF'
|
Check out this manual:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DZ9ZR003/CCONTENTS?DT=20040504121320 _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Mon Aug 16, 2004 9:14 am Post subject: |
|
|
None of those links actually solves the problem, which is about converting a byte to printable hex characters using Assembler. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
Pudah Beginner
Joined: 20 Jun 2003 Posts: 27 Topics: 8 Location: East of the Rock, West of the Hard Place
|
Posted: Tue Aug 17, 2004 4:11 pm Post subject: |
|
|
Quote: | None of those links actually solves the problem, which is about converting a byte to printable hex characters using Assembler. |
Mervyn is correct. I had done a search and found those threads. But none of them discussed assembler.
And I did try your code suggestion Mervyn, and it worked like a charm. Thanks a bunch. I still need to ponder the TABLE1 entries though, because I'm not clear on why it works. I'll look thru that manual you linked to and see if I can get a clearer picture on what's going on.
Thanks again! |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Tue Aug 17, 2004 5:33 pm Post subject: |
|
|
Superb. The Principles of Operation manual will teach you more than I ever could. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
|
|