On Thu, Oct 22, 2015 at 10:17 AM, Farley, Peter x23353 < [email protected]> wrote:
> John, > > Depending on the OPT, ARCH and TUNE compiler settings I suspect it may be > an optimization to avoid AGI (Address Generation Interlock). Nothing to do > with alignment per se. > > And to your desire to replace the C prologue and epilogue -- Check out > Metal C. It allows you to do precisely that. You lose almost all I/O > facilities though, and you are thus forced / allowed to use inline > assembler I/O or your own custom-built I/O subroutines. > I was really trying to avoid Metal C. What I'm aiming at is to rewrite my CBT distributed UNIX HLASM programs as C programs instead. Although I don't really know why I should. Just another of my oddities, I guess. I don't even know if those programs are very popular or nor. I would guess not. I doubt there are many z/OS people who like playing on the UNIX command line instead of in ISPF. I am just guessing that the newest xlc compiler was enhanced with in-line assembler for non-Metal C mainly due the GNU C's ability to do so. Some of the options in xlc seem to be "echoing" some of the abilities that GNU C has. Perhaps to lure some GNU / Linux people to at least consider xlc. > > HTH > > Peter > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of John McKown > Sent: Thursday, October 22, 2015 10:59 AM > To: [email protected] > Subject: Re: C lang. embedded HLASM latest z/OS 2.1 > > On Thu, Oct 22, 2015 at 9:40 AM, Elardus Engelbrecht < > [email protected]> wrote: > > > John McKown wrote: > > > > >Mainly that the compiler inserted an NOPR 0 after my simple command. > > > > Hmmm, I remembered that Borland Turbo Pascal [1] could do that similar > > trick, but I don't have MSDOS and Pascal anymore. > > > > I never tried that [inserting machine code to speed up things] out with C > > and C++. > > > > > *000004 0700 9 NOPR 0 > > > 000074 581D 00B0 000009 | L > r1,176(r13,) > > > > Is that compiler action just for [full word / half word?] alignment? > > Increase/decrease the instruction length by 1 or 2 bytes with same or > other > > instruction and see where it ends up. > > > > Hum, I inserted a second instruction "LR 2,1" after the first one: > > 000009 | * __asm(" L 1,%0\n LR > 2,1":"=m"(i3)::"r1","r2"); > *000000 581D 00B0 000B0 8 L 1,176(13) > 000009 > *000004 1821 9 LR 2,1 > 000009 > *000006 0700 10 NOPR 0 > 000009 > 000074 581D 00B0 000009 | L r1,176(r13,) > > 000078 1821 000009 | LR r2,r1 > > 00007A 0700 000009 | NOPR 0 > 000010 | * printf("%.*s\n",i1,word); > > > The NOPR is still there. I wonder if it is somehow used if I were to set a > break point in a debugging session. I.e. the NOPR is there so that it can > be overlain with the debug SVC or whatever is used. > > I'm just doing this to see if I can get up to the real desire: to embed > assembler macros, such as TPG (TSO terminal I/O), in my C code. Although > it might actually be simpler to just continue writing LE enabled HLASM > "service" routines. > Hum, wish I had a way to make an HLASM "program" which could be "in > lined" by the C compiler in order to avoid the entry/exit code overhead. I > am still, perhaps stupidly, concerned with "CPU overhead". If I weren't I > could be a Windows programmer! <grin type="snide"/> > > -- > > > This message and any attachments are intended only for the use of the > addressee and may contain information that is privileged and confidential. > If the reader of the message is not the intended recipient or an authorized > representative of the intended recipient, you are hereby notified that any > dissemination of this communication is strictly prohibited. If you have > received this communication in error, please notify us immediately by > e-mail and delete the message and any attachments from your system. > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > -- Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
