L not working as expected

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

Re: L not working as expected

Postby steve-myers » Sun Jul 02, 2017 5:40 pm

The START Assembler instruction is rarely used any more. It was useful in an environment where you knew in advance where the operating system would load your program. For example, the PCP (Primary Control Program option in OS/360 would always load your program at the same address - always some 2K multiple + X'20'. This was convenient for debugging. This sort of constant load address was rarely true with the MVT option, and that's still the case with z/OS.

The NOP and NOPR extended branch mnemonic instructions are discussed, poorly (in my opinion) in the Branching with extended mnemonic codes chapter in the High Level Assembler for z/OS & z/VM & z/VSE Language Reference manual. Both NOP and NOPR expect an operand, though 0 is perfectly acceptable. NOP and NOPR create a BC or BCR instruction with a condition mask of binary 0s so they never branch.

Something like XYZ DS 0A is very dangerous. Yes, it creates the symbol, but it also forces boundary alignment, which means the Assembler can insert nothing (literally) into your program text so the symbol is placed on a word boundary when the system actually loads your program. If you must do this use XYZ DS 0H. This also forces boundary alignment, but ordinary instructions also force boundary alignment. When I do this, by the way, I use XYZ DC 0H'0'. This also forces boundary alignment, but it also tells the Assembler to insert a byte of binary 0s into the program text rather than nothing. The effect is usually the same, but, frankly, I prefer binary 0s.

I have to go now.
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: L not working as expected

Postby willy jensen » Sun Jul 02, 2017 10:43 pm

I did say ' in this case 'ds 0a' works'', because the preceeding instruction is an unconditional branch. I agree that in general 'ds 0h' is probably safer, however nothing is safe in assembler unless you know what you are doing. In my own code I never use neither 'ds 0a' nor 'ds 0h' in the middle of a instruction sequence, I prefer to label the instructions or use a labelled 'CNOP 0.4'.
willy jensen
Posts: 460
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times


Return to Assembler


  • Related topics
    Last post