Hi,
Like I indicated in my first reply and subsequently (and eloquently)
expanded upon by Uli, you should use relative addressing rather than
base-displacement. Here's a quick reworking of your example. Scan the .h
files in /usr/include/asm for examples of using S/390 assembler inline.
asm (" CHI %3,20\n"
" JH 0f\n"
" LA %0,2\n"
" J 1f\n"
"0: LA %0,1\n"
"1:\n"
: "=r" (retValue)
: : "cc");
> -----Original Message-----
> Thanks for the info Paul, but unfortunately I didn't specify
> my question
> adequately. I'm writing *IBM* assembler, where a move is
> spelled MVC. My
> third-hand doc says to write IBM opcodes but use Unix syntax.
> Whatever that
> means. Here's a simplified example that would get 2 errors,
> for 2 label
> references:
>
> __asm__ __volatile__(
> " CHI %3,20\n"
> " BH LABEL1\n"
> " LA 2,1\n"
> " B LABEL2
> "LABEL1 LA 2,0\n"
> "LABEL2 BR 14\n"
> : "=a" (retValue)
> : "d" (pProc), "d" (pStack), "d" (cbStack)
> );
>
> I have already displayed that certain simple register
> manipulation works in
> context, so I am confident that this language works, and that
> I am on the
> right track.
>
> On the other hand, it's news to me that AT&T/Unix assembler
> can work on an
> IBM S/390 box. I was only brought in on this project cuz I know IBM
> assembler. If Unix assembler can be used just as well, maybe
> I will try to
> dump this thing back on our Unix guy...