|
Displaying the Contents of a Register (Hex to Character)
There are several different ways of converting hex strings to character. This one is quick and easy for short fields, such as register contents. If the register contains, for example, XL4'000000C7', the final work field (WORKOUT) will contain CL8'000000C7', ready to move into a print line or WTO text area.
 |
 |
 |
 |
*
HEXTBL ZEROS *
WORKIN
* WORKOUT
*
|
ST UNPK MVZ TR
DC DC
DS DS DS
DS DS
|
R4,WORKIN WORKOUT(9),WORKIN(5)
WORKOUT,ZEROS WORKOUT,HEXTBL
C'0123456789ABCDEF' 8X'00'
0F XL4 XL1
XL8 XL1
|
Save register in workarea Unpack contents of register Clear high order nibbles Translate to character
Translation table Binary zeros
Align for STore
Input work area . overflow padding byte
Output workarea . overflow padding byte
|
Register Arithmetic
|
|
SLR BCTR LA SLA SLA |
R4,R4 R4,R0
R4,1(,R4) R4,1(R0) R4,2(R0) |
Zero register Decrement register by 1 Increment register by 1 Multiply by 2 Multiply by 4 |
Initializing Fields with Binary Zeros
|
|
XC * OC BZ * MVI MVC * LA LH SLR MVCL
* |
FIELD,FIELD
FIELD,FIELD ISNULL
FIELD,X'00' FIELD+1(L'FIELD-1),FIELD
R4,TARGET R5,TARGLEN
R9,R9 R4,R8
|
Clear short field
Is field binary zeros? Yes, it is
Insert padding character into 1st byte Copy padding character to other bytes
Point 1st even-register at target Load length of target into 1st odd-reg Zero 2nd odd-register (nothing to copy) Pad entire target with binary zeros
|
New Operation Codes in HLASM covers some of the instructions that have been added to assembler in recent years, such as the "Compare Halfword Immediate".
High Level Assembler for MVS and HLASM Toolkit This is IBM's main page for announcing new features in HLASM and details on the HLASM Toolkit. There are links to related products and copies of presentations from last winter's Share.
Assembler programmer's song
Every bit is sacred, Every bit is right.
If a bit is wasted, I can't sleep at night.
Every bit is gorgeous, Every bit is free.
Admire the shape it forges, In hex and BCD! (July 2001 Dr Dobbs Journal)
|
|
| TOP OF PAGE |
There is always an easy solution to every...problem -- neat, plausible, and wrong. (H.L. Mencken) |
|
|