I had the pleasure of doing a lot of work with the Structured Programming
macros that we have for CMS Pipelines.

Unlike the SPM from HLASM Toolkit, things like IF / THEN / ELSE and some
expect the condition code to be produced by normal instructions, so the
argument for IF is a condition code. I like that because it does not put
instructions with possible side effect in your condition code. There's also
a shortcut for an IF statement with just one statement in the body and no
ELSE clause. And some of the others have an extra check on condition code
too. The exception is probably the CASE statement where you provide the
skeleton and the instructions for compare and branch are generated for each
entry.

What really helps is having nested procedures with a stack for local
variables that is pre-computed based on static nesting where possible, so
you don't incur the overhead of all that dynamic memory allocation. This
avoids code duplication in many cases and helps making the modules more
compact so you don't run out of base registers that quick.

It really works. I have not needed to code branch instructions or invent
labels and it helped me produce good quality code quicker than without.
http://www.rvdheij.nl/Presentations/2009-s8134.pdf

Rob


On 18 May 2016 at 13:36, Bernd Oppolzer <bernd.oppol...@t-online.de> wrote:

> Am 18.05.2016 um 13:15 schrieb Steve Hobson:
>
>> >From Bernd Oppolzer:
>>
>> If you specify this global "baseless" parameter (specified at the
>>> startup macro and controlling
>>> all SP macros and the lightweight CALL and PROC macros), there is
>>> only one base register
>>> which covers the area after ENDPROC, allowing for up to 4 k of local
>>> static variables
>>>
>> FWIW, if you can use the long-displacement instuctions then you can
>> access a pretty much unlimited amount of local static with one base
>> register.
>>
>> Best regards, Steve Hobson
>>
>>
>> Thank you for your comments on this.
>
> The macros I mentioned in my original post had their origins in a time
> when all instructions
> had 12 bit offsets, so that the range covered by one base register was 4 k
> only. Anyway: because
> every function block has its own 4 k local static area and you can have an
> unlimited number of them
> in one module, the module size could be really large, in those long gone
> times already, if you used
> those (procedure) macros and the SP macros from the start. All function
> blocks shared the same base
> registers (one for the code area = 4k, one for the static area = 4k) and
> then there were two for the
> code area of the main line, two for the global static area, and this still
> left some for other addressing
> and computing tasks. Some large programs ran out of registers, anyway.
> Going "baseless" made things
> much easier.
>
> Kind regards
>
> Bernd
>

Reply via email to