On Fri, 15 May 2015 18:47:43 -0700, glen herrmannsfeldt <[email protected]> 
wrote:

>In the HLASM release 5 manual, there is an example:
>
>I now have an example from Tachyonsoft that looks like:
>
>MYCODE   START  1000
>         USING MYCODE,0
>LOOP     MP X,Y
>         DP X,Z
>         ZAP X,X(13)
>         B LOOP
>X        DC PL16'8000'
>Y        DC PL3'8001'
>Z        DC PL3'8000'
>         END  LOOP
>
>which seems to work.  It does generate offsets from zero,
>instead of from 1000 that it looks like it would.
>I still don't know why it doesn't subtract 1000 from the
>displacements.

I'm not sure if you ever really got an answer to that question, but in case you 
haven't: Remember that 0 is not really a base register. If an instruction has 0 
for the base or index register than a value of 0 is used, rather than the 
contents of register 0. Therefore, if LOOP is at location 1000, the "B LOOP" 
must contain a displacement of 1000 or the instruction can't work. That applies 
to the other locations your instructions reference, too.

You might try changing the program to something like:
MYCODE   START  1000
                LA   3,1000
                USING MYCODE,3
LOOP       MP X,Y
                DP X,Z
etc.

That will probably give you what you were expecting to see for displacement 
values, because there the base register is actually contributing to the value.

-- 
Walt

Reply via email to